Skip to content

Instantly share code, notes, and snippets.

@sfpgmr
Last active March 30, 2019 20:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sfpgmr/cee0c48acb0854e2055c to your computer and use it in GitHub Desktop.
Save sfpgmr/cee0c48acb0854e2055c to your computer and use it in GitHub Desktop.
three.jsのPathのシリアライズ(2)
node_modules

three.jsのPathのシリアライズ(2)

エドワード・マイブリッジの「Horse in motion」をInkscapeでトレースし、各馬をセル化したものをthree.jsのshapeに変換し表示しています。

今回はシリアライズ・デシリアライズのコードを最適化してみました。 http://bl.ocks.org/sfpgmr/cee0c48acb0854e2055c#pathSerializer.js

下記のURLから動くデモが見れます。Windows 10 Tech Preview 9926 のIE11では動作しませんでした。ひょっとするとIE11ではそもそも動作しないのかもしれません。原因は不明ですが。。

http://bl.ocks.org/sfpgmr/cee0c48acb0854e2055c

Display the source blob
Display the rendered blob
Raw
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" id="svg2" viewBox="0 0 1536 952" height="952" width="1536" inkscape:version="0.92.4 (5da689c313, 2019-01-14)" sodipodi:docname="horse07.svg">
<sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" borderopacity="1" objecttolerance="10" gridtolerance="10" guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="1920" inkscape:window-height="1027" id="namedview4154" showgrid="false" inkscape:zoom="2.8284" inkscape:cx="1040.4" inkscape:cy="560.07" inkscape:window-x="-8" inkscape:window-y="-8" inkscape:window-maximized="1" inkscape:current-layer="layer15" />
<defs id="defs4" />
<metadata id="metadata7">
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g inkscape:groupmode="layer" id="layer7" inkscape:label="00" style="display:inline">
<path id="horse00" style="display:inline;opacity:1;fill:#000000" d="m 223.44,240.58 c 0,-0.5 -0.84,-5.58 -1.88,-5.58 -3.07,0 -4.61,-2.62 -3.27,-5.57 0.63,-1.38 1.42,-4.89 1.76,-7.8 0.73,-6.14 1.57,-5.54 -14.61,-10.58 -21.09,-6.59 -22.06,-7.09 -18.74,-9.85 2.73,-2.26 6.27,-2.38 8.19,-0.26 1.02,1.13 2.42,2.06 3.1,2.06 0.69,0 3.2,1.11 5.6,2.47 4.8,2.73 11.47,4.09 15.32,3.13 1.37,-0.35 3.13,-1.86 3.91,-3.36 2.65,-5.14 5.62,-15.56 5.62,-19.74 v -4.16 l -11.77,-1.15 c -13.02,-1.28 -25.22,-4.53 -34.31,-9.15 -8.4,-4.27 -13.02,-4.14 -17.26,0.49 -2.66,2.91 -4.64,3.88 -11.2,5.49 -4.38,1.08 -9.14,1.96 -10.59,1.97 -3.25,0 -5.24,2.25 -4.39,4.94 0.35,1.11 3.56,4.65 7.13,7.88 6.31,5.69 6.52,6.05 7.42,12.27 1.84,12.69 0.96,14.51 -4.19,8.74 -3.32,-3.72 -3.32,-3.69 -1.24,-6.65 1.49,-2.13 1.45,-2.43 -0.53,-4.48 -1.17,-1.2 -6.24,-6.91 -11.27,-12.69 -5.04,-5.77 -9.77,-10.65 -10.53,-10.83 -3.01,-0.73 -3.98,1.87 -4.66,12.58 -0.62,9.66 -0.94,10.98 -3.15,13.04 -1.35,1.26 -2.46,2.67 -2.46,3.13 0,0.68 -7.35,3.08 -9.44,3.08 -0.31,0 -0.56,-1.02 -0.56,-2.28 0,-3.61 2.75,-6.72 5.94,-6.72 3.72,0 4.33,-2.58 4.63,-19.5 0.13,-7.15 0.28,-13.56 0.33,-14.25 0.1,-0.91 2.88,-1.25 10.35,-1.27 5.64,0 10.83,-0.38 11.54,-0.83 1.57,-1 0.55,-4.08 -3.14,-9.53 -3.42,-5.03 -4.27,-11.19 -2.24,-16.07 2.98,-7.12 1.36,-7.6 -3.54,-1.05 -1.85,2.47 -4.49,4.79 -5.87,5.14 -1.37,0.35 -4.4,2.17 -6.72,4.04 -2.32,1.87 -5.69,3.9 -7.5,4.5 -1.8,0.6 -4.18,1.86 -5.28,2.79 -3.1,2.63 -10.603,5.04 -15.533,4.98 -5.651,-0.1 -11.432,-2.79 -11.568,-5.46 -0.06,-1.09 -1.069,-3.88 -2.25,-6.2 -2.4,-4.7 -2.791,-8.3 -0.898,-8.26 0.687,0 3.95,1.83 7.25,4.03 3.877,2.59 6.707,3.83 8,3.49 1.1,-0.29 3.012,-0.53 4.25,-0.54 2.329,-0 3.303,-2.98 1,-3.05 -3.167,-0.1 5.077,-4.89 9.429,-5.48 2.65,-0.37 6.41,-1.75 8.36,-3.07 1.95,-1.33 4.35,-2.41 5.33,-2.41 0.98,0 5.12,-1.14 9.21,-2.53 4.08,-1.4 10.12,-2.96 13.42,-3.49 3.3,-0.52 8.46,-1.63 11.47,-2.46 7.34,-2.04 14.47,-1.91 27.03,0.48 13.24,2.52 22.49,2.71 21.61,0.42 -0.47,-1.21 6.52,0.47 8.64,0.61 6.86,0.45 13.37,0.94 20.92,-4.78 15.68,2.15 9.27,0.21 20.08,-6.27 1.79,0 6.75,-5.5 6.75,-6.48 0,-0.82 0.69,-1.5 1.53,-1.5 0.88,0 1.77,-1.22 2.1,-2.92 0.42,-2.09 1.34,-3.1 3.23,-3.56 3.78,-0.928 12.14,-9.397 12.14,-12.3 0,-2.747 0.34,-2.691 12,1.949 8.86,3.528 12.76,5.517 24.91,12.701 9.8,5.8 10.84,7.53 7.54,12.57 -1.45,2.2 -2.11,2.35 -9.51,2.13 -4.37,-0.14 -8.25,-0.55 -8.61,-0.91 -1.26,-1.26 -12.44,-0.65 -15.31,0.83 -2.94,1.52 -4.65,4.68 -3.52,6.51 0.35,0.56 -0.3,2.2 -1.43,3.64 -1.14,1.45 -2.07,3.44 -2.07,4.42 0,2.63 -6.65,14.96 -9.94,18.44 -3.89,4.11 -6.51,9.78 -8.07,17.5 -1.1,5.44 -1.95,7.1 -5.25,10.18 -2.16,2.03 -6.16,4.49 -8.9,5.47 -4.16,1.5 -5.82,2.93 -10.2,8.82 -3.61,4.83 -5.98,9.37 -7.59,14.53 -1.28,4.13 -2.71,8.63 -3.16,10 -0.45,1.38 -0.95,4.74 -1.11,7.48 -0.27,4.83 -0.19,5.01 3.02,6.06 1.87,0.62 6.13,6.42 7.18,8.18 2.17,3.19 11.55,2.3 -11.98,1.86 z" inkscape:connector-curvature="0" inkscape:label="#path4833" sodipodi:nodetypes="ssccsscscccscssscscsssccscscssssscccsscscssccsccccccssssssccccssccsscccccccscsccsccscccs" />
<rect style="display:inline;opacity:0.38000039;fill:none;stroke:#000000;stroke-width:1.00782073;stroke-opacity:1" id="frame00" width="358.99219" height="238.99217" x="22.490698" y="29.846764" inkscape:label="#rect5342" />
</g>
<g inkscape:groupmode="layer" id="layer8" inkscape:label="01" style="display:inline">
<rect style="display:inline;opacity:0.38000039;fill:none;stroke:#000000;stroke-width:1.00782073;stroke-opacity:1" id="frame01" width="358.99219" height="238.99217" x="398.17059" y="31.170578" inkscape:label="#rect5342-4" />
<path id="horse01" style="display:inline;opacity:1;fill:#000000" d="m 541.94,184.42 v -6.92 l -3.93,0.32 c -7.29,0.58 -12.2,4.51 -9.58,7.66 1.5,1.81 11.15,6.55 12.51,6.15 0.55,-0.16 1,-3.41 1,-7.21 z m 84.35,15.15 c 3.49,-0.75 6.79,-1.81 7.34,-2.36 2.06,-2.06 -2.08,-6.75 -9.94,-11.26 -4.44,-2.54 -4.9,-2.61 -7.83,-1.21 -3.54,1.69 -9.13,10.96 -8.15,13.53 0.57,1.47 3.43,2.22 9.73,2.53 1.38,0.1 5.36,-0.48 8.85,-1.23 z m -39.68,9.4 c 4.07,-1.13 9.83,-6.96 9.83,-9.95 0,-1.04 0.39,-2.14 0.86,-2.43 0.47,-0.3 1.62,-3.23 2.54,-6.53 0.93,-3.3 2.12,-6.26 2.64,-6.59 1.58,-0.97 1.08,-4.21 -0.76,-4.91 -0.94,-0.37 -6.44,-1.58 -12.22,-2.69 -5.78,-1.12 -14.45,-3.57 -19.26,-5.45 -4.82,-1.88 -9.13,-3.42 -9.59,-3.42 -0.46,0 -2.06,1.28 -3.55,2.84 -3.22,3.35 -7.24,16.72 -6.23,20.72 0.69,2.76 7.07,6.18 17.07,9.16 3.45,1.02 6.31,2.84 9.23,5.88 4.72,4.9 4.37,4.78 9.44,3.37 z m -30.07,7.2 c -1.13,-0.79 -0.91,-1.45 1.21,-3.57 2.69,-2.69 5.58,-3.26 8.52,-1.69 1.93,1.03 7.17,0.3 7.17,-1.01 0,-2.75 -15.47,-9.8 -21.63,-9.87 -3.28,0 -4.32,1.6 -4.36,6.77 0,2.74 -2.67,8.2 -3.99,8.2 -0.52,0 -1.48,-1.8 -2.14,-4 -1.04,-3.48 -0.97,-4.25 0.58,-5.96 1.86,-2.05 1.49,-5.04 -0.61,-5.04 -0.67,0 -2.15,-0.84 -3.28,-1.87 C 535.6,195.94 520.65,188 518.95,188 c -0.64,0 -2.21,-1.12 -3.5,-2.49 -2.31,-2.46 -2.32,-2.51 -0.43,-4.6 1.06,-1.17 3.83,-3.24 6.17,-4.61 4,-2.35 8.25,-6.99 8.25,-9.03 0,-0.5 -2.15,-1.89 -4.78,-3.07 -2.63,-1.19 -6.53,-3.96 -8.67,-6.15 -4.2,-4.3 -4.72,-6.73 -3.18,-14.8 0.76,-4.02 0.68,-4.25 -1.53,-4.25 -3.87,0 -15.06,5.85 -19.51,10.19 -2.29,2.24 -5.33,4.19 -6.74,4.35 -2.42,0.27 -6.77,3.19 -14.37,9.66 -5.2,4.43 -14.1,3.42 -17.39,-1.97 -0.92,-1.5 -3.08,-4.74 -4.79,-7.19 -2.95,-4.22 -3.01,-4.51 -1.18,-5.18 1.06,-0.4 2.23,-1.2 2.6,-1.79 0.76,-1.23 5.54,-1.47 5.54,-0.27 0,1.07 6.04,3.2 9.1,3.2 1.35,0 3.98,-1.39 5.84,-3.09 4.69,-4.29 16.16,-9.67 23.46,-11.02 18.81,-3.46 25.22,-5.78 33.6,-12.17 6.84,-5.21 11.48,-5.68 26.29,-2.66 12.49,2.54 19.68,2.74 20.9,0.57 0.67,-1.21 1.44,-1.34 3.41,-0.59 2.81,1.06 7.75,1.28 8.65,0.38 33.68,4.89 34.75,-5.04 40.56,-11.14 6.43,-7.79 6.43,-7.79 6.43,-7.79 -0.38,-1.98 0.19,-2.644 3.41,-4.003 l 3.85,-1.628 -3,-2.443 c -3.4,-2.766 -3.19,-3.078 4.25,-6.535 2.34,-1.086 4.25,-2.291 4.26,-2.678 0,-0.864 4.9,-3.203 6.7,-3.203 3.49,0 14.7,6.356 24.79,14.057 3.3,2.519 8.62,6.253 11.82,8.293 5.56,3.55 5.79,3.86 5.14,6.93 -0.37,1.77 -1.38,4.01 -2.23,4.97 -1.78,2.02 -5.87,2.34 -6.48,0.5 -0.28,-0.83 -2.39,-1.2 -6.33,-1.11 -3.26,0.1 -6.19,-0.29 -6.53,-0.83 -0.33,-0.54 -3.29,-1.22 -6.56,-1.51 -5.74,-0.52 -6.04,-0.43 -8.64,2.66 -2.83,3.36 -3.5,6.04 -1.5,6.04 0.66,0 0.41,0.57 -0.55,1.28 -0.96,0.7 -2.79,4.26 -4.07,7.92 -1.28,3.65 -4.4,10.46 -6.94,15.12 -2.98,5.46 -4.63,9.72 -4.63,11.95 0,1.95 -0.87,4.57 -2,6 -1.1,1.4 -2,3.24 -2,4.09 0,0.85 -1.57,3.07 -3.5,4.94 -1.92,1.87 -3.5,3.86 -3.5,4.41 0,0.56 1.46,2.62 3.25,4.6 9.09,10.02 10.98,13.5 9.05,16.59 -1.23,1.97 -16.77,6.04 -24.32,6.36 -3.7,0.16 -6.9,-0.38 -9.73,-1.65 -5,-2.25 -6.06,-1.68 -9.16,4.92 -1.52,3.23 -2.83,4.6 -4.84,5.05 -1.51,0.34 -4.32,1.04 -6.25,1.56 -5.1,1.38 -29.23,2.18 -30.9,1.03 z" inkscape:connector-curvature="0" inkscape:label="#path4793" sodipodi:nodetypes="scsscssscsccscscscccssccscccsssccsccscscsssscscscsccccsssssscccccscsscssscccccccscscscscsscccsccc" />
</g>
<g inkscape:groupmode="layer" id="layer9" inkscape:label="02" style="display:inline">
<path id="horse02" style="display:inline;opacity:1;fill:#000000" d="m 934.44,186.13 c 0,-3.06 -3.35,-8.13 -5.38,-8.13 -0.67,0 -2.75,1.58 -4.62,3.5 -3.82,3.94 -3.4,5.19 2.16,6.51 6.6,1.56 7.84,1.26 7.84,-1.88 z m 48.8,16.67 c 1.45,-1.45 1.64,-17.5 0.25,-21.17 -0.77,-2.02 -1.85,-2.62 -5.75,-3.15 -7.48,-1.02 -18.53,-4.26 -25.85,-7.57 -3.66,-1.67 -6.88,-2.81 -7.15,-2.55 -1.44,1.45 -2.14,8.97 -1.31,14.1 0.95,5.83 2.34,8.54 4.38,8.55 0.62,0 2.86,0.48 4.98,1.07 3.29,0.91 3.79,1.41 3.41,3.41 -0.41,2.12 -0.16,2.29 2.66,1.83 2.31,-0.38 3.59,0 5,1.59 1.04,1.15 2.63,2.09 3.54,2.09 0.9,0 2.07,0.41 2.59,0.9 2.21,2.1 11.42,2.73 13.25,0.9 z m 28.66,-96.78 c 1.5,-1.61 1.6,-2.26 0.6,-3.49 -1.9,-2.21 -0.6,-4.332 3.1,-5.307 2.8,-0.722 3.3,-1.328 3.4,-3.785 0,-2.102 0.6,-3.025 2,-3.281 2.4,-0.432 6.4,-4.041 6.4,-5.709 0,-0.662 0.7,-1.712 1.4,-2.333 1,-0.863 2.8,-0.513 7.3,1.478 12,5.324 16.5,8.059 23.6,14.153 4,3.434 7.6,6.244 8.1,6.254 0.4,0 2.2,1.12 4,2.49 2.7,2.03 3.2,3.02 2.9,5.42 -0.3,1.61 -1.5,3.93 -2.8,5.14 -2.5,2.31 -4.2,2.29 -10.1,-0.13 -2.7,-1.1 -4.1,-0.98 -10.5,0.91 -4,1.19 -8,2.17 -8.8,2.17 -2.7,0 2.2,-2.67 6.3,-3.43 5.3,-0.97 3.3,-2.85 -3.2,-2.97 -4,-0.1 -5.5,0.41 -7.6,2.33 -1.4,1.34 -2.5,2.91 -2.4,3.5 0.2,0.59 -0.2,1.98 -0.9,3.09 -0.6,1.11 -2.1,4.89 -3.2,8.41 -1.2,3.52 -3.3,8.65 -4.7,11.4 -1.6,3.08 -2.7,7.18 -2.9,10.69 -0.2,3.44 -1.3,7.59 -2.8,10.51 -2.3,4.48 -2.4,4.99 -0.9,6.93 0.9,1.15 4.9,4.27 8.9,6.92 9.8,6.47 9.8,7.19 -1.6,18.36 l -8.8,8.76 -8.2,-0.29 c -7.8,-0.28 -8.2,-0.4 -7.9,-2.5 0.5,-2.99 6.4,-6.01 8.8,-4.48 1.4,0.82 2.8,0.67 6.2,-0.65 5,-2.03 7.5,-4.04 9.4,-7.7 2.9,-5.52 -2.6,-7.76 -19.1,-7.84 -5.8,0 -9.63,0.41 -10.61,1.21 -1.62,1.31 -5.25,13.11 -6.39,20.75 -1.05,7.01 -2.11,7.67 -12.37,7.71 -7.11,0 -9.26,-0.3 -10.74,-1.7 -2.27,-2.13 -17.65,-7.02 -22.06,-7.01 -2.09,0 -4.37,-0.99 -6.5,-2.82 -3.51,-3 -16.84,-7.18 -22.94,-7.18 -1.87,0 -4.39,-0.69 -5.59,-1.53 -1.87,-1.31 -2.04,-1.93 -1.16,-4.25 0.57,-1.5 1.97,-3.71 3.1,-4.93 1.14,-1.21 2.69,-4.57 3.44,-7.46 1.63,-6.31 1.32,-6.73 -6.93,-9.21 -6.56,-1.98 -12.37,-6.56 -14.36,-11.32 -0.74,-1.78 -1.35,-5.73 -1.35,-8.77 0,-3.69 -0.41,-5.57 -1.25,-5.65 -2.49,-0.23 -4.28,0.31 -5.75,1.75 -1.33,1.3 -1.22,1.68 0.95,3.32 2,1.52 2.23,2.13 1.23,3.33 -1.59,1.92 -12.85,3.24 -14.69,1.71 -0.74,-0.61 -2.74,-1.29 -4.44,-1.51 -3.32,-0.42 -10,3.33 -15.37,8.64 -4.95,4.88 -11.83,8.88 -15.29,8.88 -4.11,0 -9.8,-4.77 -8.8,-7.38 0.41,-1.06 0,-2.19 -1.03,-2.95 -1.55,-1.14 -1.49,-1.46 0.83,-3.95 3.12,-3.37 4.64,-3.4 8.46,-0.19 l 3,2.53 2.44,-2.28 c 12.43,-11.6 19.08,-14.58 38.42,-17.2 8.64,-1.17 10.94,-1.88 15,-4.67 16.42,-11.27 16.47,-11.3 22.31,-11.72 3.12,-0.22 9.46,0.29 14.08,1.15 13.3,2.48 17.91,2.9 19.28,1.76 0.88,-0.73 3.13,-0.7 7.43,0.1 3.4,0.63 6.48,0.85 6.84,0.48 17.89,2.3 34.21,-5.85 44.81,-14.66 z" inkscape:connector-curvature="0" inkscape:label="#path4759" sodipodi:nodetypes="ssscssccscsccsccscscccccscccccccccccccscccccccccscccccsccccssccssscscccccscsccsccssccscccc" />
<rect style="display:inline;opacity:0.38000039;fill:none;stroke:#000000;stroke-width:1.00782073;stroke-opacity:1" id="frame02" width="358.99219" height="238.99217" x="771.50391" y="31.003906" inkscape:label="#rect5342-5" />
</g>
<g inkscape:groupmode="layer" id="layer10" inkscape:label="03" style="display:inline">
<rect style="display:inline;opacity:0.38000039;fill:none;stroke:#000000;stroke-width:1.00782073;stroke-opacity:1" id="frame03" width="358.99219" height="238.99217" x="1145.5039" y="30.503914" inkscape:label="#rect5342-1" />
<path style="display:inline;opacity:1;fill:#000000" d="m 1342,239.03 c 0,0 -2.7,0.89 -5.3,0.91 0,0 -4.6,-0.52 -1.3,-2.94 v -2.46 c 0,-2.44 -2.4,-4.54 -5.3,-4.54 -1.2,0 -14.5,-12.54 -19.8,-18.63 -0.9,-1.03 -3.2,-3.07 -5.1,-4.55 -3,-2.28 -3.6,-3.44 -4.1,-8 -0.9,-7.99 -3.4,-15.36 -6.3,-18.79 -1.4,-1.69 -5.8,-5.13 -9.7,-7.65 -14.4,-9.22 -20.2,-17.49 -19.5,-27.62 0.3,-3.71 0,-4.3 -1.8,-4.57 -2.5,-0.35 -5.4,3.09 -5.4,6.33 0,4.63 -4.4,5.66 -12.5,2.92 -4.4,-1.49 -4.8,-1.46 -8.1,0.51 -1.9,1.14 -3.9,1.86 -4.3,1.59 -0.4,-0.26 -1.8,0.63 -3.1,1.99 -1.3,1.36 -2.7,2.47 -3.1,2.47 -1.1,0 -6.6,3.84 -14.3,9.92 -7.9,6.28 -10.8,6.51 -13.8,1.08 -1.1,-1.92 -2.9,-4.5 -4,-5.72 -1.8,-1.96 -1.9,-2.3 -0.5,-2.85 0.9,-0.33 3.3,-0.1 5.4,0.62 3.7,1.21 3.7,1.19 7.5,-3.16 2.2,-2.42 4.5,-5.6 5.4,-7.07 0.8,-1.47 2.3,-2.95 3.3,-3.28 1,-0.33 3.4,-2.1 5.3,-3.94 3.8,-3.66 5.9,-4.12 32.4,-6.98 11.2,-1.2 12.6,-1.59 17.5,-4.89 14.8,-9.76 19.6,-10.77 37.7,-7.94 10.9,1.72 12.4,1.76 14.4,0.41 1.7,-1.2 2.7,-1.28 5.2,-0.39 1.7,0.61 5,1.4 7.3,1.76 22.7,-3.85 15,4.14 44.5,-11.61 l 3.3,-0 -2.5,-1.39 c -2.3,-1.3 -2.3,-1.44 -0.5,-2.14 1,-0.41 2.7,-1.57 3.7,-2.57 1,-1.01 3.1,-1.84 4.6,-1.85 l 2.7,-0 -2.5,-1.96 -2.5,-1.96 3.5,-0 c 2.7,-0 3.2,-0.287 2.2,-1.22 -1.9,-1.897 -1.4,-2.531 2.3,-3.234 2.1,-0.393 3.5,-1.24 3.5,-2.111 0,-0.8 -0.4,-1.455 -1,-1.455 -0.5,0 -1,-0.45 -1,-1 0,-0.55 1.4,-1 3,-1 1.7,0 4.8,-0.714 7,-1.587 3.6,-1.44 4.4,-1.443 9.2,-0.03 6.2,1.796 14.1,6.651 19,11.642 1.9,1.91 6.7,6.51 10.7,10.21 7.2,6.64 7.3,6.76 6,9.66 -0.7,1.61 -2.7,3.63 -4.5,4.47 -3,1.42 -3.4,1.4 -5.6,-0.3 -2.6,-2.08 -8.9,-4.05 -13,-4.05 -1.5,-0 -2.8,-0.41 -2.8,-0.9 0,-1.25 -8,-1.96 -10.7,-0.96 -1.3,0.45 -2.6,1.61 -3,2.59 -0.4,0.97 -1,2.21 -1.5,2.76 -0.4,0.55 -2.9,5.25 -5.3,10.44 -3.1,6.36 -4.4,10.19 -4,11.74 0.8,3.32 -1.3,11.3 -4.1,15 -1.3,1.75 -2.4,3.62 -2.4,4.16 0,0.98 3.7,1.58 16.7,2.72 11.2,0.98 11.1,0.75 12.4,26.44 0.2,5.14 -1.5,16 -2.5,16 -3.6,0 -5.9,-6.64 -3.2,-8.89 1,-0.86 1.3,-3.42 1,-10.38 -0.6,-14.86 -1,-15.69 -8,-15.71 -4.7,-0 -20.2,3.42 -21.5,4.75 -0.9,0.88 0.7,2.81 6,7.49 1.7,1.51 3.1,3.55 3.1,4.53 0,2.96 -2.8,6.01 -6.2,6.75 -1.8,0.39 -5.8,2 -9,3.58 -3.1,1.59 -6.4,2.88 -7.2,2.88 -3.6,0 -13.9,-12.06 -11.5,-13.53 2.8,-1.71 10.3,2.45 9.3,5.12 -1.4,3.51 14.8,0.12 17.1,-3.58 1.3,-2.02 -1.5,-3.65 -12.5,-7.27 -8.6,-2.86 -12.6,-3.6 -22.5,-4.15 -14.8,-0.84 -24.1,-2.22 -31.2,-4.69 -8.5,-2.89 -8.5,-2.88 -7.7,4.35 0.4,3.44 1.2,6.77 1.8,7.41 1.6,1.58 9.1,4.02 18.4,5.91 4.3,0.87 8.6,2.13 9.7,2.81 1.1,0.68 4.1,2.02 6.7,2.98 4.4,1.64 8.5,5.67 7.1,7.03 -0.3,0.33 -2.7,0.61 -5.4,0.61 -3.6,0 -4.9,-0.4 -5.3,-1.76 -0.3,-1.09 -2.4,-2.23 -5.3,-2.97 -2.6,-0.67 -8.1,-2.14 -12.3,-3.28 -4.1,-1.14 -10.3,-2.34 -13.7,-2.67 -7,-0.68 -7.5,-0.14 -4.9,5.99 1.1,2.73 17.3,18.69 18.9,18.69 0.3,0 2.1,1.58 4,3.51 2,1.92 4.9,3.78 6.6,4.12 1.7,0.34 2.9,0.97 2.6,1.41 -0.3,0.43 0,2.01 0.6,3.5 l 1,2.71 c 3.6,3.32 3.1,2.17 -1.3,2.62 -2,1.97 -4.3,1.62 -4.2,-0.84 z" id="horse03" inkscape:connector-curvature="0" sodipodi:nodetypes="cccssssscsscsssscssssscccssssssccccsssccccccsssssssssccscsssscsssssscsssssssssccsssssssscscssssscsscccc" inkscape:label="#path4741" />
</g>
<g inkscape:groupmode="layer" id="layer11" inkscape:label="04" style="display:inline">
<rect style="display:inline;opacity:0.38000039;fill:none;stroke:#000000;stroke-width:1.00782073;stroke-opacity:1" id="frame04" width="358.99219" height="238.99217" x="26.003906" y="274.00391" inkscape:label="#rect5342-17" />
<path id="horse04" style="display:inline;opacity:1;fill:#000000" d="m 158.44,484.07 c -3.57,-0.4 -3.38,-1.14 -2.42,-1.23 2.27,-0.22 -0.11,-2.18 -2.49,-6.7 -1.05,-2 -3.62,-7.47 -5.7,-12.14 -2.09,-4.68 -4.6,-9.69 -5.59,-11.15 -0.99,-1.46 -1.8,-3.14 -1.8,-3.72 0,-0.58 1.8,-3.84 3.99,-7.24 3.77,-5.83 5.99,-11.38 6.01,-15 0,-0.89 -1.41,-3.36 -3.14,-5.5 -4.46,-5.52 -11.86,-21.44 -11.85,-25.51 0,-1.86 0.69,-4.7 1.53,-6.31 2.51,-4.82 1.41,-5.74 -4.74,-3.96 -3.41,0.98 -6.48,2.76 -8.61,4.96 -3.55,3.68 -5.66,4.11 -10.83,2.24 -4.35,-1.57 -6.06,-0.6 -17.644,10 -5.068,4.64 -10.642,9.05 -12.386,9.79 -1.744,0.75 -5.247,2.76 -7.784,4.47 -4.302,2.91 -7.545,3.33 -7.545,0.99 0,-0.56 1.291,-1.68 2.87,-2.49 2.927,-1.52 6.035,-6.93 7.934,-13.82 0.865,-3.14 0.767,-3.89 -0.613,-4.66 -1.388,-0.78 -1.113,-1.21 1.761,-2.76 1.873,-1 4.925,-3.3 6.783,-5.1 1.858,-1.8 5.232,-4.5 7.497,-6 4.022,-2.66 4.578,-2.74 23.247,-3.35 l 19.12,-0.61 11.45,-5.6 c 13.41,-6.57 16.27,-6.92 33.83,-4.22 9.33,1.43 11.81,1.52 13.74,0.49 1.84,-0.99 3.21,-1.01 6.23,-0.1 5.51,1.65 12.15,1.52 12.15,-0.23 11.03,-2.23 24.59,0 42.22,-15.56 0.92,-1.07 3.48,-2.43 5.68,-3.02 4.8,-1.3 5.93,-2.71 3.54,-4.45 -1.53,-1.12 -1.08,-1.38 3.65,-2.12 4.01,-0.61 4.7,-0.93 2.66,-1.21 -1.51,-0.21 -2.75,-0.75 -2.75,-1.2 0,-0.89 3.92,-2.54 8.38,-3.52 1.58,-0.35 4.45,-1.7 6.37,-3.01 3.94,-2.67 5.24,-2.45 13.18,2.28 5.73,3.41 29.07,26.78 29.07,29.11 0,1.83 -3.46,5.49 -6,6.34 -0.82,0.27 -3.01,-0.41 -4.87,-1.53 -2.11,-1.28 -6.93,-2.48 -13,-3.26 -5.29,-0.68 -7.85,-1.28 -5.68,-1.34 5.65,-0.17 3.12,-2.28 -2.85,-2.37 -5.05,-0.1 -6.87,0.84 -4.57,2.29 1.14,0.72 0.91,0.94 -1.03,0.96 -3.56,0 -4.39,0.82 -7.56,7 -1.55,3.03 -3.86,7.07 -5.13,8.98 -1.73,2.61 -2.31,4.9 -2.31,9.13 0,3.1 -0.68,7.58 -1.52,9.94 -0.83,2.37 -1.17,4.62 -0.75,4.99 1.42,1.27 10.11,2.96 15.16,2.96 4,0 5.3,0.43 6.53,2.18 0.84,1.2 1.32,3.12 1.06,4.25 -0.36,1.58 0.54,2.74 3.77,4.87 3.97,2.61 16.33,12.47 18,14.35 2.76,3.11 9.75,13.33 9.75,14.26 0,0.72 -0.98,0.89 -2.75,0.47 -4.53,-1.08 -6.25,-2.33 -6.25,-4.55 0,-2.36 -12.18,-14.86 -16.68,-17.12 -1.55,-0.78 -5.06,-1.97 -7.8,-2.64 -4.9,-1.2 -5.03,-1.17 -7.26,1.61 -1.25,1.55 -3.58,5.52 -5.18,8.82 -2.85,5.88 -3.05,6.05 -10.24,8.77 -10.28,3.87 -10.93,3.73 -8.78,-1.93 1.42,-3.73 2.77,-4.47 6.94,-3.81 2.76,0.44 3.71,0.16 4.5,-1.31 0.55,-1.03 2.46,-4.06 4.25,-6.74 1.79,-2.68 3.25,-5.2 3.25,-5.6 0,-1 -10.99,-2.08 -20,-1.95 -24.88,0.34 -50.32,-0.13 -55.5,-1.02 -3.3,-0.56 -7.75,-1.29 -9.89,-1.62 l -3.89,-0.59 0.72,3.85 c 0.96,5.11 3.73,10.33 7.22,13.64 4.26,4.04 25.14,13.72 31.98,14.83 3.57,0.58 6.37,1.64 7.16,2.72 1.13,1.54 0.95,1.91 -1.5,2.96 -4.04,1.74 -7.45,1.53 -10.28,-0.65 -1.78,-1.37 -2.84,-1.61 -3.74,-0.87 -0.91,0.76 -2.57,0.2 -6.02,-2.01 -2.62,-1.68 -10.06,-5.6 -16.55,-8.72 l -11.79,-5.67 -2.99,-5.92 C 180.2,429.58 174,422 172.03,422 c -2.06,0 -8.31,7.35 -9.54,11.21 -0.65,2.04 -2.95,6.32 -5.11,9.5 -6.72,9.88 -6.95,13.48 -1.53,23.79 0.87,1.65 1.58,3.4 1.58,3.89 0,2.38 5.28,5.61 9.14,5.61 3.15,0 4.68,0.66 7.06,3.03 0.96,3.24 0.98,3.27 0.98,3.27 -7.15,0.27 -11.93,0.5 -15.5,0.1 z" inkscape:connector-curvature="0" sodipodi:nodetypes="cssscsscscssssssssssssssscssscccssssssssssssscscsssssssssssssssssssssssssscssssssssscssssssscccc" inkscape:label="#path4895" />
</g>
<g inkscape:groupmode="layer" id="layer12" inkscape:label="05" style="display:inline">
<rect style="display:inline;opacity:0.38000039;fill:none;stroke:#000000;stroke-width:1.00782073;stroke-opacity:1" id="frame05" width="358.99219" height="238.99217" x="398.50391" y="274.50391" inkscape:label="#rect5342-0" />
<path id="horse05" style="display:inline;opacity:1;fill:#000000" d="m 669.27,428.07 c 0.89,-6.03 -2.04,-8.84 -7.85,-7.57 -4.06,0.9 -3.74,2.69 1.22,6.94 4.6,3.94 6.13,4.08 6.63,0.63 z m -182.76,60.51 c -0.93,-1.12 -0.8,-1.52 0.63,-1.91 0.99,-0.28 -0.94,-0.47 -4.29,-0.43 -7.68,0.1 -10.86,-1.52 -4.41,-2.24 3.65,-0.41 4.56,-0.91 4.81,-2.65 0.24,-1.73 -0.58,-2.48 -4.25,-3.88 -4.66,-1.78 -5.19,-2.35 -3.72,-4.02 0.97,-1.11 4.64,-10.48 4.68,-11.95 0,-0.55 0.8,-2.11 1.75,-3.47 0.95,-1.36 1.73,-3 1.73,-3.64 0,-0.64 0.67,-2.45 1.49,-4.03 0.83,-1.57 1.5,-4.01 1.5,-5.42 0,-3.23 1.48,-5.08 6.51,-8.22 2.2,-1.37 6.13,-4.55 8.72,-7.06 l 4.73,-4.57 -0.58,-14.3 -0.58,-14.29 2.64,-3.49 c 1.45,-1.92 2.17,-3.64 1.6,-3.83 -0.56,-0.19 -4.97,0.56 -9.78,1.67 -4.81,1.11 -11,2.3 -13.75,2.63 -2.75,0.34 -8.82,2.05 -13.5,3.82 -7.87,2.96 -9.15,3.87 -17.31,12.2 -4.84,4.95 -9.72,10.07 -10.83,11.37 -2.95,3.44 -4.57,1.46 -3.03,-3.7 0.65,-2.15 1.17,-4.92 1.17,-6.16 0,-2.86 5.52,-12.61 7.58,-13.4 2.53,-0.97 0.56,-2.61 -3.14,-2.61 -3.57,0 -4.61,-1.34 -1.86,-2.39 0.87,-0.34 3.68,-0.61 6.25,-0.61 3.82,0 5.72,-0.73 10.4,-3.98 7.51,-5.21 12.75,-6.46 23.78,-5.68 11.11,0.79 22.9,-0.66 32.23,-3.97 19.8,-7.01 19.74,-7 31.06,-4.98 19.24,3.45 18.84,3.41 19.37,2.03 0.38,-1 2.88,-1.16 10.91,-0.71 6.74,0.38 10.42,0.23 10.42,-0.42 21.1,-5.59 29.93,-11.83 40.25,-16.93 4.47,0.12 5.21,-0.12 4.96,-1.59 -0.21,-1.26 1.42,-2.53 6,-4.66 3.46,-1.61 7.75,-3.23 9.54,-3.6 2.22,-0.46 3.25,-1.24 3.25,-2.48 0,-1.1 0.98,-2.06 2.5,-2.44 1.38,-0.35 2.5,-1.07 2.5,-1.61 0,-0.54 1.36,-0.98 3.03,-0.98 1.82,0 3.27,-0.62 3.63,-1.55 0.81,-2.12 5.33,-1.06 11.38,2.67 2.57,1.58 5.14,2.88 5.7,2.88 0.56,0 2.79,2.36 4.95,5.25 2.16,2.89 5.93,7.91 8.37,11.15 6.2,8.25 9.94,13.58 9.94,14.18 0,0.27 -0.98,1.83 -2.19,3.46 -2.75,3.73 -8.42,4.15 -11.4,0.86 -2.53,-2.79 -6.73,-4.9 -9.78,-4.9 -3.76,0 -6.1,-1.09 -4.49,-2.08 2.22,-1.38 0.18,-2.18 -5.85,-2.3 -4.15,-0.1 -5.72,0.23 -5.54,1.13 0.14,0.69 -0.62,1.25 -1.68,1.25 -1.28,0 -3.83,2.7 -7.54,7.95 -8.16,11.59 -9.46,15.06 -8.81,23.65 l 0.53,7.09 7.62,1.16 c 4.2,0.64 8.85,1.16 10.33,1.16 3.93,-0 7.77,2.02 8.36,4.41 0.28,1.14 0.1,5.01 -0.44,8.58 -0.8,5.48 -0.67,7.05 0.8,10 3.48,6.96 21.36,16.98 30.34,17.02 2.33,0 4.91,0.43 5.72,0.95 1.24,0.78 1,1.44 -1.43,3.98 -3.45,3.6 -3.94,3.67 -7.28,1.05 -1.5,-1.19 -4.05,-2 -6.26,-2 -2.68,0 -4.96,-0.94 -8.12,-3.34 -7.09,-5.4 -12.99,-8.84 -14.29,-8.34 -0.66,0.26 -1.83,2.43 -2.58,4.82 -1.87,5.95 -2.68,6.66 -4.93,4.32 -3.29,-3.43 -3.51,-6.14 -0.64,-8.02 3.34,-2.19 3.22,-3.41 -0.7,-7.13 C 660.83,435.18 641.35,425 637.8,425 c -1.55,0 -7.77,0.72 -13.8,1.61 -8.07,1.18 -15.48,1.49 -28.02,1.14 -15.39,-0.41 -18.2,-0.78 -29.04,-3.77 -6.6,-1.82 -13.57,-3.35 -15.5,-3.39 l -3.5,-0.1 0.13,15.5 c 0.14,17.25 0.75,20.58 4.96,26.91 1.6,2.41 3.41,5.23 4.02,6.27 2.39,4.08 5.81,6.82 8.5,6.82 4.68,0 7.83,1.8 9.58,5.48 0.93,1.93 2.05,3.52 2.5,3.52 0.44,0 0.81,0.47 0.81,1.04 0,0.66 -3.46,0.93 -9.59,0.75 l -9.6,-0.29 -1.37,-3.99 c -0.75,-2.19 -2.06,-4.49 -2.9,-5.11 -0.85,-0.61 -1.54,-1.59 -1.54,-2.17 0,-0.57 -1.57,-2.93 -3.5,-5.23 -1.92,-2.3 -3.5,-4.6 -3.5,-5.09 0,-0.5 -0.79,-1.7 -1.76,-2.67 -4.69,-4.69 -6.03,-7.81 -6.76,-15.74 -0.83,-9.05 -3.96,-16.46 -8.08,-19.16 -2.43,-1.59 -2.77,-1.59 -5.74,0 -10.43,5.7 -33.42,24.81 -34.34,28.55 -0.34,1.42 -1.46,4.15 -2.47,6.06 -3.78,7.13 -3.3,13.02 1.05,13.02 0.9,0 2.54,1.65 3.62,3.68 1.09,2.02 2.56,4.26 3.27,4.97 1.06,1.05 0.83,1.41 -1.25,1.93 -1.6,0.4 -2.54,1.34 -2.54,2.53 0,2.26 -3.19,2.57 -4.93,0.47 z" inkscape:connector-curvature="0" inkscape:label="#path4881" sodipodi:nodetypes="scssccsscccccsscsscccsccscsccscsccsssscscccscscsscsscssssscccssscscccccccssccccssssssccsccscssccscsssssscccscscsc" />
</g>
<g inkscape:groupmode="layer" id="layer13" inkscape:label="06" style="display:inline">
<rect style="display:inline;opacity:0.38000039;fill:none;stroke:#000000;stroke-width:1.00782073;stroke-opacity:1" id="frame06" width="358.99219" height="238.99217" x="770.00391" y="273.50391" inkscape:label="#rect5342-7" />
<path id="horse06" style="display:inline;opacity:1;fill:#000000" d="m 869.83,482.39 c 5.27,1.11 -0.73,4.82 1.11,-5.72 0.4,-2.24 -1.16,-3.09 -0.4,-3.56 0.6,-0.38 0.89,-2.09 0.63,-3.81 -0.25,-1.72 0,-4.14 0.57,-5.38 0.79,-1.74 0.64,-2.67 -0.68,-4.13 -1.43,-1.57 -1.47,-1.97 -0.27,-2.43 1.04,-0.39 1.53,-2.8 1.8,-8.72 0.41,-8.91 -0.1,-8.07 9.32,-15.34 10.68,-8.24 -8.51,-3.21 -20.67,5.42 -9.6,6.81 -19.55,14.64 -23.09,18.16 -0.98,0.98 -2.33,1.79 -3,1.81 -0.66,0 -5.01,0.69 -9.66,1.51 -7.61,1.34 -8.61,1.34 -10,-0.1 -1.4,-1.41 -1.31,-1.75 0.95,-3.56 3.48,-2.77 6.43,-3.86 8.8,-3.24 2.75,0.71 14.57,-5.02 20.49,-9.94 2.63,-2.18 6.16,-5.97 7.84,-8.42 2.44,-3.54 4.59,-5.14 10.62,-7.88 6.68,-3.05 15.32,-9.49 17.52,-13.07 0.43,-0.69 1.24,-4.99 1.81,-9.55 0.58,-4.56 1.92,-10.27 2.98,-12.68 1.07,-2.41 1.94,-5.03 1.94,-5.82 0,-1.73 -0.94,-1.48 -14,3.67 -10.94,4.32 -27.89,9.77 -33,10.61 -1.92,0.31 -7.69,1.97 -12.81,3.68 -8.71,2.91 -9.47,3 -12,1.55 -1.48,-0.85 -3.21,-1.36 -3.85,-1.13 -0.63,0.23 -1.46,-0.1 -1.82,-0.66 -0.83,-1.34 3.34,-4.94 5.76,-4.99 3.19,-0.1 8.72,-2.89 8.72,-4.46 0,-0.85 1.23,-1.83 2.75,-2.19 1.51,-0.36 3.44,-1.24 4.27,-1.97 1.34,-1.15 4.93,-2.03 16.48,-4.03 1.65,-0.29 3.9,-0.92 5,-1.4 1.1,-0.48 4.03,-1.09 6.5,-1.36 3.91,-0.42 19.15,-4.26 29.99,-7.56 1.93,-0.58 5.5,-1.06 7.95,-1.06 2.45,0 8.08,-0.51 12.51,-1.13 7.15,-1.01 9.34,-0.88 19.55,1.1 16.03,3.1 22.02,3.61 23.04,1.96 0.53,-0.85 2.38,-1.24 5.1,-1.08 6.03,0.36 11.86,-0.79 11.86,-2.33 21.91,-5.14 35.66,-14.66 45.96,-18.89 2.2,-0.9 5.5,-1.64 7.3,-1.65 4.7,-0 6.2,-1.21 4.7,-3.72 -0.7,-1.1 -1,-2.73 -0.6,-3.63 0.5,-1.35 2.2,-1.63 10.1,-1.63 8.9,0 9.5,-0.14 9.5,-2 0,-1.98 0.6,-2.2 5.5,-2.2 1.4,0 3.5,0 4.6,0.1 3.1,0.15 15.3,13.03 25.8,27.42 4.4,5.98 4.8,8.17 1.9,11.85 -1.2,1.56 -3.8,2.21 -7.9,1.94 -1,-0.1 -2,-0.93 -2.3,-1.93 -0.7,-2.18 -6.6,-5.18 -10.2,-5.18 -1.7,0 -2.7,-0.66 -3,-1.88 -0.8,-2.88 -13.8,-4.87 -13.9,-2.12 0,0.82 -0.6,1.39 -1.2,1.27 -0.6,-0.13 -2.2,1.22 -3.4,3 -1.2,1.77 -4.6,6.02 -7.5,9.44 -2.9,3.42 -5.4,7.02 -5.7,8 -0.4,1.48 -1.8,15.42 -1.8,18.03 0,1.19 18.1,7.99 23.3,8.74 3.5,0.51 5.9,1.78 9.8,5.11 2.9,2.44 8.4,6.29 12.2,8.56 3.8,2.26 7.3,4.91 7.9,5.89 0.5,0.97 3.2,3.43 6,5.47 4,2.97 4.8,3.98 3.9,5.1 -1.3,1.52 -5.7,1.83 -7.8,0.54 -0.7,-0.45 -1.6,-2.14 -2,-3.74 -0.5,-1.92 -1.5,-3.02 -3,-3.23 -1.2,-0.18 -2.6,-1.16 -3.2,-2.18 -1.1,-2.05 -7.9,-6.9 -14.2,-10.14 -7.9,-4.02 -32.8,-7.7 -32.8,-4.84 0,2.04 5.8,13.61 9.2,18.48 1.9,2.75 4.1,6.41 4.7,8.13 0.7,1.72 2.6,4.39 4.2,5.94 1.6,1.54 2.9,3.31 2.9,3.93 0,0.63 2.5,3.69 5.4,6.82 3.9,4.13 6.1,5.68 8,5.68 1.7,0 2.9,0.68 3.3,1.75 0.4,0.96 1.5,3.01 2.6,4.56 4.9,4.26 4.9,6.24 4.9,6.24 -2.8,0.1 -6.2,-1.07 -6.8,-0.49 -0.8,0.74 -2.9,0.77 -7,0.11 l -2.2,-6.67 c -0.4,-2.48 -2.9,-4.49 -5.6,-4.53 -1.6,-0 -2.8,-1.63 -5.1,-6.63 -1.6,-3.64 -3.7,-7.11 -4.7,-7.72 -1,-0.61 -1.8,-1.58 -1.8,-2.17 0,-0.58 -1.6,-2.61 -3.5,-4.51 -2,-1.89 -4.5,-5.02 -5.4,-6.96 -2.3,-4.36 -14.1,-17.67 -18.6,-20.83 -3.1,-2.2 -3.6,-2.28 -8.6,-1.19 -3,0.64 -12.33,1.41 -20.86,1.7 -16.95,0.58 -25.16,-0.67 -41,-6.21 -7.66,-2.68 -22.32,-4.34 -27.3,-3.09 -1.5,0.37 -3.53,2.33 -5.06,4.88 -1.41,2.34 -4.24,5.38 -6.29,6.76 -2.04,1.37 -6,4.82 -8.78,7.66 -2.79,2.84 -6.5,5.87 -8.24,6.73 -1.74,0.87 -4.13,2.93 -5.31,4.58 -2.54,3.56 -3.88,10.03 -2.09,10.03 0.82,0 0.72,0.66 -0.31,2.13 -1.08,1.54 -1.33,3.55 -0.9,7.25 0.62,5.44 1.48,6.58 4.96,6.6 1.33,0 3.07,1.29 4.43,3.27 1.23,1.78 1.09,5.47 1.32,5.75" inkscape:connector-curvature="0" sodipodi:nodetypes="cscsssssssscscssssssssssssssscssssssssssssccsccssssscccscccscccsscsccscscsssscsssscccccssssscssssssssssssscsc" inkscape:label="#path4855" />
</g>
<g inkscape:groupmode="layer" id="layer14" inkscape:label="07" style="display:inline">
<rect style="display:inline;opacity:0.38000039;fill:none;stroke:#000000;stroke-width:1.00782073;stroke-opacity:1" id="frame07" width="358.99219" height="238.99217" x="1144.5039" y="272.50391" inkscape:label="#rect5342-6" />
<path id="horse07" style="display:inline;opacity:1;fill:#000000" d="m 1397.9,485.46 c -10.2,-0.18 -15.6,-1 -12.1,-3.15 l -0.7,-2.41 c -0.4,-1.32 -1.2,-6 -1.7,-10.4 -0.6,-4.4 -1.8,-9.04 -2.6,-10.31 -0.9,-1.39 -2.1,-7.94 -3,-16.5 -0.9,-7.8 -1.9,-14.58 -2.4,-15.05 -0.4,-0.48 -7.2,-1.03 -15.1,-1.22 -30.6,-0.76 -45.3,-3.44 -59.4,-10.74 -5.9,-3.08 -17.1,-2.65 -23.9,0.93 -2.8,1.45 -7.8,3.98 -11.1,5.62 -3.3,1.65 -8,4.9 -10.5,7.21 -2.5,2.32 -5.8,5.06 -7.5,6.1 -5.8,3.64 -14.6,11.8 -17.7,16.35 -5.7,8.38 -11.2,14.08 -16.9,17.62 -6.1,3.76 -10.5,4.65 -9.5,1.9 0.4,-0.88 0.9,-2.68 1.3,-4 0.4,-1.86 1.2,-2.41 3.5,-2.41 2.3,0 4.3,-1.33 8.6,-5.8 5.9,-6.01 14.5,-18.05 15.7,-21.9 0.3,-1.21 2.2,-3.16 4.1,-4.33 7.5,-4.62 2.3,-5.12 -11.1,-1.1 -3.9,1.16 -10.9,4.45 -15.5,7.31 -8.4,5.19 -8.5,5.2 -18.2,5.6 -10.7,0.45 -12,-0.35 -7.4,-4.61 2.5,-2.37 5.6,-2.81 7.4,-1.04 2.2,2.26 21,-6.68 30.9,-14.77 3.9,-3.1 6.5,-4.41 10,-4.93 9,-1.3 17.8,-6.77 18.7,-11.59 0.3,-1.29 0.9,-6.09 1.4,-10.67 0.9,-6.91 1.6,-9.1 4.3,-12.83 4.3,-6.03 2.8,-7.64 -3.5,-3.91 -2.6,1.49 -6.1,4.02 -8,5.63 -3.6,3.18 -14.7,8.93 -21.1,10.93 -2.2,0.69 -4.9,1.73 -6,2.3 -3.2,1.68 -21.7,2.14 -28.5,0.7 -5.1,-1.09 -5.9,-1.54 -5.4,-3.13 0.4,-1.36 -0.1,-2.12 -2,-2.83 -1.4,-0.54 -2.6,-1.35 -2.6,-1.81 0,-1.5 2.4,-3.22 4.5,-3.23 1.1,-0 4.1,-0.74 6.5,-1.61 2.8,-0.97 8.5,-1.69 14.5,-1.84 20.1,-0.47 25.5,-1.58 39,-8.09 7.9,-3.77 14.8,-4.78 33,-4.87 14.1,-0.1 19.2,0.34 29.8,2.35 12.3,2.35 12.8,2.37 14.1,0.61 1,-1.38 2,-1.66 4.1,-1.14 3.7,0.92 11.5,-0.32 11.5,-1.83 27.4,-4.96 35.8,-10.64 46.4,-16.57 4.9,0 6.4,-0.38 7.3,-1.86 0.7,-1.06 2.9,-2.13 5.2,-2.5 5.2,-0.83 5.7,-1.78 2.6,-5.07 -1.3,-1.47 -2.5,-3.1 -2.5,-3.62 0,-1.43 5.5,-1.14 13.1,0.7 6.4,1.55 7,1.55 9.5,-0.1 1.5,-1.02 2.4,-2.31 2.1,-3.15 -0.4,-1.02 0.2,-1.43 2,-1.43 2.3,0 5.2,1.68 11.1,6.47 0.7,0.57 4.1,4.63 7.5,9.03 3.4,4.4 8.3,10.56 11,13.68 5.1,5.91 5.5,7.93 2.1,11.31 -2,1.99 -7,1.94 -8.1,-0.1 -1.1,-1.9 -11.7,-6.39 -15.3,-6.42 -1.8,-0 -2.1,-0.26 -1.1,-0.89 2.6,-1.64 0,-3.1 -5.4,-3.1 -4.2,0 -5.5,0.35 -5.5,1.5 0,0.83 -0.8,1.5 -1.8,1.5 -2.1,0 -4.4,2.48 -8.7,9 -1.6,2.48 -3.9,5.79 -5.2,7.37 -4.3,5.35 -5.4,9.1 -3.7,13.67 0.7,2.22 1.2,5.25 0.9,6.75 -0.5,2.37 0.1,3.15 4.7,6.21 2.9,1.93 7.5,5.35 10.3,7.6 2.8,2.26 7.6,5.63 10.8,7.5 3.2,1.87 7.5,4.4 9.5,5.63 8.5,5.06 16.1,7.24 25.5,7.26 7.1,0 8.3,0.95 4.3,3.56 -2,1.3 -2.8,1.37 -4.7,0.38 -1.2,-0.66 -4.9,-1.17 -8.2,-1.12 -4.3,0.1 -6.8,-0.44 -8.6,-1.71 -3.2,-2.22 -13.9,-7.1 -15.5,-7.1 -0.7,0 -5.7,-2.05 -11.2,-4.56 -5.4,-2.52 -11.2,-5.17 -12.9,-5.9 -4.3,-1.91 -14,-3.92 -15.8,-3.25 -2.8,1.09 -4.1,13.68 -2.9,29.8 1.2,18.03 3.3,22.91 9.7,22.91 2,0 3.9,0.8 5.1,2.14 1.1,1.18 3.2,2.93 4.8,3.88 l 2.8,1.73 -2.7,0.68 c -1.5,0.36 -2.9,0.43 -3.2,0.13 -0.3,-0.29 -1.1,0.1 -1.7,0.88 -0.9,1.19 -1.4,1.2 -3.1,0 z" inkscape:connector-curvature="0" sodipodi:nodetypes="cccsccsssssssssscsscssssscssssssssssccssssssssscccssssccscscsccssssssssssssscssssssssscscssccc" inkscape:label="#path4923" />
</g>
<g inkscape:groupmode="layer" id="layer15" inkscape:label="08" style="display:inline">
<rect style="display:inline;opacity:0.38000039;fill:none;stroke:#000000;stroke-width:1.00782073;stroke-opacity:1" id="frame08" width="358.99219" height="238.99217" x="26.003906" y="516.50391" inkscape:label="#rect5342-44" />
<path id="horse08" style="display:inline;opacity:1;fill:#000000" d="m 309.44,612.5 c -1.34,-1.61 -3.91,-1.87 -8.87,-0.87 -5.36,1.07 -3.44,2.37 3.49,2.37 5.78,0 6.47,-0.19 5.38,-1.5 z m -196.56,55.52 c 3.64,-1.38 3.21,-3.21 -0.68,-2.83 -2.14,0.2 -3.36,0.91 -3.57,2.06 -0.38,1.99 0.58,2.17 4.25,0.77 z m 110.89,60.42 c -3.84,-1.31 -4.57,-0.31 -4.57,-0.31 1.16,-1.88 0.32,-8.05 -3.03,-8.94 -3.07,-0.82 -3.22,-1.07 -2.94,-5.19 0.17,-2.56 0.95,-4.82 1.9,-5.52 1.64,-1.2 3.33,-4 6.66,-11.06 1.88,-4 2.81,-5.8 9.09,-17.65 1.96,-3.69 3.56,-6.97 3.56,-7.27 0,-1.27 -5.11,-2.3 -14.45,-2.92 -14.91,-0.99 -24.3,-3.66 -36.82,-10.45 -4.72,-2.56 -6.92,-3.13 -12.03,-3.13 -6.58,0 -8.6,0.87 -14.24,6.15 -2.62,2.44 -4.5,3.05 -13.5,4.34 -6.34,0.91 -12.43,2.46 -15.46,3.92 -16.84,8.14 -22.2,10.59 -23.18,10.59 -0.61,0 -5.09,2.52 -9.961,5.59 l -8.858,5.6 -7.309,-0.64 c -4.02,-0.36 -8.466,-1.08 -9.882,-1.62 -2.48,-0.95 -2.509,-1.05 -0.809,-2.93 0.97,-1.07 2.717,-2.25 3.882,-2.61 1.164,-0.37 3.388,-1.73 4.94,-3.02 2.281,-1.91 3.207,-2.16 4.828,-1.29 1.515,0.81 2.818,0.69 5.329,-0.5 1.827,-0.87 3.772,-1.58 4.32,-1.58 1.471,0 10.34,-10.44 13,-15.3 4.92,-8.99 4.94,-9.01 10.08,-8.4 2.56,0.3 7.47,0.3 10.89,-0 l 6.23,-0.57 v -9.69 c 0,-8.35 0.35,-10.37 2.5,-14.61 3.12,-6.16 3.11,-6.42 -0.29,-6.42 -3.62,0 -8.71,2.64 -14.81,7.68 -9.73,8.03 -20.34,11.74 -31.897,11.16 -6.732,-0.34 -7.663,-0.65 -10.205,-3.4 -1.539,-1.66 -5.385,-5.2 -8.547,-7.85 -3.163,-2.66 -5.748,-5.12 -5.744,-5.46 0,-0.35 1.349,-1.39 2.989,-2.33 l 2.983,-1.69 2.63,3.44 c 2.879,3.78 5.95,4.44 7.946,1.71 1.212,-1.66 1.611,-1.66 8.11,0 11.212,2.88 13.625,2.49 25.925,-4.16 10.29,-5.56 11.57,-5.99 22.41,-7.45 22.85,-3.07 28.23,-3.03 43.23,0.32 13.9,3.11 22.77,3.87 22.77,1.95 0,-0.73 2.08,-0.86 6.49,-0.38 24.11,-2.52 44.33,-10.98 60.08,-19.51 0.54,-0.54 2.77,-1.6 4.95,-2.36 3.36,-1.17 3.93,-1.76 3.68,-3.86 -0.2,-1.66 0.69,-3.55 2.65,-5.65 2.56,-2.74 3.63,-3.16 7.99,-3.16 2.77,0 5.32,-0.45 5.66,-1 0.8,-1.29 8.6,-1.29 11.99,-0 4.31,1.64 10.26,6.99 15.07,13.53 2.48,3.39 6.99,8.3 10.02,10.91 7.44,6.43 8.81,8.63 7.34,11.84 -1.08,2.37 -4.64,4.73 -7.15,4.73 -0.63,0 -2.07,-0.82 -3.2,-1.81 -4.08,-3.58 -12.2,-5.12 -23.05,-4.38 l -9.99,0.69 -2.47,4.48 c -1.36,2.47 -5.53,8.71 -9.26,13.87 -3.74,5.16 -6.85,10.12 -6.92,11.02 -0.1,0.89 -0,4.33 0.1,7.63 0.19,5.57 0.51,6.32 4.47,10.5 2.34,2.47 6.32,7.2 8.84,10.5 6.2,8.14 24.13,26.24 30,30.3 3.18,2.19 6.45,3.5 9.75,3.89 5.78,0.68 6.34,2.15 2.28,5.91 -3.5,3.24 -8.64,3.04 -9.12,-0.35 -0.37,-2.59 -2.15,-3.71 -7.43,-4.66 -2.36,-0.43 -3.75,-1.23 -3.75,-2.18 0,-1.72 -12.16,-14.41 -13.82,-14.41 -0.6,0 -5.05,-3.83 -9.88,-8.5 -6.3,-6.09 -11.09,-9.68 -16.85,-12.67 l -8.06,-4.16 -6.79,1.84 c -5.8,1.57 -7.13,2.36 -9.07,5.41 -1.25,1.97 -4.8,6.41 -7.9,9.87 -3.1,3.46 -5.63,6.67 -5.63,7.14 0,0.47 -1.83,3.04 -4.06,5.71 -3.83,4.6 -8.94,13.8 -8.94,16.12 0,1.37 5.77,6.24 7.4,6.24 0.68,0 2.22,1.13 3.41,2.5 2.52,2.89 3.12,5.34 5.75,3.42 3.03,4.42 -4.01,2.72 -7.89,2.41 -0.45,-0.77 -3.51,0.57 -4.34,0.11 z" inkscape:connector-curvature="0" sodipodi:nodetypes="ssssssssccsssssssssssssscssssssssssccssssssscscsscssssccssssscsssssscsscssssssscsssscssssssssccc" inkscape:label="#path5009" />
</g>
<g inkscape:groupmode="layer" id="layer16" inkscape:label="09" style="display:inline">
<rect style="display:inline;opacity:0.38000039;fill:none;stroke:#000000;stroke-width:1.00782073;stroke-opacity:1" id="frame09" width="358.99219" height="238.99217" x="397.50391" y="516.50391" inkscape:label="#rect5342-08" />
<path id="horse09" style="display:inline;opacity:1;fill:#000000" d="m 678.69,613.36 c 3.11,-0.88 1.87,-2.12 -2.82,-2.82 -4.65,-0.7 -9.43,1.12 -9.43,3.58 0,1.01 7.68,0.53 12.25,-0.76 z M 473.94,630 c -0.34,-0.55 -1.27,-1 -2.06,-1 -0.79,0 -1.44,0.45 -1.44,1 0,0.55 0.93,1 2.06,1 1.13,0 1.78,-0.45 1.44,-1 z m 153.68,94.69 -0.61,-3.09 c -0.66,-3.31 -1.18,-6.78 -1.94,-12.9 -0.26,-2.09 -0.96,-4.39 -1.56,-5.12 -0.6,-0.72 -1.3,-5.58 -1.55,-10.81 -0.26,-5.23 -0.92,-10.7 -1.48,-12.17 l -1.01,-2.66 -6.77,7.1 c -6.21,6.51 -11.16,13.83 -11.23,16.57 -0,0.62 -1.94,1.41 -4.28,1.76 -2.34,0.36 -7.85,1.31 -12.25,2.12 -12.72,2.34 -27.8,1.79 -28.89,-1.06 -0.57,-1.5 5.14,-5.43 7.9,-5.43 0.97,0 2.27,0.63 2.88,1.4 1.46,1.84 18.4,0.53 23.95,-1.85 3.34,-1.44 4.28,-2.65 7.26,-9.35 1.89,-4.24 4.32,-9.36 5.42,-11.4 3.76,-7.02 3.79,-7 -14.55,-8.77 -11.09,-1.07 -15.73,-2.43 -25.67,-7.57 -7.06,-3.65 -12.74,-4.44 -14.72,-2.06 -1.9,2.29 -11.37,6.52 -16.97,7.58 -2.87,0.54 -8.59,0.95 -12.73,0.91 -4.14,-0 -7.78,0.17 -8.09,0.48 -0.3,0.31 1.08,4.38 3.09,9.04 l 3.64,8.49 -2.09,4.3 c -3.38,6.95 -3.48,7.12 -5.3,8.23 -4.22,2.59 -5.69,-6.26 -1.55,-9.28 1.53,-1.11 1.74,-2.16 1.22,-5.95 -0.66,-4.87 -1.23,-6.18 -5.59,-12.95 -2.15,-3.34 -3.33,-4.25 -5.55,-4.25 -3.53,0 -5.88,2.54 -10.65,11.5 -4.23,7.94 -6.69,10.5 -10.11,10.5 -1.3,0 -4.4,0.54 -6.88,1.21 -5.77,1.54 -7.63,0.24 -5.46,-3.82 1.95,-3.64 5.48,-5.16 8.13,-3.5 1.81,1.12 2.44,0.9 5.38,-1.96 1.84,-1.78 5.84,-8.31 8.9,-14.5 3.06,-6.2 6.12,-11.47 6.8,-11.7 0.68,-0.24 6.07,-0.21 11.98,0.1 11.97,0.55 11.98,0.54 8.72,-5.85 -3.33,-6.53 -4.21,-13.31 -2.32,-18.01 0.88,-2.21 1.35,-4.27 1.04,-4.58 -0.31,-0.3 -3.85,1.91 -7.88,4.94 -10.91,8.2 -19.51,12.56 -27.95,14.17 -9.5,1.82 -15.7,1.08 -16.88,-2.01 -0.47,-1.24 -1.33,-2.55 -1.92,-2.91 -0.58,-0.36 -1.06,-1.83 -1.06,-3.25 0,-1.75 -1.31,-3.81 -4,-6.29 -4.42,-4.08 -5.21,-7 -1.9,-7 1.15,0 5.19,0.94 8.97,2.09 9.51,2.89 20.87,1.86 33.44,-3.03 3.3,-1.28 6.89,-2.65 7.99,-3.05 3.54,-1.28 29.79,-6.02 36.5,-6.59 3.58,-0.3 8.75,-0.1 11.5,0.54 12.64,2.74 27.99,4.95 28.8,4.15 3.8,-1.91 0.75,-1.88 8.2,-3.86 22.65,-3.13 25.57,-3.72 40.45,-8.76 3.82,2.3 10.36,-3.22 15.15,-6.61 5.91,-4.18 7.05,-5.73 5.87,-7.94 -1.18,-2.2 0.26,-2.87 4.71,-2.19 2.39,0.37 4.17,-0.22 7.22,-2.38 2.23,-1.58 4.07,-3.66 4.08,-4.62 0,-2.6 2.46,-2.15 10.14,1.88 4.47,2.35 8.37,5.37 11.01,8.53 2.25,2.69 7.68,7.66 12.07,11.06 7.44,5.75 7.93,6.36 7.38,9.16 -1.35,6.72 -5.44,8.12 -13.01,4.44 -4.47,-2.17 -4.48,-2.17 -14.77,-0.4 -12.89,2.21 -14.59,2.89 -15.87,6.32 -2.38,6.38 -5.36,11.54 -9.97,17.31 -2.99,3.74 -5.15,7.56 -5.53,9.79 -1.39,8.2 -2.67,10.91 -7.8,16.54 -7.33,8.04 -9.1,15.42 -8.43,35.17 l 0.47,13.81 3.38,2.82 c 1.85,1.55 4.56,2.82 6,2.82 1.66,0 3.95,2.78 5.66,4.7" inkscape:connector-curvature="0" sodipodi:nodetypes="ssssssssscssssscscssssssssssssscscssssssssssssssssscssscsssssssscccsssscssssssssssscssc" inkscape:label="#path4977" />
</g>
<g inkscape:groupmode="layer" id="layer17" inkscape:label="10" style="display:inline">
<rect style="display:inline;opacity:0.38000039;fill:none;stroke:#000000;stroke-width:1.00782073;stroke-opacity:1" id="frame10" width="358.99219" height="238.99217" x="771.00391" y="517.00391" inkscape:label="#rect5342-8" />
<path id="horse10" style="display:inline;opacity:1;fill:#000000" d="m 1045.9,609.59 c 4.7,-1.95 4.5,-3.18 -0.6,-3.99 -4.9,-0.78 -8.9,1.27 -8.9,4.55 0,1.79 0.5,2.01 3,1.51 1.6,-0.32 4.5,-1.26 6.5,-2.07 z m -147.19,61.34 c 2.05,-1.69 3.73,-3.49 3.73,-4 0,-1.18 -10.03,-1.19 -11.89,-0 -1.15,0.73 -1,1.43 0.82,3.99 1.21,1.7 2.52,3.1 2.91,3.1 0.39,0 2.38,-1.38 4.43,-3.07 z m 91.23,20.08 c 0.78,-1.28 -3.46,-13.01 -4.7,-13.01 -0.52,0 -3.27,1.91 -6.12,4.24 -2.85,2.33 -5.36,4.34 -5.57,4.47 -1.01,0.62 2.47,3.39 5.27,4.2 4.29,1.25 10.37,1.3 11.12,0.1 z m -50.86,34.37 c 5.38,-0.52 1.29,-1.91 2.36,-4.23 0.68,-1.46 1.62,-3.42 2.1,-4.36 0.48,-0.94 0.49,-2.72 0,-3.95 -0.72,-1.94 0.4,-3.43 8.52,-11.31 9.7,-9.43 11.23,-12.45 7.34,-14.53 -3.89,-2.08 -1.6,-4.16 6,-5.48 2.67,-0.46 4.41,-1.79 7.35,-5.59 4.55,-5.9 4.28,-7.92 -1.07,-7.95 -5.26,-0 -19.15,-3.22 -30.02,-6.89 -12.4,-4.19 -14.47,-4.07 -20.24,1.16 -2.57,2.34 -6.33,5.51 -8.35,7.04 -5.56,4.23 -4.99,6.54 2.58,10.39 3.44,1.75 7.88,3.84 9.88,4.65 2.87,1.16 4.15,2.59 6.08,6.82 1.34,2.94 2.74,6.81 3.09,8.6 0.62,3.08 0.49,3.25 -2.29,3.25 -4.28,0 -7.19,-3.5 -6.41,-7.7 0.49,-2.57 0.28,-3.3 -0.91,-3.3 -0.85,0 -2.88,-1.13 -4.52,-2.51 -3.05,-2.57 -13.1,-6.72 -18.92,-7.82 -2.43,-0.46 -3.25,-0.26 -3.25,0.8 0,0.77 0.45,1.69 1,2.03 1.26,0.78 1.33,18.5 0.1,18.5 -0.51,0 -2.31,-1.16 -4,-2.59 -3.37,-2.83 -4.01,-6.39 -1.54,-8.45 1.07,-0.88 1.23,-1.59 0.5,-2.32 -0.57,-0.57 -1.04,-1.96 -1.04,-3.09 -0,-3.1 -3.01,-7.42 -10.87,-15.62 -9.62,-10.04 -9.57,-11.91 0.37,-13.44 6.14,-0.95 12.5,-3.5 12.5,-5.02 0,-0.74 -0.99,-2.05 -2.2,-2.9 -1.22,-0.85 -3.5,-3.46 -5.08,-5.81 -2.94,-4.35 -3.07,-6.25 -1.02,-14.76 0.58,-2.41 0.53,-2.44 -1.35,-0.78 -1.07,0.95 -4.85,3.04 -8.4,4.65 -3.54,1.61 -7.59,3.83 -8.98,4.93 -1.4,1.11 -5.67,3.03 -9.5,4.29 -3.83,1.26 -8.88,3.15 -11.22,4.19 -3.82,1.71 -4.97,1.78 -11.25,0.72 -6.62,-1.12 -8.28,-2.09 -6,-3.5 2.08,-1.29 0.85,-3.65 -3.5,-6.71 -5.02,-3.54 -5.4,-4.32 -2.5,-5.08 1.1,-0.29 2,-1.22 2,-2.08 0,-0.86 -0.9,-2.04 -2,-2.63 -3.24,-1.73 -2.37,-2.71 4.41,-4.97 4.87,-1.62 8.44,-2.08 14.81,-1.9 4.61,0.12 8.89,-0.1 9.5,-0.46 0.61,-0.37 4.16,0 7.9,0.89 5.69,1.32 7.84,1.38 13.33,0.37 8.02,-1.48 21.83,-5.59 24.55,-7.31 1.1,-0.7 4.91,-2.07 8.47,-3.06 7.21,-1.99 11.42,-1.76 26.94,1.48 12.19,2.54 14.78,2.53 15.61,-0.1 0.57,-1.8 1.18,-1.97 5,-1.39 l 4.36,0.65 c 10.19,-4.72 47.18,-0.47 52.38,-18.21 1.5,-6.24 3,-8.02 9.4,-11.1 3.5,-1.66 7.4,-4.06 8.7,-5.35 2.2,-2.16 2.7,-2.26 7.7,-1.37 6.5,1.15 12.5,4.47 18.4,10.15 2.4,2.29 7.6,6.87 11.4,10.17 3.8,3.3 7.2,6.55 7.5,7.22 1,2.16 -1.4,6.97 -4,8.14 -3.3,1.54 -5.4,1.43 -7.4,-0.39 -0.9,-0.83 -3.2,-1.55 -5.1,-1.59 -3.8,-0.1 -22.7,4.51 -23.8,5.79 -0.5,0.46 -2,4.02 -3.4,7.91 -1.5,3.9 -4.8,10.2 -7.3,14 -6.2,9.38 -7.2,11.49 -8.5,17.46 -0.8,3.83 -2.1,6.26 -5.3,9.55 -2.3,2.42 -5,4.41 -5.9,4.41 -1,0 -3.1,0.71 -4.8,1.57 l -3.04,1.57 0.33,12.18 0.34,12.18 -3.5,1.72 c -3.36,1.64 -3.84,1.62 -11.5,-0.39 -13.4,-3.52 -14,-3.51 -17.58,0.31 -1.73,1.85 -4.89,5.17 -7.03,7.38 -2.13,2.21 -3.88,4.43 -3.88,4.94 0,0.51 -1.13,2.11 -2.51,3.56 l -2.52,2.62 2.27,4.43 c 2.41,4.71 3.69,6.09 4.94,5.32" inkscape:connector-curvature="0" sodipodi:nodetypes="csssccsssscccsssscccsssssssssssssssssssssssssscsssssssssssssssssssccssssssccssssscscsssssssscccsssssscsc" inkscape:label="#path5063" />
</g>
<g inkscape:groupmode="layer" id="layer18" inkscape:label="11" style="display:inline">
<rect style="display:inline;opacity:0.38000039;fill:none;stroke:#000000;stroke-width:1.00782073;stroke-opacity:1" id="frame11" width="358.99219" height="238.99217" x="1143.5039" y="517.00391" inkscape:label="#rect5342-73" />
<path id="horse11" style="display:inline;opacity:1;fill:#000000" d="m 1259.8016,647.48209 c -5.0084,-9.88888 -6.3319,-11.48524 -3.9686,-4.78701 0.7776,2.20387 1.6273,6.28189 1.8883,9.06229 0.3299,3.51418 1.3502,6.20772 3.3469,8.83574 l 2.8724,3.78049 0.3136,-3.74058 c 0.241,-2.8748 -0.7896,-5.91866 -4.4526,-13.15093 z m 19.3947,75.43572 c 0.2256,-0.6869 -0.9155,-3.67642 -2.5358,-4.60634 -2.5011,-1.43546 -3.1001,-2.60593 -3.9664,-7.75111 -1.5771,-9.36658 -4.6441,-20.06033 -5.7535,-20.06033 -1.2648,0 -2.5282,13.53262 -1.8205,19.5 0.2935,2.475 1.0915,4.95 1.7734,5.5 0.6818,0.55 2.0087,2.48818 2.9486,4.30707 1.5189,2.93946 2.111,3.27294 5.3264,3 1.9896,-0.16889 3.8021,0.7976 4.0278,0.11071 z m -27.2557,1.75496 c 12.586,-0.54492 8.505,-3.13649 6.9186,-9.58707 -0.7955,-3.23471 -2.4503,-3.61918 -1.8065,-6.32672 0.8654,-3.63916 0.8128,-3.1153 2.1842,-21.7589 l 0.9931,-13.5 -5.432,-8.21063 c -9.3637,-14.15347 -12.3574,-22.74361 -12.3574,-35.45798 0,-10.82174 4.4932,-16.76638 14.5079,-19.19441 3.2956,-0.79903 10.3852,-2.61922 15.7546,-4.04488 5.3694,-1.42565 10.9251,-2.5921 12.3461,-2.5921 3.0025,0 11.3717,2.21486 19.7903,5.23734 l 5.8988,2.11785 2.3655,-2.74997 c 1.3009,-1.51248 2.0832,-3.20649 1.7384,-3.76446 -0.3449,-0.55797 0.165,-2.77096 1.1331,-4.91775 l 1.7601,-3.90325 -2.7875,-2.19271 -2.7876,-2.19272 0.5669,-10.74601 c 0.6291,-11.92551 1.411,-14.16346 5.7286,-16.39616 3.8739,-2.00331 4.7058,-5.56691 2.4613,-10.54431 -1.3565,-3.00814 -1.5534,-4.69186 -0.8407,-7.18807 0.8909,-3.12045 1.1644,-3.27086 6.3975,-3.51908 3.0067,-0.14261 6.0387,0.11479 6.7377,0.572 0.6991,0.45721 1.5352,3.7239 1.8582,7.2593 0.5489,6.00891 0.4171,6.58606 -2.021,8.85231 -2.9798,2.76971 -3.357,6.41766 -1.1077,10.71138 0.8253,1.57537 2.0484,5.491 2.7181,8.70139 1.4741,7.06735 4.4305,9.24255 11.185,8.22965 4.732,-0.70962 7.7344,0.86695 8.2644,4.33976 0.2548,1.66978 -0.4373,2.51662 -2.917,3.56919 -1.9433,0.82489 -3.6236,1.01634 -4.1772,0.47595 -0.5535,-0.54021 -1.476,-0.44773 -2.2924,0.22978 -1.0198,0.84638 -1.6596,0.84034 -2.5238,-0.0238 -1.5398,-1.5398 -4.7291,-1.47928 -4.8683,0.0924 -0.635,7.17107 3.5956,11.12227 7.6102,7.10764 0.9033,-0.90329 3.7,-2.02676 6.2149,-2.49659 5.1477,-0.9617 7.2797,-2.34446 7.2982,-4.73349 0.01,-0.89516 2.4768,-3.7887 5.4887,-6.4301 3.0118,-2.64139 6.697,-6.91639 8.1893,-9.5 1.4924,-2.5836 2.96,-4.93457 3.2614,-5.22436 0.3014,-0.2898 2.5395,-2.63736 4.9736,-5.21681 4.1085,-4.35383 4.3392,-4.87968 3.2191,-7.33801 -1.3774,-3.023 -0.6632,-6.41828 1.3501,-6.41828 0.748,0 2.25,1.13142 3.3378,2.51427 1.0877,1.38285 4.0267,3.42066 6.5311,4.52847 2.5044,1.10781 4.7976,2.4092 5.096,2.89198 0.2983,0.48277 3.3545,2.28447 6.7914,4.00377 15.0428,7.52511 19.3323,10.76946 19.9683,15.10324 0.3224,2.19628 -0.2236,3.54614 -2.2,5.43972 -2.9935,2.86793 -5.2168,3.19054 -7.0194,1.01855 -1.741,-2.09774 -3.1274,-1.91619 -11.7581,1.53969 -4.1752,1.67182 -8.3001,2.9021 -9.1666,2.73394 -0.8664,-0.16816 0.5622,-1.12324 3.1747,-2.12239 2.6125,-0.99916 4.75,-2.17192 4.75,-2.60614 0,-0.43422 -1.8951,-1.09252 -4.2113,-1.4629 -6.2186,-0.99439 -7.3187,0.74327 -9.7754,15.43936 -0.5076,3.03686 -2.322,9.78686 -4.0319,15 -2.2984,7.00699 -3.1281,11.43402 -3.1822,16.97844 -0.086,8.86891 -0.483,10.12249 -5.1253,16.20423 -3.2102,4.2056 -3.688,5.70312 -5.1176,16.04089 -1.0863,7.85573 -1.4162,15.42279 -1.0606,24.32856 0.703,17.60563 2.7099,17.68246 9.3698,25.50965 l 2.328,4.58333 -11.5181,-0.0163 c 0.9047,-1.69045 0.9308,-4.12472 -1.568,-6.41667 -2.8805,-2.64211 -2.9938,-3.08557 -3.382,-13.23372 -0.3714,-9.70841 -3.2798,-30.84879 -4.4023,-31.99843 -1.2911,-1.32236 -3.2545,3.97028 -4.3588,11.74976 -0.6736,4.74515 -1.879,10.19353 -2.6787,12.10752 -2.2694,5.43157 -2.6278,17.96421 -0.603,21.08582 3.0277,4.66756 6.6644,6.54699 12.1989,6.6517 l -24.0092,0.10512 c 1.3425,-2.11207 5.8589,-1.94644 5.6277,-5.96012 -0.2037,-3.53761 -2.1651,-4.98378 0.021,-13.51661 1.0248,-3.99992 1.5957,-11.77464 1.75,-23.83077 l 0.2291,-17.89399 -11.5,-0.63274 c -20.8928,-1.14953 -27.9212,-3.0216 -41.1021,-10.94786 -7.2745,-4.37446 -9.0697,-4.33308 -10.9692,0.2528 -0.69,1.66567 -2.7559,4.82556 -4.5909,7.02197 -1.8351,2.19641 -3.9493,6.31376 -4.6983,9.14965 -4.3497,16.46857 -4.6022,21.23043 -1.7316,32.65618 2.5449,10.12952 3.6127,12.83185 9.3621,19.10047 l 4.4367,4.83736" inkscape:connector-curvature="0" sodipodi:nodetypes="sssccsscssssccsccscscsssssscccccccsssssccsccscsccccssccccssscscsccsscssscccssscccsscsscccscscssccsssc" inkscape:label="#path4933" />
</g>
</svg>
<!DOCTYPE html>
<html vocab="http://schema.org" lang="ja">
<head>
<title>Three.jsによる馬のアニメーション</title>
<meta charset="utf-8" />
<meta name="description" content="SVGアニメーションのテスト" />
<meta name="keywords" content="Youtube,d3.js,Q.js,jquery" />
<meta name="author" content="sfpgmr" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<script type="text/javascript" src="./pathseg.js"></script>
<script src="https://d3js.org/d3.v5.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/102/three.min.js"></script>
<script src="https://threejs.org/examples/js/loaders/SVGLoader.js"></script>
<!--<script type="text/javascript" src="pathSerializer.js"></script>-->
<script type="text/javascript" src="svgToPath.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/q.js/1.1.2/q.min.js"></script>
<!--<script type="text/javascript" src="./graphics.js"></script> -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.2/normalize.min.css" />
<style>
body {
margin: 0;
padding: 0;
overflow: hidden;
}
#svg {
display: none;
}
</style>
</head>
<body>
<div id="content"></div>
<div id="svg"></div>
<div id="svgcell"></div>
<script type="text/javascript" src="index.js"></script>
<script></script>
</body>
</html>
//The MIT License (MIT)
//
//Copyright (c) 2015 Satoshi Fujiwara
//
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:
//
//The above copyright notice and this permission notice shall be included in
//all copies or substantial portions of the Software.
//
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//THE SOFTWARE.
// リリース時にはコメントアウトすること
// document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] +
// ':35729/livereload.js?snipver=2"></' + 'script>');
// メイン
window.addEventListener('load', async () => {
const WIDTH = window.innerWidth, HEIGHT = window.innerHeight;
const renderer = new THREE.WebGLRenderer({ antialias: false, sortObjects: true });
renderer.setSize(WIDTH, HEIGHT);
renderer.setClearColor(0xffffffff, 1);
renderer.domElement.id = 'console';
renderer.domElement.className = 'console';
renderer.domElement.style.zIndex = 0;
d3.select('#content').node().appendChild(renderer.domElement);
renderer.clear();
// シーンの作成
const scene = new THREE.Scene();
// カメラの作成
var camera = new THREE.PerspectiveCamera(90.0, WIDTH / HEIGHT);
camera.position.x = 0.0;
camera.position.y = 0.0;
camera.position.z = (WIDTH / 2.0) * HEIGHT / WIDTH;
camera.lookAt(new THREE.Vector3(0.0, 0.0, 0.0));
window.addEventListener('resize', function () {
WIDTH = window.innerWidth;
HEIGHT = window.innerHeight;
renderer.setSize(WIDTH, HEIGHT);
camera.aspect = WIDTH / HEIGHT;
camera.position.z = (WIDTH / 2.0) * HEIGHT / WIDTH;
camera.updateProjectionMatrix();
});
//var xml = Q.nfbind(d3.xml);
// SVGファイルから馬のメッシュを作る
const svgText = await d3.text('./horse07-1.svg');
const svgLoader = new THREE.SVGLoader();
const paths = svgLoader.parse(svgText).paths;
//console.log(paths);
const meshes = [];
for ( var i = 0; i < paths.length; i ++ ) {
var path = paths[ i ];
var material = new THREE.MeshBasicMaterial( {
color: new THREE.Color(1.0,0.0,0.0),
side: THREE.DoubleSide,
depthWrite: false
} );
var shapes = path.toShapes( true,false );
for(let j = 0; j < shapes.length; ++j ) {
const shape = shapes[ j ];
const geometry = new THREE.ShapeBufferGeometry( shape );
const positions = geometry.attributes.position.array;
let sx = path.currentPath.currentPoint.x;
let sy = path.currentPath.currentPoint.y;
let ex = path.currentPath.currentPoint.x;
let ey = path.currentPath.currentPoint.y;
for(let i = 0,e = positions.length;i < e;i += 3){
sx = Math.min(sx,positions[i + 0/* x */]);
sy = Math.min(sy,positions[i + 1/* y */]);
ex = Math.max(ex,positions[i + 0/* x */]);
ey = Math.max(ey,positions[i + 1/* y */]);
}
let cx = ex - (ex - sx) / 2;
let cy = ey - (ey - sy) / 2;
for(let i = 0,e = positions.length;i < e;i += 3){
positions[i + 0/* x */] -= cx;
positions[i + 1] = (positions[i + 1] - cy) * -1;
}
const mesh = new THREE.Mesh( geometry, material );
mesh.scale.set(1.5,1.5,1.5);
mesh.visible = false;
meshes.push(mesh);
scene.add( mesh );
}
}
//レンダリング
//let before = index;
(function render(index) {
if(index > 10) index = 0;
const idx = index | 0;
for(let i = 0,e = meshes.length;i < e;++i){
if(idx == i){
meshes[i].visible = true;
} else {
meshes[i].visible = false;
}
}
renderer.render(scene, camera);
index += 0.5;
requestAnimationFrame(render.bind(null, index));
})(0);
// console.log(d3.select('#svg').html());
});
{
"name": "5e85dd1519d7b1d09626",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@types/d3": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/@types/d3/-/d3-5.7.1.tgz",
"integrity": "sha512-1TNamlKYTdpRzFjDIcgiRqpNqYz9VVvNOisVqCqvYsxXyysgbfTKxdOurrVcW+SxyURTPwAD68KV04BL5RKNcQ==",
"requires": {
"@types/d3-array": "*",
"@types/d3-axis": "*",
"@types/d3-brush": "*",
"@types/d3-chord": "*",
"@types/d3-collection": "*",
"@types/d3-color": "*",
"@types/d3-contour": "*",
"@types/d3-dispatch": "*",
"@types/d3-drag": "*",
"@types/d3-dsv": "*",
"@types/d3-ease": "*",
"@types/d3-fetch": "*",
"@types/d3-force": "*",
"@types/d3-format": "*",
"@types/d3-geo": "*",
"@types/d3-hierarchy": "*",
"@types/d3-interpolate": "*",
"@types/d3-path": "*",
"@types/d3-polygon": "*",
"@types/d3-quadtree": "*",
"@types/d3-random": "*",
"@types/d3-scale": "*",
"@types/d3-scale-chromatic": "*",
"@types/d3-selection": "*",
"@types/d3-shape": "*",
"@types/d3-time": "*",
"@types/d3-time-format": "*",
"@types/d3-timer": "*",
"@types/d3-transition": "*",
"@types/d3-voronoi": "*",
"@types/d3-zoom": "*"
}
},
"@types/d3-array": {
"version": "1.2.6",
"resolved": "https://registry.npmjs.org/@types/d3-array/-/d3-array-1.2.6.tgz",
"integrity": "sha512-/EcY/15X5tnwkMT2txpjiLUNJj5xHA2vGHOXI8NTYGhETK914RRLQLjNm6EpAI1D2IY5vh3CzuLODnqBAwKjPA=="
},
"@types/d3-axis": {
"version": "1.0.12",
"resolved": "https://registry.npmjs.org/@types/d3-axis/-/d3-axis-1.0.12.tgz",
"integrity": "sha512-BZISgSD5M8TgURyNtcPAmUB9sk490CO1Thb6/gIn0WZTt3Y50IssX+2Z0vTccoqZksUDTep0b+o4ofXslvNbqg==",
"requires": {
"@types/d3-selection": "*"
}
},
"@types/d3-brush": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/@types/d3-brush/-/d3-brush-1.0.10.tgz",
"integrity": "sha512-J8jREATIrfJaAfhJivqaEKPnJsRlwwrOPje+ABqZFgamADjll+q9zaDXnYyjiGPPsiJEU+Qq9jQi5rECxIOfhg==",
"requires": {
"@types/d3-selection": "*"
}
},
"@types/d3-chord": {
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/@types/d3-chord/-/d3-chord-1.0.9.tgz",
"integrity": "sha512-UA6lI9CVW5cT5Ku/RV4hxoFn4mKySHm7HEgodtfRthAj1lt9rKZEPon58vyYfk+HIAm33DtJJgZwMXy2QgyPXw=="
},
"@types/d3-collection": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/@types/d3-collection/-/d3-collection-1.0.8.tgz",
"integrity": "sha512-y5lGlazdc0HNO0F3UUX2DPE7OmYvd9Kcym4hXwrJcNUkDaypR5pX+apuMikl9LfTxKItJsY9KYvzBulpCKyvuQ=="
},
"@types/d3-color": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/@types/d3-color/-/d3-color-1.2.2.tgz",
"integrity": "sha512-6pBxzJ8ZP3dYEQ4YjQ+NVbQaOflfgXq/JbDiS99oLobM2o72uAST4q6yPxHv6FOTCRC/n35ktuo8pvw/S4M7sw=="
},
"@types/d3-contour": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/@types/d3-contour/-/d3-contour-1.3.0.tgz",
"integrity": "sha512-AUCUIjEnC5lCGBM9hS+MryRaFLIrPls4Rbv6ktqbd+TK/RXZPwOy9rtBWmGpbeXcSOYCJTUDwNJuEnmYPJRxHQ==",
"requires": {
"@types/d3-array": "*",
"@types/geojson": "*"
}
},
"@types/d3-dispatch": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/@types/d3-dispatch/-/d3-dispatch-1.0.7.tgz",
"integrity": "sha512-M+z84G7UKwK6hEPnGCSccOg8zJ3Nk2hgDQ9sCstHXgsFU0sMxlIZVKqKB5oxUDbALqQG6ucg0G9e8cmOSlishg=="
},
"@types/d3-drag": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/@types/d3-drag/-/d3-drag-1.2.3.tgz",
"integrity": "sha512-rWB5SPvkYVxW3sqUxHOJUZwifD0KqvKwvt1bhNqcLpW6Azsd0BJgRNcyVW8GAferaAk5r8dzeZnf9zKlg9+xMQ==",
"requires": {
"@types/d3-selection": "*"
}
},
"@types/d3-dsv": {
"version": "1.0.36",
"resolved": "https://registry.npmjs.org/@types/d3-dsv/-/d3-dsv-1.0.36.tgz",
"integrity": "sha512-jbIWQ27QJcBNMZbQv0NSQMHnBDCmxghAxePxgyiPH1XPCRkOsTBei7jcdi3fDrUCGpCV3lKrSZFSlOkhUQVClA=="
},
"@types/d3-ease": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/@types/d3-ease/-/d3-ease-1.0.8.tgz",
"integrity": "sha512-VRf8czVWHSJPoUWxMunzpePK02//wHDAswknU8QWzcyrQn6pqe46bHRYi2smSpw5VjsT2CG8k/QeWIdWPS3Bmg=="
},
"@types/d3-fetch": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/@types/d3-fetch/-/d3-fetch-1.1.5.tgz",
"integrity": "sha512-o9c0ItT5/Gl3wbNuVpzRnYX1t3RghzeWAjHUVLuyZJudiTxC4f/fC0ZPFWLQ2lVY8pAMmxpV8TJ6ETYCgPeI3A==",
"requires": {
"@types/d3-dsv": "*"
}
},
"@types/d3-force": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/@types/d3-force/-/d3-force-1.2.1.tgz",
"integrity": "sha512-jqK+I36uz4kTBjyk39meed5y31Ab+tXYN/x1dn3nZEus9yOHCLc+VrcIYLc/aSQ0Y7tMPRlIhLetulME76EiiA=="
},
"@types/d3-format": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/@types/d3-format/-/d3-format-1.3.1.tgz",
"integrity": "sha512-KAWvReOKMDreaAwOjdfQMm0HjcUMlQG47GwqdVKgmm20vTd2pucj0a70c3gUSHrnsmo6H2AMrkBsZU2UhJLq8A=="
},
"@types/d3-geo": {
"version": "1.11.1",
"resolved": "https://registry.npmjs.org/@types/d3-geo/-/d3-geo-1.11.1.tgz",
"integrity": "sha512-Ox8WWOG3igDRoep/dNsGbOiSJYdUG3ew/6z0ETvHyAtXZVBjOE0S96zSSmzgl0gqQ3RdZjn2eeJOj9oRcMZPkQ==",
"requires": {
"@types/geojson": "*"
}
},
"@types/d3-hierarchy": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/@types/d3-hierarchy/-/d3-hierarchy-1.1.6.tgz",
"integrity": "sha512-vvSaIDf/Ov0o3KwMT+1M8+WbnnlRiGjlGD5uvk83a1mPCTd/E5x12bUJ/oP55+wUY/4Kb5kc67rVpVGJ2KUHxg=="
},
"@types/d3-interpolate": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/@types/d3-interpolate/-/d3-interpolate-1.3.1.tgz",
"integrity": "sha512-z8Zmi08XVwe8e62vP6wcA+CNuRhpuUU5XPEfqpG0hRypDE5BWNthQHB1UNWWDB7ojCbGaN4qBdsWp5kWxhT1IQ==",
"requires": {
"@types/d3-color": "*"
}
},
"@types/d3-path": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-1.0.8.tgz",
"integrity": "sha512-AZGHWslq/oApTAHu9+yH/Bnk63y9oFOMROtqPAtxl5uB6qm1x2lueWdVEjsjjV3Qc2+QfuzKIwIR5MvVBakfzA=="
},
"@types/d3-polygon": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/@types/d3-polygon/-/d3-polygon-1.0.7.tgz",
"integrity": "sha512-Xuw0eSjQQKs8jTiNbntWH0S+Xp+JyhqxmQ0YAQ3rDu6c3kKMFfgsaGN7Jv5u3zG6yVX/AsLP/Xs/QRjmi9g43Q=="
},
"@types/d3-quadtree": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/@types/d3-quadtree/-/d3-quadtree-1.0.7.tgz",
"integrity": "sha512-0ajFawWicfjsaCLh6NzxOyVDYhQAmMFbsiI3MPGLInorauHFEh9/Cl6UHNf+kt/J1jfoxKY/ZJaKAoDpbvde5Q=="
},
"@types/d3-random": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/@types/d3-random/-/d3-random-1.1.2.tgz",
"integrity": "sha512-Jui+Zn28pQw/3EayPKaN4c/PqTvqNbIPjHkgIIFnxne1FdwNjfHtAIsZIBMKlquQNrrMjFzCrlF2gPs3xckqaA=="
},
"@types/d3-scale": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/@types/d3-scale/-/d3-scale-2.1.1.tgz",
"integrity": "sha512-kNTkbZQ+N/Ip8oX9PByXfDLoCSaZYm+VUOasbmsa6KD850/ziMdYepg/8kLg2plHzoLANdMqPoYQbvExevLUHg==",
"requires": {
"@types/d3-time": "*"
}
},
"@types/d3-scale-chromatic": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/@types/d3-scale-chromatic/-/d3-scale-chromatic-1.3.1.tgz",
"integrity": "sha512-Ny3rLbV5tnmqgW7w/poCcef4kXP8mHPo/p8EjTS5d9OUk8MlqAeRaM8eF7Vyv7QMLiIXNE94Pa1cMLSPkXQBoQ=="
},
"@types/d3-selection": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/@types/d3-selection/-/d3-selection-1.4.1.tgz",
"integrity": "sha512-bv8IfFYo/xG6dxri9OwDnK3yCagYPeRIjTlrcdYJSx+FDWlCeBDepIHUpqROmhPtZ53jyna0aUajZRk0I3rXNA=="
},
"@types/d3-shape": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-1.3.1.tgz",
"integrity": "sha512-usqdvUvPJ7AJNwpd2drOzRKs1ELie53p2m2GnPKr076/ADM579jVTJ5dPsoZ5E/CMNWk8lvPWYQSvilpp6jjwg==",
"requires": {
"@types/d3-path": "*"
}
},
"@types/d3-time": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-1.0.10.tgz",
"integrity": "sha512-aKf62rRQafDQmSiv1NylKhIMmznsjRN+MnXRXTqHoqm0U/UZzVpdrtRnSIfdiLS616OuC1soYeX1dBg2n1u8Xw=="
},
"@types/d3-time-format": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/@types/d3-time-format/-/d3-time-format-2.1.1.tgz",
"integrity": "sha512-tJSyXta8ZyJ52wDDHA96JEsvkbL6jl7wowGmuf45+fAkj5Y+SQOnz0N7/H68OWmPshPsAaWMQh+GAws44IzH3g=="
},
"@types/d3-timer": {
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/@types/d3-timer/-/d3-timer-1.0.9.tgz",
"integrity": "sha512-WvfJ3LFxBbWjqRGz9n7GJt08RrTHPJDVsIwwoCMROlqF+iDacYiAFjf9oqnq0mXpb2juA2N/qjKP+MKdal3YNQ=="
},
"@types/d3-transition": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/@types/d3-transition/-/d3-transition-1.1.4.tgz",
"integrity": "sha512-/vsmKVUIXEyCcIXYAlw7bnYkIs9/J/nZbptRJFKUN3FdXq/dF6j9z9xXzerkyU6TDHLrMrwx9eGwdKyTIy/j9w==",
"requires": {
"@types/d3-selection": "*"
}
},
"@types/d3-voronoi": {
"version": "1.1.9",
"resolved": "https://registry.npmjs.org/@types/d3-voronoi/-/d3-voronoi-1.1.9.tgz",
"integrity": "sha512-DExNQkaHd1F3dFPvGA/Aw2NGyjMln6E9QzsiqOcBgnE+VInYnFBHBBySbZQts6z6xD+5jTfKCP7M4OqMyVjdwQ=="
},
"@types/d3-zoom": {
"version": "1.7.4",
"resolved": "https://registry.npmjs.org/@types/d3-zoom/-/d3-zoom-1.7.4.tgz",
"integrity": "sha512-5jnFo/itYhJeB2khO/lKe730kW/h2EbKMOvY0uNp3+7NdPm4w63DwPEMxifQZ7n902xGYK5DdU67FmToSoy4VA==",
"requires": {
"@types/d3-interpolate": "*",
"@types/d3-selection": "*"
}
},
"@types/geojson": {
"version": "7946.0.7",
"resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.7.tgz",
"integrity": "sha512-wE2v81i4C4Ol09RtsWFAqg3BUitWbHSpSlIo+bNdsCJijO9sjme+zm+73ZMCa/qMC8UEERxzGbvmr1cffo2SiQ=="
},
"@types/three": {
"version": "0.93.27",
"resolved": "https://registry.npmjs.org/@types/three/-/three-0.93.27.tgz",
"integrity": "sha512-HncnT9RhhB9zflW3t/hUzaqWPL1vIXuyXaEhoMLJAHisfm8Xl6TscJPHR8U0XlUM1HcUnRxOpla9AJCLgK93lA=="
}
}
}
{
"name": "5e85dd1519d7b1d09626",
"version": "1.0.0",
"description": "SVGからThree.jsのgeometryへの変換",
"main": "app://localhost:35729/index.html",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git@gist.github.com:/892dc3eb0775c70130b6.git"
},
"keywords": [
"Node-Webkit"
],
"author": "S.F.",
"license": "MIT",
"devDependencies": {},
"dependencies": {
"@types/d3": "^5.7.1",
"@types/three": "^0.93.27",
"q": "^1.1.2",
"request": "^2.53.0"
},
"window": {
"toolbar": true,
"width": 1280,
"height": 720
}
}
// @info
// Polyfill for SVG getPathData() and setPathData() methods. Based on:
// - SVGPathSeg polyfill by Philip Rogers (MIT License)
// https://github.com/progers/pathseg
// - SVGPathNormalizer by Tadahisa Motooka (MIT License)
// https://github.com/motooka/SVGPathNormalizer/tree/master/src
// - arcToCubicCurves() by Dmitry Baranovskiy (MIT License)
// https://github.com/DmitryBaranovskiy/raphael/blob/v2.1.1/raphael.core.js#L1837
// @author
// Jarosław Foksa
// @license
// MIT License
if (!SVGPathElement.prototype.getPathData || !SVGPathElement.prototype.setPathData) {
(function() {
var commandsMap = {
"Z":"Z", "M":"M", "L":"L", "C":"C", "Q":"Q", "A":"A", "H":"H", "V":"V", "S":"S", "T":"T",
"z":"Z", "m":"m", "l":"l", "c":"c", "q":"q", "a":"a", "h":"h", "v":"v", "s":"s", "t":"t"
};
var Source = function(string) {
this._string = string;
this._currentIndex = 0;
this._endIndex = this._string.length;
this._prevCommand = null;
this._skipOptionalSpaces();
};
var isIE = window.navigator.userAgent.indexOf("MSIE ") !== -1;
Source.prototype = {
parseSegment: function() {
var char = this._string[this._currentIndex];
var command = commandsMap[char] ? commandsMap[char] : null;
if (command === null) {
// Possibly an implicit command. Not allowed if this is the first command.
if (this._prevCommand === null) {
return null;
}
// Check for remaining coordinates in the current command.
if (
(char === "+" || char === "-" || char === "." || (char >= "0" && char <= "9")) && this._prevCommand !== "Z"
) {
if (this._prevCommand === "M") {
command = "L";
}
else if (this._prevCommand === "m") {
command = "l";
}
else {
command = this._prevCommand;
}
}
else {
command = null;
}
if (command === null) {
return null;
}
}
else {
this._currentIndex += 1;
}
this._prevCommand = command;
var values = null;
var cmd = command.toUpperCase();
if (cmd === "H" || cmd === "V") {
values = [this._parseNumber()];
}
else if (cmd === "M" || cmd === "L" || cmd === "T") {
values = [this._parseNumber(), this._parseNumber()];
}
else if (cmd === "S" || cmd === "Q") {
values = [this._parseNumber(), this._parseNumber(), this._parseNumber(), this._parseNumber()];
}
else if (cmd === "C") {
values = [
this._parseNumber(),
this._parseNumber(),
this._parseNumber(),
this._parseNumber(),
this._parseNumber(),
this._parseNumber()
];
}
else if (cmd === "A") {
values = [
this._parseNumber(),
this._parseNumber(),
this._parseNumber(),
this._parseArcFlag(),
this._parseArcFlag(),
this._parseNumber(),
this._parseNumber()
];
}
else if (cmd === "Z") {
this._skipOptionalSpaces();
values = [];
}
if (values === null || values.indexOf(null) >= 0) {
// Unknown command or known command with invalid values
return null;
}
else {
return {type: command, values: values};
}
},
hasMoreData: function() {
return this._currentIndex < this._endIndex;
},
peekSegmentType: function() {
var char = this._string[this._currentIndex];
return commandsMap[char] ? commandsMap[char] : null;
},
initialCommandIsMoveTo: function() {
// If the path is empty it is still valid, so return true.
if (!this.hasMoreData()) {
return true;
}
var command = this.peekSegmentType();
// Path must start with moveTo.
return command === "M" || command === "m";
},
_isCurrentSpace: function() {
var char = this._string[this._currentIndex];
return char <= " " && (char === " " || char === "\n" || char === "\t" || char === "\r" || char === "\f");
},
_skipOptionalSpaces: function() {
while (this._currentIndex < this._endIndex && this._isCurrentSpace()) {
this._currentIndex += 1;
}
return this._currentIndex < this._endIndex;
},
_skipOptionalSpacesOrDelimiter: function() {
if (
this._currentIndex < this._endIndex &&
!this._isCurrentSpace() &&
this._string[this._currentIndex] !== ","
) {
return false;
}
if (this._skipOptionalSpaces()) {
if (this._currentIndex < this._endIndex && this._string[this._currentIndex] === ",") {
this._currentIndex += 1;
this._skipOptionalSpaces();
}
}
return this._currentIndex < this._endIndex;
},
// Parse a number from an SVG path. This very closely follows genericParseNumber(...) from
// Source/core/svg/SVGParserUtilities.cpp.
// Spec: http://www.w3.org/TR/SVG11/single-page.html#paths-PathDataBNF
_parseNumber: function() {
var exponent = 0;
var integer = 0;
var frac = 1;
var decimal = 0;
var sign = 1;
var expsign = 1;
var startIndex = this._currentIndex;
this._skipOptionalSpaces();
// Read the sign.
if (this._currentIndex < this._endIndex && this._string[this._currentIndex] === "+") {
this._currentIndex += 1;
}
else if (this._currentIndex < this._endIndex && this._string[this._currentIndex] === "-") {
this._currentIndex += 1;
sign = -1;
}
if (
this._currentIndex === this._endIndex ||
(
(this._string[this._currentIndex] < "0" || this._string[this._currentIndex] > "9") &&
this._string[this._currentIndex] !== "."
)
) {
// The first character of a number must be one of [0-9+-.].
return null;
}
// Read the integer part, build right-to-left.
var startIntPartIndex = this._currentIndex;
while (
this._currentIndex < this._endIndex &&
this._string[this._currentIndex] >= "0" &&
this._string[this._currentIndex] <= "9"
) {
this._currentIndex += 1; // Advance to first non-digit.
}
if (this._currentIndex !== startIntPartIndex) {
var scanIntPartIndex = this._currentIndex - 1;
var multiplier = 1;
while (scanIntPartIndex >= startIntPartIndex) {
integer += multiplier * (this._string[scanIntPartIndex] - "0");
scanIntPartIndex -= 1;
multiplier *= 10;
}
}
// Read the decimals.
if (this._currentIndex < this._endIndex && this._string[this._currentIndex] === ".") {
this._currentIndex += 1;
// There must be a least one digit following the .
if (
this._currentIndex >= this._endIndex ||
this._string[this._currentIndex] < "0" ||
this._string[this._currentIndex] > "9"
) {
return null;
}
while (
this._currentIndex < this._endIndex &&
this._string[this._currentIndex] >= "0" &&
this._string[this._currentIndex] <= "9"
) {
frac *= 10;
decimal += (this._string.charAt(this._currentIndex) - "0") / frac;
this._currentIndex += 1;
}
}
// Read the exponent part.
if (
this._currentIndex !== startIndex &&
this._currentIndex + 1 < this._endIndex &&
(this._string[this._currentIndex] === "e" || this._string[this._currentIndex] === "E") &&
(this._string[this._currentIndex + 1] !== "x" && this._string[this._currentIndex + 1] !== "m")
) {
this._currentIndex += 1;
// Read the sign of the exponent.
if (this._string[this._currentIndex] === "+") {
this._currentIndex += 1;
}
else if (this._string[this._currentIndex] === "-") {
this._currentIndex += 1;
expsign = -1;
}
// There must be an exponent.
if (
this._currentIndex >= this._endIndex ||
this._string[this._currentIndex] < "0" ||
this._string[this._currentIndex] > "9"
) {
return null;
}
while (
this._currentIndex < this._endIndex &&
this._string[this._currentIndex] >= "0" &&
this._string[this._currentIndex] <= "9"
) {
exponent *= 10;
exponent += (this._string[this._currentIndex] - "0");
this._currentIndex += 1;
}
}
var number = integer + decimal;
number *= sign;
if (exponent) {
number *= Math.pow(10, expsign * exponent);
}
if (startIndex === this._currentIndex) {
return null;
}
this._skipOptionalSpacesOrDelimiter();
return number;
},
_parseArcFlag: function() {
if (this._currentIndex >= this._endIndex) {
return null;
}
var flag = null;
var flagChar = this._string[this._currentIndex];
this._currentIndex += 1;
if (flagChar === "0") {
flag = 0;
}
else if (flagChar === "1") {
flag = 1;
}
else {
return null;
}
this._skipOptionalSpacesOrDelimiter();
return flag;
}
};
var parsePathDataString = function(string) {
if (!string || string.length === 0) return [];
var source = new Source(string);
var pathData = [];
if (source.initialCommandIsMoveTo()) {
while (source.hasMoreData()) {
var pathSeg = source.parseSegment();
if (pathSeg === null) {
break;
}
else {
pathData.push(pathSeg);
}
}
}
return pathData;
}
var setAttribute = SVGPathElement.prototype.setAttribute;
var removeAttribute = SVGPathElement.prototype.removeAttribute;
var $cachedPathData = window.Symbol ? Symbol() : "__cachedPathData";
var $cachedNormalizedPathData = window.Symbol ? Symbol() : "__cachedNormalizedPathData";
// @info
// Get an array of corresponding cubic bezier curve parameters for given arc curve paramters.
var arcToCubicCurves = function(x1, y1, x2, y2, r1, r2, angle, largeArcFlag, sweepFlag, _recursive) {
var degToRad = function(degrees) {
return (Math.PI * degrees) / 180;
};
var rotate = function(x, y, angleRad) {
var X = x * Math.cos(angleRad) - y * Math.sin(angleRad);
var Y = x * Math.sin(angleRad) + y * Math.cos(angleRad);
return {x: X, y: Y};
};
var angleRad = degToRad(angle);
var params = [];
var f1, f2, cx, cy;
if (_recursive) {
f1 = _recursive[0];
f2 = _recursive[1];
cx = _recursive[2];
cy = _recursive[3];
}
else {
var p1 = rotate(x1, y1, -angleRad);
x1 = p1.x;
y1 = p1.y;
var p2 = rotate(x2, y2, -angleRad);
x2 = p2.x;
y2 = p2.y;
var x = (x1 - x2) / 2;
var y = (y1 - y2) / 2;
var h = (x * x) / (r1 * r1) + (y * y) / (r2 * r2);
if (h > 1) {
h = Math.sqrt(h);
r1 = h * r1;
r2 = h * r2;
}
var sign;
if (largeArcFlag === sweepFlag) {
sign = -1;
}
else {
sign = 1;
}
var r1Pow = r1 * r1;
var r2Pow = r2 * r2;
var left = r1Pow * r2Pow - r1Pow * y * y - r2Pow * x * x;
var right = r1Pow * y * y + r2Pow * x * x;
var k = sign * Math.sqrt(Math.abs(left/right));
cx = k * r1 * y / r2 + (x1 + x2) / 2;
cy = k * -r2 * x / r1 + (y1 + y2) / 2;
f1 = Math.asin(parseFloat(((y1 - cy) / r2).toFixed(9)));
f2 = Math.asin(parseFloat(((y2 - cy) / r2).toFixed(9)));
if (x1 < cx) {
f1 = Math.PI - f1;
}
if (x2 < cx) {
f2 = Math.PI - f2;
}
if (f1 < 0) {
f1 = Math.PI * 2 + f1;
}
if (f2 < 0) {
f2 = Math.PI * 2 + f2;
}
if (sweepFlag && f1 > f2) {
f1 = f1 - Math.PI * 2;
}
if (!sweepFlag && f2 > f1) {
f2 = f2 - Math.PI * 2;
}
}
var df = f2 - f1;
if (Math.abs(df) > (Math.PI * 120 / 180)) {
var f2old = f2;
var x2old = x2;
var y2old = y2;
if (sweepFlag && f2 > f1) {
f2 = f1 + (Math.PI * 120 / 180) * (1);
}
else {
f2 = f1 + (Math.PI * 120 / 180) * (-1);
}
x2 = cx + r1 * Math.cos(f2);
y2 = cy + r2 * Math.sin(f2);
params = arcToCubicCurves(x2, y2, x2old, y2old, r1, r2, angle, 0, sweepFlag, [f2, f2old, cx, cy]);
}
df = f2 - f1;
var c1 = Math.cos(f1);
var s1 = Math.sin(f1);
var c2 = Math.cos(f2);
var s2 = Math.sin(f2);
var t = Math.tan(df / 4);
var hx = 4 / 3 * r1 * t;
var hy = 4 / 3 * r2 * t;
var m1 = [x1, y1];
var m2 = [x1 + hx * s1, y1 - hy * c1];
var m3 = [x2 + hx * s2, y2 - hy * c2];
var m4 = [x2, y2];
m2[0] = 2 * m1[0] - m2[0];
m2[1] = 2 * m1[1] - m2[1];
if (_recursive) {
return [m2, m3, m4].concat(params);
}
else {
params = [m2, m3, m4].concat(params).join().split(",");
var curves = [];
var curveParams = [];
params.forEach( function(param, i) {
if (i % 2) {
curveParams.push(rotate(params[i - 1], params[i], angleRad).y);
}
else {
curveParams.push(rotate(params[i], params[i + 1], angleRad).x);
}
if (curveParams.length === 6) {
curves.push(curveParams);
curveParams = [];
}
});
return curves;
}
};
var clonePathData = function(pathData) {
return pathData.map( function(seg) {
return {type: seg.type, values: Array.prototype.slice.call(seg.values)}
});
};
// @info
// Takes any path data, returns path data that consists only from absolute commands.
var absolutizePathData = function(pathData) {
var absolutizedPathData = [];
var currentX = null;
var currentY = null;
var subpathX = null;
var subpathY = null;
pathData.forEach( function(seg) {
var type = seg.type;
if (type === "M") {
var x = seg.values[0];
var y = seg.values[1];
absolutizedPathData.push({type: "M", values: [x, y]});
subpathX = x;
subpathY = y;
currentX = x;
currentY = y;
}
else if (type === "m") {
var x = currentX + seg.values[0];
var y = currentY + seg.values[1];
absolutizedPathData.push({type: "M", values: [x, y]});
subpathX = x;
subpathY = y;
currentX = x;
currentY = y;
}
else if (type === "L") {
var x = seg.values[0];
var y = seg.values[1];
absolutizedPathData.push({type: "L", values: [x, y]});
currentX = x;
currentY = y;
}
else if (type === "l") {
var x = currentX + seg.values[0];
var y = currentY + seg.values[1];
absolutizedPathData.push({type: "L", values: [x, y]});
currentX = x;
currentY = y;
}
else if (type === "C") {
var x1 = seg.values[0];
var y1 = seg.values[1];
var x2 = seg.values[2];
var y2 = seg.values[3];
var x = seg.values[4];
var y = seg.values[5];
absolutizedPathData.push({type: "C", values: [x1, y1, x2, y2, x, y]});
currentX = x;
currentY = y;
}
else if (type === "c") {
var x1 = currentX + seg.values[0];
var y1 = currentY + seg.values[1];
var x2 = currentX + seg.values[2];
var y2 = currentY + seg.values[3];
var x = currentX + seg.values[4];
var y = currentY + seg.values[5];
absolutizedPathData.push({type: "C", values: [x1, y1, x2, y2, x, y]});
currentX = x;
currentY = y;
}
else if (type === "Q") {
var x1 = seg.values[0];
var y1 = seg.values[1];
var x = seg.values[2];
var y = seg.values[3];
absolutizedPathData.push({type: "Q", values: [x1, y1, x, y]});
currentX = x;
currentY = y;
}
else if (type === "q") {
var x1 = currentX + seg.values[0];
var y1 = currentY + seg.values[1];
var x = currentX + seg.values[2];
var y = currentY + seg.values[3];
absolutizedPathData.push({type: "Q", values: [x1, y1, x, y]});
currentX = x;
currentY = y;
}
else if (type === "A") {
var x = seg.values[5];
var y = seg.values[6];
absolutizedPathData.push({
type: "A",
values: [seg.values[0], seg.values[1], seg.values[2], seg.values[3], seg.values[4], x, y]
});
currentX = x;
currentY = y;
}
else if (type === "a") {
var x = currentX + seg.values[5];
var y = currentY + seg.values[6];
absolutizedPathData.push({
type: "A",
values: [seg.values[0], seg.values[1], seg.values[2], seg.values[3], seg.values[4], x, y]
});
currentX = x;
currentY = y;
}
else if (type === "H") {
var x = seg.values[0];
absolutizedPathData.push({type: "H", values: [x]});
currentX = x;
}
else if (type === "h") {
var x = currentX + seg.values[0];
absolutizedPathData.push({type: "H", values: [x]});
currentX = x;
}
else if (type === "V") {
var y = seg.values[0];
absolutizedPathData.push({type: "V", values: [y]});
currentY = y;
}
else if (type === "v") {
var y = currentY + seg.values[0];
absolutizedPathData.push({type: "V", values: [y]});
currentY = y;
}
else if (type === "S") {
var x2 = seg.values[0];
var y2 = seg.values[1];
var x = seg.values[2];
var y = seg.values[3];
absolutizedPathData.push({type: "S", values: [x2, y2, x, y]});
currentX = x;
currentY = y;
}
else if (type === "s") {
var x2 = currentX + seg.values[0];
var y2 = currentY + seg.values[1];
var x = currentX + seg.values[2];
var y = currentY + seg.values[3];
absolutizedPathData.push({type: "S", values: [x2, y2, x, y]});
currentX = x;
currentY = y;
}
else if (type === "T") {
var x = seg.values[0];
var y = seg.values[1]
absolutizedPathData.push({type: "T", values: [x, y]});
currentX = x;
currentY = y;
}
else if (type === "t") {
var x = currentX + seg.values[0];
var y = currentY + seg.values[1]
absolutizedPathData.push({type: "T", values: [x, y]});
currentX = x;
currentY = y;
}
else if (type === "Z" || type === "z") {
absolutizedPathData.push({type: "Z", values: []});
currentX = subpathX;
currentY = subpathY;
}
});
return absolutizedPathData;
};
// @info
// Takes path data that consists only from absolute commands, returns path data that consists only from
// "M", "L", "C" and "Z" commands.
var reducePathData = function(pathData) {
var reducedPathData = [];
var lastType = null;
var lastControlX = null;
var lastControlY = null;
var currentX = null;
var currentY = null;
var subpathX = null;
var subpathY = null;
pathData.forEach( function(seg) {
if (seg.type === "M") {
var x = seg.values[0];
var y = seg.values[1];
reducedPathData.push({type: "M", values: [x, y]});
subpathX = x;
subpathY = y;
currentX = x;
currentY = y;
}
else if (seg.type === "C") {
var x1 = seg.values[0];
var y1 = seg.values[1];
var x2 = seg.values[2];
var y2 = seg.values[3];
var x = seg.values[4];
var y = seg.values[5];
reducedPathData.push({type: "C", values: [x1, y1, x2, y2, x, y]});
lastControlX = x2;
lastControlY = y2;
currentX = x;
currentY = y;
}
else if (seg.type === "L") {
var x = seg.values[0];
var y = seg.values[1];
reducedPathData.push({type: "L", values: [x, y]});
currentX = x;
currentY = y;
}
else if (seg.type === "H") {
var x = seg.values[0];
reducedPathData.push({type: "L", values: [x, currentY]});
currentX = x;
}
else if (seg.type === "V") {
var y = seg.values[0];
reducedPathData.push({type: "L", values: [currentX, y]});
currentY = y;
}
else if (seg.type === "S") {
var x2 = seg.values[0];
var y2 = seg.values[1];
var x = seg.values[2];
var y = seg.values[3];
var cx1, cy1;
if (lastType === "C" || lastType === "S") {
cx1 = currentX + (currentX - lastControlX);
cy1 = currentY + (currentY - lastControlY);
}
else {
cx1 = currentX;
cy1 = currentY;
}
reducedPathData.push({type: "C", values: [cx1, cy1, x2, y2, x, y]});
lastControlX = x2;
lastControlY = y2;
currentX = x;
currentY = y;
}
else if (seg.type === "T") {
var x = seg.values[0];
var y = seg.values[1];
var x1, y1;
if (lastType === "Q" || lastType === "T") {
x1 = currentX + (currentX - lastControlX);
y1 = currentY + (currentY - lastControlY);
}
else {
x1 = currentX;
y1 = currentY;
}
var cx1 = currentX + 2 * (x1 - currentX) / 3;
var cy1 = currentY + 2 * (y1 - currentY) / 3;
var cx2 = x + 2 * (x1 - x) / 3;
var cy2 = y + 2 * (y1 - y) / 3;
reducedPathData.push({type: "C", values: [cx1, cy1, cx2, cy2, x, y]});
lastControlX = x1;
lastControlY = y1;
currentX = x;
currentY = y;
}
else if (seg.type === "Q") {
var x1 = seg.values[0];
var y1 = seg.values[1];
var x = seg.values[2];
var y = seg.values[3];
var cx1 = currentX + 2 * (x1 - currentX) / 3;
var cy1 = currentY + 2 * (y1 - currentY) / 3;
var cx2 = x + 2 * (x1 - x) / 3;
var cy2 = y + 2 * (y1 - y) / 3;
reducedPathData.push({type: "C", values: [cx1, cy1, cx2, cy2, x, y]});
lastControlX = x1;
lastControlY = y1;
currentX = x;
currentY = y;
}
else if (seg.type === "A") {
var r1 = seg.values[0];
var r2 = seg.values[1];
var angle = seg.values[2];
var largeArcFlag = seg.values[3];
var sweepFlag = seg.values[4];
var x = seg.values[5];
var y = seg.values[6];
if (r1 === 0 || r2 === 0) {
reducedPathData.push({type: "C", values: [currentX, currentY, x, y, x, y]});
currentX = x;
currentY = y;
}
else {
if (currentX !== x || currentY !== y) {
var curves = arcToCubicCurves(currentX, currentY, x, y, r1, r2, angle, largeArcFlag, sweepFlag);
curves.forEach( function(curve) {
reducedPathData.push({type: "C", values: curve});
currentX = x;
currentY = y;
});
}
}
}
else if (seg.type === "Z") {
reducedPathData.push(seg);
currentX = subpathX;
currentY = subpathY;
}
lastType = seg.type;
});
return reducedPathData;
};
SVGPathElement.prototype.setAttribute = function(name, value) {
if (name === "d") {
this[$cachedPathData] = null;
this[$cachedNormalizedPathData] = null;
}
setAttribute.call(this, name, value);
};
SVGPathElement.prototype.removeAttribute = function(name, value) {
if (name === "d") {
this[$cachedPathData] = null;
this[$cachedNormalizedPathData] = null;
}
removeAttribute.call(this, name);
};
SVGPathElement.prototype.getPathData = function(options) {
if (options && options.normalize) {
if (this[$cachedNormalizedPathData]) {
return clonePathData(this[$cachedNormalizedPathData]);
}
else {
var pathData;
if (this[$cachedPathData]) {
pathData = clonePathData(this[$cachedPathData]);
}
else {
pathData = parsePathDataString(this.getAttribute("d") || "");
this[$cachedPathData] = clonePathData(pathData);
}
var normalizedPathData = reducePathData(absolutizePathData(pathData));
this[$cachedNormalizedPathData] = clonePathData(normalizedPathData);
return normalizedPathData;
}
}
else {
if (this[$cachedPathData]) {
return clonePathData(this[$cachedPathData]);
}
else {
var pathData = parsePathDataString(this.getAttribute("d") || "");
this[$cachedPathData] = clonePathData(pathData);
return pathData;
}
}
};
SVGPathElement.prototype.setPathData = function(pathData) {
if (pathData.length === 0) {
if (isIE) {
// @bugfix https://github.com/mbostock/d3/issues/1737
this.setAttribute("d", "");
}
else {
this.removeAttribute("d");
}
}
else {
var d = "";
for (var i = 0, l = pathData.length; i < l; i += 1) {
var seg = pathData[i];
if (i > 0) {
d += " ";
}
d += seg.type;
if (seg.values && seg.values.length > 0) {
d += " " + seg.values.join(" ");
}
}
this.setAttribute("d", d);
}
};
SVGRectElement.prototype.getPathData = function(options) {
var x = this.x.baseVal.value;
var y = this.y.baseVal.value;
var width = this.width.baseVal.value;
var height = this.height.baseVal.value;
var rx = this.hasAttribute("rx") ? this.rx.baseVal.value : this.ry.baseVal.value;
var ry = this.hasAttribute("ry") ? this.ry.baseVal.value : this.rx.baseVal.value;
if (rx > width / 2) {
rx = width / 2;
}
if (ry > height / 2) {
ry = height / 2;
}
var pathData = [
{type: "M", values: [x+rx, y]},
{type: "H", values: [x+width-rx]},
{type: "A", values: [rx, ry, 0, 0, 1, x+width, y+ry]},
{type: "V", values: [y+height-ry]},
{type: "A", values: [rx, ry, 0, 0, 1, x+width-rx, y+height]},
{type: "H", values: [x+rx]},
{type: "A", values: [rx, ry, 0, 0, 1, x, y+height-ry]},
{type: "V", values: [y+ry]},
{type: "A", values: [rx, ry, 0, 0, 1, x+rx, y]},
{type: "Z", values: []}
];
// Get rid of redundant "A" segs when either rx or ry is 0
pathData = pathData.filter(function(s) {
return s.type === "A" && (s.values[0] === 0 || s.values[1] === 0) ? false : true;
});
if (options && options.normalize === true) {
pathData = reducePathData(pathData);
}
return pathData;
};
SVGCircleElement.prototype.getPathData = function(options) {
var cx = this.cx.baseVal.value;
var cy = this.cy.baseVal.value;
var r = this.r.baseVal.value;
var pathData = [
{ type: "M", values: [cx + r, cy] },
{ type: "A", values: [r, r, 0, 0, 1, cx, cy+r] },
{ type: "A", values: [r, r, 0, 0, 1, cx-r, cy] },
{ type: "A", values: [r, r, 0, 0, 1, cx, cy-r] },
{ type: "A", values: [r, r, 0, 0, 1, cx+r, cy] },
{ type: "Z", values: [] }
];
if (options && options.normalize === true) {
pathData = reducePathData(pathData);
}
return pathData;
};
SVGEllipseElement.prototype.getPathData = function(options) {
var cx = this.cx.baseVal.value;
var cy = this.cy.baseVal.value;
var rx = this.rx.baseVal.value;
var ry = this.ry.baseVal.value;
var pathData = [
{ type: "M", values: [cx + rx, cy] },
{ type: "A", values: [rx, ry, 0, 0, 1, cx, cy+ry] },
{ type: "A", values: [rx, ry, 0, 0, 1, cx-rx, cy] },
{ type: "A", values: [rx, ry, 0, 0, 1, cx, cy-ry] },
{ type: "A", values: [rx, ry, 0, 0, 1, cx+rx, cy] },
{ type: "Z", values: [] }
];
if (options && options.normalize === true) {
pathData = reducePathData(pathData);
}
return pathData;
};
SVGLineElement.prototype.getPathData = function() {
return [
{ type: "M", values: [this.x1.baseVal.value, this.y1.baseVal.value] },
{ type: "L", values: [this.x2.baseVal.value, this.y2.baseVal.value] }
];
};
SVGPolylineElement.prototype.getPathData = function() {
var pathData = [];
for (var i = 0; i < this.points.numberOfItems; i += 1) {
var point = this.points.getItem(i);
pathData.push({
type: (i === 0 ? "M" : "L"),
values: [point.x, point.y]
});
}
return pathData;
};
SVGPolygonElement.prototype.getPathData = function() {
var pathData = [];
for (var i = 0; i < this.points.numberOfItems; i += 1) {
var point = this.points.getItem(i);
pathData.push({
type: (i === 0 ? "M" : "L"),
values: [point.x, point.y]
});
}
pathData.push({
type: "Z",
values: []
});
return pathData;
};
})();
}
// SVGPathSeg API polyfill
// https://github.com/progers/pathseg
//
// This is a drop-in replacement for the SVGPathSeg and SVGPathSegList APIs that were removed from
// SVG2 (https://lists.w3.org/Archives/Public/www-svg/2015Jun/0044.html), including the latest spec
// changes which were implemented in Firefox 43 and Chrome 46.
(function() { "use strict";
if (!("SVGPathSeg" in window)) {
// Spec: http://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathSeg
window.SVGPathSeg = function(type, typeAsLetter, owningPathSegList) {
this.pathSegType = type;
this.pathSegTypeAsLetter = typeAsLetter;
this._owningPathSegList = owningPathSegList;
}
window.SVGPathSeg.prototype.classname = "SVGPathSeg";
window.SVGPathSeg.PATHSEG_UNKNOWN = 0;
window.SVGPathSeg.PATHSEG_CLOSEPATH = 1;
window.SVGPathSeg.PATHSEG_MOVETO_ABS = 2;
window.SVGPathSeg.PATHSEG_MOVETO_REL = 3;
window.SVGPathSeg.PATHSEG_LINETO_ABS = 4;
window.SVGPathSeg.PATHSEG_LINETO_REL = 5;
window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS = 6;
window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL = 7;
window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS = 8;
window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL = 9;
window.SVGPathSeg.PATHSEG_ARC_ABS = 10;
window.SVGPathSeg.PATHSEG_ARC_REL = 11;
window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS = 12;
window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL = 13;
window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS = 14;
window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL = 15;
window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS = 16;
window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL = 17;
window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS = 18;
window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL = 19;
// Notify owning PathSegList on any changes so they can be synchronized back to the path element.
window.SVGPathSeg.prototype._segmentChanged = function() {
if (this._owningPathSegList)
this._owningPathSegList.segmentChanged(this);
}
window.SVGPathSegClosePath = function(owningPathSegList) {
window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CLOSEPATH, "z", owningPathSegList);
}
window.SVGPathSegClosePath.prototype = Object.create(window.SVGPathSeg.prototype);
window.SVGPathSegClosePath.prototype.toString = function() { return "[object SVGPathSegClosePath]"; }
window.SVGPathSegClosePath.prototype._asPathString = function() { return this.pathSegTypeAsLetter; }
window.SVGPathSegClosePath.prototype.clone = function() { return new window.SVGPathSegClosePath(undefined); }
window.SVGPathSegMovetoAbs = function(owningPathSegList, x, y) {
window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_MOVETO_ABS, "M", owningPathSegList);
this._x = x;
this._y = y;
}
window.SVGPathSegMovetoAbs.prototype = Object.create(window.SVGPathSeg.prototype);
window.SVGPathSegMovetoAbs.prototype.toString = function() { return "[object SVGPathSegMovetoAbs]"; }
window.SVGPathSegMovetoAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x + " " + this._y; }
window.SVGPathSegMovetoAbs.prototype.clone = function() { return new window.SVGPathSegMovetoAbs(undefined, this._x, this._y); }
Object.defineProperty(window.SVGPathSegMovetoAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegMovetoAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
window.SVGPathSegMovetoRel = function(owningPathSegList, x, y) {
window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_MOVETO_REL, "m", owningPathSegList);
this._x = x;
this._y = y;
}
window.SVGPathSegMovetoRel.prototype = Object.create(window.SVGPathSeg.prototype);
window.SVGPathSegMovetoRel.prototype.toString = function() { return "[object SVGPathSegMovetoRel]"; }
window.SVGPathSegMovetoRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x + " " + this._y; }
window.SVGPathSegMovetoRel.prototype.clone = function() { return new window.SVGPathSegMovetoRel(undefined, this._x, this._y); }
Object.defineProperty(window.SVGPathSegMovetoRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegMovetoRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
window.SVGPathSegLinetoAbs = function(owningPathSegList, x, y) {
window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_ABS, "L", owningPathSegList);
this._x = x;
this._y = y;
}
window.SVGPathSegLinetoAbs.prototype = Object.create(window.SVGPathSeg.prototype);
window.SVGPathSegLinetoAbs.prototype.toString = function() { return "[object SVGPathSegLinetoAbs]"; }
window.SVGPathSegLinetoAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x + " " + this._y; }
window.SVGPathSegLinetoAbs.prototype.clone = function() { return new window.SVGPathSegLinetoAbs(undefined, this._x, this._y); }
Object.defineProperty(window.SVGPathSegLinetoAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegLinetoAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
window.SVGPathSegLinetoRel = function(owningPathSegList, x, y) {
window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_REL, "l", owningPathSegList);
this._x = x;
this._y = y;
}
window.SVGPathSegLinetoRel.prototype = Object.create(window.SVGPathSeg.prototype);
window.SVGPathSegLinetoRel.prototype.toString = function() { return "[object SVGPathSegLinetoRel]"; }
window.SVGPathSegLinetoRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x + " " + this._y; }
window.SVGPathSegLinetoRel.prototype.clone = function() { return new window.SVGPathSegLinetoRel(undefined, this._x, this._y); }
Object.defineProperty(window.SVGPathSegLinetoRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegLinetoRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
window.SVGPathSegCurvetoCubicAbs = function(owningPathSegList, x, y, x1, y1, x2, y2) {
window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS, "C", owningPathSegList);
this._x = x;
this._y = y;
this._x1 = x1;
this._y1 = y1;
this._x2 = x2;
this._y2 = y2;
}
window.SVGPathSegCurvetoCubicAbs.prototype = Object.create(window.SVGPathSeg.prototype);
window.SVGPathSegCurvetoCubicAbs.prototype.toString = function() { return "[object SVGPathSegCurvetoCubicAbs]"; }
window.SVGPathSegCurvetoCubicAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x1 + " " + this._y1 + " " + this._x2 + " " + this._y2 + " " + this._x + " " + this._y; }
window.SVGPathSegCurvetoCubicAbs.prototype.clone = function() { return new window.SVGPathSegCurvetoCubicAbs(undefined, this._x, this._y, this._x1, this._y1, this._x2, this._y2); }
Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "x1", { get: function() { return this._x1; }, set: function(x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "y1", { get: function() { return this._y1; }, set: function(y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "x2", { get: function() { return this._x2; }, set: function(x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "y2", { get: function() { return this._y2; }, set: function(y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true });
window.SVGPathSegCurvetoCubicRel = function(owningPathSegList, x, y, x1, y1, x2, y2) {
window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL, "c", owningPathSegList);
this._x = x;
this._y = y;
this._x1 = x1;
this._y1 = y1;
this._x2 = x2;
this._y2 = y2;
}
window.SVGPathSegCurvetoCubicRel.prototype = Object.create(window.SVGPathSeg.prototype);
window.SVGPathSegCurvetoCubicRel.prototype.toString = function() { return "[object SVGPathSegCurvetoCubicRel]"; }
window.SVGPathSegCurvetoCubicRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x1 + " " + this._y1 + " " + this._x2 + " " + this._y2 + " " + this._x + " " + this._y; }
window.SVGPathSegCurvetoCubicRel.prototype.clone = function() { return new window.SVGPathSegCurvetoCubicRel(undefined, this._x, this._y, this._x1, this._y1, this._x2, this._y2); }
Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "x1", { get: function() { return this._x1; }, set: function(x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "y1", { get: function() { return this._y1; }, set: function(y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "x2", { get: function() { return this._x2; }, set: function(x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "y2", { get: function() { return this._y2; }, set: function(y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true });
window.SVGPathSegCurvetoQuadraticAbs = function(owningPathSegList, x, y, x1, y1) {
window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS, "Q", owningPathSegList);
this._x = x;
this._y = y;
this._x1 = x1;
this._y1 = y1;
}
window.SVGPathSegCurvetoQuadraticAbs.prototype = Object.create(window.SVGPathSeg.prototype);
window.SVGPathSegCurvetoQuadraticAbs.prototype.toString = function() { return "[object SVGPathSegCurvetoQuadraticAbs]"; }
window.SVGPathSegCurvetoQuadraticAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x1 + " " + this._y1 + " " + this._x + " " + this._y; }
window.SVGPathSegCurvetoQuadraticAbs.prototype.clone = function() { return new window.SVGPathSegCurvetoQuadraticAbs(undefined, this._x, this._y, this._x1, this._y1); }
Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype, "x1", { get: function() { return this._x1; }, set: function(x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype, "y1", { get: function() { return this._y1; }, set: function(y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true });
window.SVGPathSegCurvetoQuadraticRel = function(owningPathSegList, x, y, x1, y1) {
window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL, "q", owningPathSegList);
this._x = x;
this._y = y;
this._x1 = x1;
this._y1 = y1;
}
window.SVGPathSegCurvetoQuadraticRel.prototype = Object.create(window.SVGPathSeg.prototype);
window.SVGPathSegCurvetoQuadraticRel.prototype.toString = function() { return "[object SVGPathSegCurvetoQuadraticRel]"; }
window.SVGPathSegCurvetoQuadraticRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x1 + " " + this._y1 + " " + this._x + " " + this._y; }
window.SVGPathSegCurvetoQuadraticRel.prototype.clone = function() { return new window.SVGPathSegCurvetoQuadraticRel(undefined, this._x, this._y, this._x1, this._y1); }
Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype, "x1", { get: function() { return this._x1; }, set: function(x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype, "y1", { get: function() { return this._y1; }, set: function(y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true });
window.SVGPathSegArcAbs = function(owningPathSegList, x, y, r1, r2, angle, largeArcFlag, sweepFlag) {
window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_ARC_ABS, "A", owningPathSegList);
this._x = x;
this._y = y;
this._r1 = r1;
this._r2 = r2;
this._angle = angle;
this._largeArcFlag = largeArcFlag;
this._sweepFlag = sweepFlag;
}
window.SVGPathSegArcAbs.prototype = Object.create(window.SVGPathSeg.prototype);
window.SVGPathSegArcAbs.prototype.toString = function() { return "[object SVGPathSegArcAbs]"; }
window.SVGPathSegArcAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._r1 + " " + this._r2 + " " + this._angle + " " + (this._largeArcFlag ? "1" : "0") + " " + (this._sweepFlag ? "1" : "0") + " " + this._x + " " + this._y; }
window.SVGPathSegArcAbs.prototype.clone = function() { return new window.SVGPathSegArcAbs(undefined, this._x, this._y, this._r1, this._r2, this._angle, this._largeArcFlag, this._sweepFlag); }
Object.defineProperty(window.SVGPathSegArcAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegArcAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegArcAbs.prototype, "r1", { get: function() { return this._r1; }, set: function(r1) { this._r1 = r1; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegArcAbs.prototype, "r2", { get: function() { return this._r2; }, set: function(r2) { this._r2 = r2; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegArcAbs.prototype, "angle", { get: function() { return this._angle; }, set: function(angle) { this._angle = angle; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegArcAbs.prototype, "largeArcFlag", { get: function() { return this._largeArcFlag; }, set: function(largeArcFlag) { this._largeArcFlag = largeArcFlag; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegArcAbs.prototype, "sweepFlag", { get: function() { return this._sweepFlag; }, set: function(sweepFlag) { this._sweepFlag = sweepFlag; this._segmentChanged(); }, enumerable: true });
window.SVGPathSegArcRel = function(owningPathSegList, x, y, r1, r2, angle, largeArcFlag, sweepFlag) {
window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_ARC_REL, "a", owningPathSegList);
this._x = x;
this._y = y;
this._r1 = r1;
this._r2 = r2;
this._angle = angle;
this._largeArcFlag = largeArcFlag;
this._sweepFlag = sweepFlag;
}
window.SVGPathSegArcRel.prototype = Object.create(window.SVGPathSeg.prototype);
window.SVGPathSegArcRel.prototype.toString = function() { return "[object SVGPathSegArcRel]"; }
window.SVGPathSegArcRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._r1 + " " + this._r2 + " " + this._angle + " " + (this._largeArcFlag ? "1" : "0") + " " + (this._sweepFlag ? "1" : "0") + " " + this._x + " " + this._y; }
window.SVGPathSegArcRel.prototype.clone = function() { return new window.SVGPathSegArcRel(undefined, this._x, this._y, this._r1, this._r2, this._angle, this._largeArcFlag, this._sweepFlag); }
Object.defineProperty(window.SVGPathSegArcRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegArcRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegArcRel.prototype, "r1", { get: function() { return this._r1; }, set: function(r1) { this._r1 = r1; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegArcRel.prototype, "r2", { get: function() { return this._r2; }, set: function(r2) { this._r2 = r2; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegArcRel.prototype, "angle", { get: function() { return this._angle; }, set: function(angle) { this._angle = angle; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegArcRel.prototype, "largeArcFlag", { get: function() { return this._largeArcFlag; }, set: function(largeArcFlag) { this._largeArcFlag = largeArcFlag; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegArcRel.prototype, "sweepFlag", { get: function() { return this._sweepFlag; }, set: function(sweepFlag) { this._sweepFlag = sweepFlag; this._segmentChanged(); }, enumerable: true });
window.SVGPathSegLinetoHorizontalAbs = function(owningPathSegList, x) {
window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS, "H", owningPathSegList);
this._x = x;
}
window.SVGPathSegLinetoHorizontalAbs.prototype = Object.create(window.SVGPathSeg.prototype);
window.SVGPathSegLinetoHorizontalAbs.prototype.toString = function() { return "[object SVGPathSegLinetoHorizontalAbs]"; }
window.SVGPathSegLinetoHorizontalAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x; }
window.SVGPathSegLinetoHorizontalAbs.prototype.clone = function() { return new window.SVGPathSegLinetoHorizontalAbs(undefined, this._x); }
Object.defineProperty(window.SVGPathSegLinetoHorizontalAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
window.SVGPathSegLinetoHorizontalRel = function(owningPathSegList, x) {
window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL, "h", owningPathSegList);
this._x = x;
}
window.SVGPathSegLinetoHorizontalRel.prototype = Object.create(window.SVGPathSeg.prototype);
window.SVGPathSegLinetoHorizontalRel.prototype.toString = function() { return "[object SVGPathSegLinetoHorizontalRel]"; }
window.SVGPathSegLinetoHorizontalRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x; }
window.SVGPathSegLinetoHorizontalRel.prototype.clone = function() { return new window.SVGPathSegLinetoHorizontalRel(undefined, this._x); }
Object.defineProperty(window.SVGPathSegLinetoHorizontalRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
window.SVGPathSegLinetoVerticalAbs = function(owningPathSegList, y) {
window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS, "V", owningPathSegList);
this._y = y;
}
window.SVGPathSegLinetoVerticalAbs.prototype = Object.create(window.SVGPathSeg.prototype);
window.SVGPathSegLinetoVerticalAbs.prototype.toString = function() { return "[object SVGPathSegLinetoVerticalAbs]"; }
window.SVGPathSegLinetoVerticalAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._y; }
window.SVGPathSegLinetoVerticalAbs.prototype.clone = function() { return new window.SVGPathSegLinetoVerticalAbs(undefined, this._y); }
Object.defineProperty(window.SVGPathSegLinetoVerticalAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
window.SVGPathSegLinetoVerticalRel = function(owningPathSegList, y) {
window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL, "v", owningPathSegList);
this._y = y;
}
window.SVGPathSegLinetoVerticalRel.prototype = Object.create(window.SVGPathSeg.prototype);
window.SVGPathSegLinetoVerticalRel.prototype.toString = function() { return "[object SVGPathSegLinetoVerticalRel]"; }
window.SVGPathSegLinetoVerticalRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._y; }
window.SVGPathSegLinetoVerticalRel.prototype.clone = function() { return new window.SVGPathSegLinetoVerticalRel(undefined, this._y); }
Object.defineProperty(window.SVGPathSegLinetoVerticalRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
window.SVGPathSegCurvetoCubicSmoothAbs = function(owningPathSegList, x, y, x2, y2) {
window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS, "S", owningPathSegList);
this._x = x;
this._y = y;
this._x2 = x2;
this._y2 = y2;
}
window.SVGPathSegCurvetoCubicSmoothAbs.prototype = Object.create(window.SVGPathSeg.prototype);
window.SVGPathSegCurvetoCubicSmoothAbs.prototype.toString = function() { return "[object SVGPathSegCurvetoCubicSmoothAbs]"; }
window.SVGPathSegCurvetoCubicSmoothAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x2 + " " + this._y2 + " " + this._x + " " + this._y; }
window.SVGPathSegCurvetoCubicSmoothAbs.prototype.clone = function() { return new window.SVGPathSegCurvetoCubicSmoothAbs(undefined, this._x, this._y, this._x2, this._y2); }
Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype, "x2", { get: function() { return this._x2; }, set: function(x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype, "y2", { get: function() { return this._y2; }, set: function(y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true });
window.SVGPathSegCurvetoCubicSmoothRel = function(owningPathSegList, x, y, x2, y2) {
window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL, "s", owningPathSegList);
this._x = x;
this._y = y;
this._x2 = x2;
this._y2 = y2;
}
window.SVGPathSegCurvetoCubicSmoothRel.prototype = Object.create(window.SVGPathSeg.prototype);
window.SVGPathSegCurvetoCubicSmoothRel.prototype.toString = function() { return "[object SVGPathSegCurvetoCubicSmoothRel]"; }
window.SVGPathSegCurvetoCubicSmoothRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x2 + " " + this._y2 + " " + this._x + " " + this._y; }
window.SVGPathSegCurvetoCubicSmoothRel.prototype.clone = function() { return new window.SVGPathSegCurvetoCubicSmoothRel(undefined, this._x, this._y, this._x2, this._y2); }
Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype, "x2", { get: function() { return this._x2; }, set: function(x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype, "y2", { get: function() { return this._y2; }, set: function(y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true });
window.SVGPathSegCurvetoQuadraticSmoothAbs = function(owningPathSegList, x, y) {
window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS, "T", owningPathSegList);
this._x = x;
this._y = y;
}
window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype = Object.create(window.SVGPathSeg.prototype);
window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype.toString = function() { return "[object SVGPathSegCurvetoQuadraticSmoothAbs]"; }
window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x + " " + this._y; }
window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype.clone = function() { return new window.SVGPathSegCurvetoQuadraticSmoothAbs(undefined, this._x, this._y); }
Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
window.SVGPathSegCurvetoQuadraticSmoothRel = function(owningPathSegList, x, y) {
window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL, "t", owningPathSegList);
this._x = x;
this._y = y;
}
window.SVGPathSegCurvetoQuadraticSmoothRel.prototype = Object.create(window.SVGPathSeg.prototype);
window.SVGPathSegCurvetoQuadraticSmoothRel.prototype.toString = function() { return "[object SVGPathSegCurvetoQuadraticSmoothRel]"; }
window.SVGPathSegCurvetoQuadraticSmoothRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x + " " + this._y; }
window.SVGPathSegCurvetoQuadraticSmoothRel.prototype.clone = function() { return new window.SVGPathSegCurvetoQuadraticSmoothRel(undefined, this._x, this._y); }
Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
// Add createSVGPathSeg* functions to window.SVGPathElement.
// Spec: http://www.w3.org/TR/SVG11/single-page.html#paths-Interfacewindow.SVGPathElement.
window.SVGPathElement.prototype.createSVGPathSegClosePath = function() { return new window.SVGPathSegClosePath(undefined); }
window.SVGPathElement.prototype.createSVGPathSegMovetoAbs = function(x, y) { return new window.SVGPathSegMovetoAbs(undefined, x, y); }
window.SVGPathElement.prototype.createSVGPathSegMovetoRel = function(x, y) { return new window.SVGPathSegMovetoRel(undefined, x, y); }
window.SVGPathElement.prototype.createSVGPathSegLinetoAbs = function(x, y) { return new window.SVGPathSegLinetoAbs(undefined, x, y); }
window.SVGPathElement.prototype.createSVGPathSegLinetoRel = function(x, y) { return new window.SVGPathSegLinetoRel(undefined, x, y); }
window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicAbs = function(x, y, x1, y1, x2, y2) { return new window.SVGPathSegCurvetoCubicAbs(undefined, x, y, x1, y1, x2, y2); }
window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicRel = function(x, y, x1, y1, x2, y2) { return new window.SVGPathSegCurvetoCubicRel(undefined, x, y, x1, y1, x2, y2); }
window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticAbs = function(x, y, x1, y1) { return new window.SVGPathSegCurvetoQuadraticAbs(undefined, x, y, x1, y1); }
window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticRel = function(x, y, x1, y1) { return new window.SVGPathSegCurvetoQuadraticRel(undefined, x, y, x1, y1); }
window.SVGPathElement.prototype.createSVGPathSegArcAbs = function(x, y, r1, r2, angle, largeArcFlag, sweepFlag) { return new window.SVGPathSegArcAbs(undefined, x, y, r1, r2, angle, largeArcFlag, sweepFlag); }
window.SVGPathElement.prototype.createSVGPathSegArcRel = function(x, y, r1, r2, angle, largeArcFlag, sweepFlag) { return new window.SVGPathSegArcRel(undefined, x, y, r1, r2, angle, largeArcFlag, sweepFlag); }
window.SVGPathElement.prototype.createSVGPathSegLinetoHorizontalAbs = function(x) { return new window.SVGPathSegLinetoHorizontalAbs(undefined, x); }
window.SVGPathElement.prototype.createSVGPathSegLinetoHorizontalRel = function(x) { return new window.SVGPathSegLinetoHorizontalRel(undefined, x); }
window.SVGPathElement.prototype.createSVGPathSegLinetoVerticalAbs = function(y) { return new window.SVGPathSegLinetoVerticalAbs(undefined, y); }
window.SVGPathElement.prototype.createSVGPathSegLinetoVerticalRel = function(y) { return new window.SVGPathSegLinetoVerticalRel(undefined, y); }
window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothAbs = function(x, y, x2, y2) { return new window.SVGPathSegCurvetoCubicSmoothAbs(undefined, x, y, x2, y2); }
window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothRel = function(x, y, x2, y2) { return new window.SVGPathSegCurvetoCubicSmoothRel(undefined, x, y, x2, y2); }
window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothAbs = function(x, y) { return new window.SVGPathSegCurvetoQuadraticSmoothAbs(undefined, x, y); }
window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothRel = function(x, y) { return new window.SVGPathSegCurvetoQuadraticSmoothRel(undefined, x, y); }
}
if (!("SVGPathSegList" in window)) {
// Spec: http://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathSegList
window.SVGPathSegList = function(pathElement) {
this._pathElement = pathElement;
this._list = this._parsePath(this._pathElement.getAttribute("d"));
// Use a MutationObserver to catch changes to the path's "d" attribute.
this._mutationObserverConfig = { "attributes": true, "attributeFilter": ["d"] };
this._pathElementMutationObserver = new MutationObserver(this._updateListFromPathMutations.bind(this));
this._pathElementMutationObserver.observe(this._pathElement, this._mutationObserverConfig);
}
window.SVGPathSegList.prototype.classname = "SVGPathSegList";
Object.defineProperty(window.SVGPathSegList.prototype, "numberOfItems", {
get: function() {
this._checkPathSynchronizedToList();
return this._list.length;
},
enumerable: true
});
// Add the pathSegList accessors to window.SVGPathElement.
// Spec: http://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGAnimatedPathData
Object.defineProperty(window.SVGPathElement.prototype, "pathSegList", {
get: function() {
if (!this._pathSegList)
this._pathSegList = new window.SVGPathSegList(this);
return this._pathSegList;
},
enumerable: true
});
// FIXME: The following are not implemented and simply return window.SVGPathElement.pathSegList.
Object.defineProperty(window.SVGPathElement.prototype, "normalizedPathSegList", { get: function() { return this.pathSegList; }, enumerable: true });
Object.defineProperty(window.SVGPathElement.prototype, "animatedPathSegList", { get: function() { return this.pathSegList; }, enumerable: true });
Object.defineProperty(window.SVGPathElement.prototype, "animatedNormalizedPathSegList", { get: function() { return this.pathSegList; }, enumerable: true });
// Process any pending mutations to the path element and update the list as needed.
// This should be the first call of all public functions and is needed because
// MutationObservers are not synchronous so we can have pending asynchronous mutations.
window.SVGPathSegList.prototype._checkPathSynchronizedToList = function() {
this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords());
}
window.SVGPathSegList.prototype._updateListFromPathMutations = function(mutationRecords) {
if (!this._pathElement)
return;
var hasPathMutations = false;
mutationRecords.forEach(function(record) {
if (record.attributeName == "d")
hasPathMutations = true;
});
if (hasPathMutations)
this._list = this._parsePath(this._pathElement.getAttribute("d"));
}
// Serialize the list and update the path's 'd' attribute.
window.SVGPathSegList.prototype._writeListToPath = function() {
this._pathElementMutationObserver.disconnect();
this._pathElement.setAttribute("d", window.SVGPathSegList._pathSegArrayAsString(this._list));
this._pathElementMutationObserver.observe(this._pathElement, this._mutationObserverConfig);
}
// When a path segment changes the list needs to be synchronized back to the path element.
window.SVGPathSegList.prototype.segmentChanged = function(pathSeg) {
this._writeListToPath();
}
window.SVGPathSegList.prototype.clear = function() {
this._checkPathSynchronizedToList();
this._list.forEach(function(pathSeg) {
pathSeg._owningPathSegList = null;
});
this._list = [];
this._writeListToPath();
}
window.SVGPathSegList.prototype.initialize = function(newItem) {
this._checkPathSynchronizedToList();
this._list = [newItem];
newItem._owningPathSegList = this;
this._writeListToPath();
return newItem;
}
window.SVGPathSegList.prototype._checkValidIndex = function(index) {
if (isNaN(index) || index < 0 || index >= this.numberOfItems)
throw "INDEX_SIZE_ERR";
}
window.SVGPathSegList.prototype.getItem = function(index) {
this._checkPathSynchronizedToList();
this._checkValidIndex(index);
return this._list[index];
}
window.SVGPathSegList.prototype.insertItemBefore = function(newItem, index) {
this._checkPathSynchronizedToList();
// Spec: If the index is greater than or equal to numberOfItems, then the new item is appended to the end of the list.
if (index > this.numberOfItems)
index = this.numberOfItems;
if (newItem._owningPathSegList) {
// SVG2 spec says to make a copy.
newItem = newItem.clone();
}
this._list.splice(index, 0, newItem);
newItem._owningPathSegList = this;
this._writeListToPath();
return newItem;
}
window.SVGPathSegList.prototype.replaceItem = function(newItem, index) {
this._checkPathSynchronizedToList();
if (newItem._owningPathSegList) {
// SVG2 spec says to make a copy.
newItem = newItem.clone();
}
this._checkValidIndex(index);
this._list[index] = newItem;
newItem._owningPathSegList = this;
this._writeListToPath();
return newItem;
}
window.SVGPathSegList.prototype.removeItem = function(index) {
this._checkPathSynchronizedToList();
this._checkValidIndex(index);
var item = this._list[index];
this._list.splice(index, 1);
this._writeListToPath();
return item;
}
window.SVGPathSegList.prototype.appendItem = function(newItem) {
this._checkPathSynchronizedToList();
if (newItem._owningPathSegList) {
// SVG2 spec says to make a copy.
newItem = newItem.clone();
}
this._list.push(newItem);
newItem._owningPathSegList = this;
// TODO: Optimize this to just append to the existing attribute.
this._writeListToPath();
return newItem;
}
window.SVGPathSegList._pathSegArrayAsString = function(pathSegArray) {
var string = "";
var first = true;
pathSegArray.forEach(function(pathSeg) {
if (first) {
first = false;
string += pathSeg._asPathString();
} else {
string += " " + pathSeg._asPathString();
}
});
return string;
}
// This closely follows SVGPathParser::parsePath from Source/core/svg/SVGPathParser.cpp.
window.SVGPathSegList.prototype._parsePath = function(string) {
if (!string || string.length == 0)
return [];
var owningPathSegList = this;
var Builder = function() {
this.pathSegList = [];
}
Builder.prototype.appendSegment = function(pathSeg) {
this.pathSegList.push(pathSeg);
}
var Source = function(string) {
this._string = string;
this._currentIndex = 0;
this._endIndex = this._string.length;
this._previousCommand = window.SVGPathSeg.PATHSEG_UNKNOWN;
this._skipOptionalSpaces();
}
Source.prototype._isCurrentSpace = function() {
var character = this._string[this._currentIndex];
return character <= " " && (character == " " || character == "\n" || character == "\t" || character == "\r" || character == "\f");
}
Source.prototype._skipOptionalSpaces = function() {
while (this._currentIndex < this._endIndex && this._isCurrentSpace())
this._currentIndex++;
return this._currentIndex < this._endIndex;
}
Source.prototype._skipOptionalSpacesOrDelimiter = function() {
if (this._currentIndex < this._endIndex && !this._isCurrentSpace() && this._string.charAt(this._currentIndex) != ",")
return false;
if (this._skipOptionalSpaces()) {
if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) == ",") {
this._currentIndex++;
this._skipOptionalSpaces();
}
}
return this._currentIndex < this._endIndex;
}
Source.prototype.hasMoreData = function() {
return this._currentIndex < this._endIndex;
}
Source.prototype.peekSegmentType = function() {
var lookahead = this._string[this._currentIndex];
return this._pathSegTypeFromChar(lookahead);
}
Source.prototype._pathSegTypeFromChar = function(lookahead) {
switch (lookahead) {
case "Z":
case "z":
return window.SVGPathSeg.PATHSEG_CLOSEPATH;
case "M":
return window.SVGPathSeg.PATHSEG_MOVETO_ABS;
case "m":
return window.SVGPathSeg.PATHSEG_MOVETO_REL;
case "L":
return window.SVGPathSeg.PATHSEG_LINETO_ABS;
case "l":
return window.SVGPathSeg.PATHSEG_LINETO_REL;
case "C":
return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS;
case "c":
return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL;
case "Q":
return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS;
case "q":
return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL;
case "A":
return window.SVGPathSeg.PATHSEG_ARC_ABS;
case "a":
return window.SVGPathSeg.PATHSEG_ARC_REL;
case "H":
return window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS;
case "h":
return window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL;
case "V":
return window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS;
case "v":
return window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL;
case "S":
return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS;
case "s":
return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL;
case "T":
return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS;
case "t":
return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL;
default:
return window.SVGPathSeg.PATHSEG_UNKNOWN;
}
}
Source.prototype._nextCommandHelper = function(lookahead, previousCommand) {
// Check for remaining coordinates in the current command.
if ((lookahead == "+" || lookahead == "-" || lookahead == "." || (lookahead >= "0" && lookahead <= "9")) && previousCommand != window.SVGPathSeg.PATHSEG_CLOSEPATH) {
if (previousCommand == window.SVGPathSeg.PATHSEG_MOVETO_ABS)
return window.SVGPathSeg.PATHSEG_LINETO_ABS;
if (previousCommand == window.SVGPathSeg.PATHSEG_MOVETO_REL)
return window.SVGPathSeg.PATHSEG_LINETO_REL;
return previousCommand;
}
return window.SVGPathSeg.PATHSEG_UNKNOWN;
}
Source.prototype.initialCommandIsMoveTo = function() {
// If the path is empty it is still valid, so return true.
if (!this.hasMoreData())
return true;
var command = this.peekSegmentType();
// Path must start with moveTo.
return command == window.SVGPathSeg.PATHSEG_MOVETO_ABS || command == window.SVGPathSeg.PATHSEG_MOVETO_REL;
}
// Parse a number from an SVG path. This very closely follows genericParseNumber(...) from Source/core/svg/SVGParserUtilities.cpp.
// Spec: http://www.w3.org/TR/SVG11/single-page.html#paths-PathDataBNF
Source.prototype._parseNumber = function() {
var exponent = 0;
var integer = 0;
var frac = 1;
var decimal = 0;
var sign = 1;
var expsign = 1;
var startIndex = this._currentIndex;
this._skipOptionalSpaces();
// Read the sign.
if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) == "+")
this._currentIndex++;
else if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) == "-") {
this._currentIndex++;
sign = -1;
}
if (this._currentIndex == this._endIndex || ((this._string.charAt(this._currentIndex) < "0" || this._string.charAt(this._currentIndex) > "9") && this._string.charAt(this._currentIndex) != "."))
// The first character of a number must be one of [0-9+-.].
return undefined;
// Read the integer part, build right-to-left.
var startIntPartIndex = this._currentIndex;
while (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) >= "0" && this._string.charAt(this._currentIndex) <= "9")
this._currentIndex++; // Advance to first non-digit.
if (this._currentIndex != startIntPartIndex) {
var scanIntPartIndex = this._currentIndex - 1;
var multiplier = 1;
while (scanIntPartIndex >= startIntPartIndex) {
integer += multiplier * (this._string.charAt(scanIntPartIndex--) - "0");
multiplier *= 10;
}
}
// Read the decimals.
if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) == ".") {
this._currentIndex++;
// There must be a least one digit following the .
if (this._currentIndex >= this._endIndex || this._string.charAt(this._currentIndex) < "0" || this._string.charAt(this._currentIndex) > "9")
return undefined;
while (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) >= "0" && this._string.charAt(this._currentIndex) <= "9") {
frac *= 10;
decimal += (this._string.charAt(this._currentIndex) - "0") / frac;
this._currentIndex += 1;
}
}
// Read the exponent part.
if (this._currentIndex != startIndex && this._currentIndex + 1 < this._endIndex && (this._string.charAt(this._currentIndex) == "e" || this._string.charAt(this._currentIndex) == "E") && (this._string.charAt(this._currentIndex + 1) != "x" && this._string.charAt(this._currentIndex + 1) != "m")) {
this._currentIndex++;
// Read the sign of the exponent.
if (this._string.charAt(this._currentIndex) == "+") {
this._currentIndex++;
} else if (this._string.charAt(this._currentIndex) == "-") {
this._currentIndex++;
expsign = -1;
}
// There must be an exponent.
if (this._currentIndex >= this._endIndex || this._string.charAt(this._currentIndex) < "0" || this._string.charAt(this._currentIndex) > "9")
return undefined;
while (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) >= "0" && this._string.charAt(this._currentIndex) <= "9") {
exponent *= 10;
exponent += (this._string.charAt(this._currentIndex) - "0");
this._currentIndex++;
}
}
var number = integer + decimal;
number *= sign;
if (exponent)
number *= Math.pow(10, expsign * exponent);
if (startIndex == this._currentIndex)
return undefined;
this._skipOptionalSpacesOrDelimiter();
return number;
}
Source.prototype._parseArcFlag = function() {
if (this._currentIndex >= this._endIndex)
return undefined;
var flag = false;
var flagChar = this._string.charAt(this._currentIndex++);
if (flagChar == "0")
flag = false;
else if (flagChar == "1")
flag = true;
else
return undefined;
this._skipOptionalSpacesOrDelimiter();
return flag;
}
Source.prototype.parseSegment = function() {
var lookahead = this._string[this._currentIndex];
var command = this._pathSegTypeFromChar(lookahead);
if (command == window.SVGPathSeg.PATHSEG_UNKNOWN) {
// Possibly an implicit command. Not allowed if this is the first command.
if (this._previousCommand == window.SVGPathSeg.PATHSEG_UNKNOWN)
return null;
command = this._nextCommandHelper(lookahead, this._previousCommand);
if (command == window.SVGPathSeg.PATHSEG_UNKNOWN)
return null;
} else {
this._currentIndex++;
}
this._previousCommand = command;
switch (command) {
case window.SVGPathSeg.PATHSEG_MOVETO_REL:
return new window.SVGPathSegMovetoRel(owningPathSegList, this._parseNumber(), this._parseNumber());
case window.SVGPathSeg.PATHSEG_MOVETO_ABS:
return new window.SVGPathSegMovetoAbs(owningPathSegList, this._parseNumber(), this._parseNumber());
case window.SVGPathSeg.PATHSEG_LINETO_REL:
return new window.SVGPathSegLinetoRel(owningPathSegList, this._parseNumber(), this._parseNumber());
case window.SVGPathSeg.PATHSEG_LINETO_ABS:
return new window.SVGPathSegLinetoAbs(owningPathSegList, this._parseNumber(), this._parseNumber());
case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:
return new window.SVGPathSegLinetoHorizontalRel(owningPathSegList, this._parseNumber());
case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:
return new window.SVGPathSegLinetoHorizontalAbs(owningPathSegList, this._parseNumber());
case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:
return new window.SVGPathSegLinetoVerticalRel(owningPathSegList, this._parseNumber());
case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:
return new window.SVGPathSegLinetoVerticalAbs(owningPathSegList, this._parseNumber());
case window.SVGPathSeg.PATHSEG_CLOSEPATH:
this._skipOptionalSpaces();
return new window.SVGPathSegClosePath(owningPathSegList);
case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL:
var points = {x1: this._parseNumber(), y1: this._parseNumber(), x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()};
return new window.SVGPathSegCurvetoCubicRel(owningPathSegList, points.x, points.y, points.x1, points.y1, points.x2, points.y2);
case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS:
var points = {x1: this._parseNumber(), y1: this._parseNumber(), x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()};
return new window.SVGPathSegCurvetoCubicAbs(owningPathSegList, points.x, points.y, points.x1, points.y1, points.x2, points.y2);
case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:
var points = {x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()};
return new window.SVGPathSegCurvetoCubicSmoothRel(owningPathSegList, points.x, points.y, points.x2, points.y2);
case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:
var points = {x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()};
return new window.SVGPathSegCurvetoCubicSmoothAbs(owningPathSegList, points.x, points.y, points.x2, points.y2);
case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:
var points = {x1: this._parseNumber(), y1: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()};
return new window.SVGPathSegCurvetoQuadraticRel(owningPathSegList, points.x, points.y, points.x1, points.y1);
case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS:
var points = {x1: this._parseNumber(), y1: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()};
return new window.SVGPathSegCurvetoQuadraticAbs(owningPathSegList, points.x, points.y, points.x1, points.y1);
case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:
return new window.SVGPathSegCurvetoQuadraticSmoothRel(owningPathSegList, this._parseNumber(), this._parseNumber());
case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:
return new window.SVGPathSegCurvetoQuadraticSmoothAbs(owningPathSegList, this._parseNumber(), this._parseNumber());
case window.SVGPathSeg.PATHSEG_ARC_REL:
var points = {x1: this._parseNumber(), y1: this._parseNumber(), arcAngle: this._parseNumber(), arcLarge: this._parseArcFlag(), arcSweep: this._parseArcFlag(), x: this._parseNumber(), y: this._parseNumber()};
return new window.SVGPathSegArcRel(owningPathSegList, points.x, points.y, points.x1, points.y1, points.arcAngle, points.arcLarge, points.arcSweep);
case window.SVGPathSeg.PATHSEG_ARC_ABS:
var points = {x1: this._parseNumber(), y1: this._parseNumber(), arcAngle: this._parseNumber(), arcLarge: this._parseArcFlag(), arcSweep: this._parseArcFlag(), x: this._parseNumber(), y: this._parseNumber()};
return new window.SVGPathSegArcAbs(owningPathSegList, points.x, points.y, points.x1, points.y1, points.arcAngle, points.arcLarge, points.arcSweep);
default:
throw "Unknown path seg type."
}
}
var builder = new Builder();
var source = new Source(string);
if (!source.initialCommandIsMoveTo())
return [];
while (source.hasMoreData()) {
var pathSeg = source.parseSegment();
if (!pathSeg)
return [];
builder.appendSegment(pathSeg);
}
return builder.pathSegList;
}
}
}());
//The MIT License (MIT)
//
//Copyright (c) 2015 Satoshi Fujiwara
//
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:
//
//The above copyright notice and this permission notice shall be included in
//all copies or substantial portions of the Software.
//
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//THE SOFTWARE.
/// <reference path="http://cdnjs.cloudflare.com/ajax/libs/d3/3.5.2/d3.js" />
/// <reference path="http://cdnjs.cloudflare.com/ajax/libs/three.js/r70/three.js" />
/// <reference path="..\intellisense\q.intellisense.js" />
"use strict";
// Node.js で動作しているか
(function () {
var isNode = (typeof process !== "undefined" && typeof require !== "undefined");
// ブラウザ上(非Node.js)で動作しているか
var isBrowser = !isNode
// node-webkitで動作しているか
var isNodeWebkit;
try {
isNodeWebkit = isNode ? (typeof require('nw.gui') !== "undefined") : false;
} catch (e) {
isNodeWebkit = false;
}
if ((isBrowser || isNodeWebkit) && !window['SF']) {
window.SF = {};
}
// http://blog.livedoor.jp/dankogai/archives/51756459.html より
var getFunctionName = function(f){
return 'name' in f
? f.name
: (''+f).replace(/^\s*function\s*([^\(]*)[\S\s]+$/im, '$1');
};
var typeOf = function(that){
if (that === null) return 'Null';
if (that === undefined) return 'Undefined';
var tc = that.constructor;
return typeof(tc) === 'function'
? getFunctionName(tc)
: tc /* [object HTMLDocumentConstructor] など */;
};
function SerializationData(data,objInfo){
this.meta = {type : objInfo.name};
if(objInfo.transform){
this.data = objInfo.transform(data);
} else {
this.data = {};
for (var i in data) {
if (typeof data[i] !== 'function') {
this.data[i] = data[i].toJSON ? data[i].toJSON() : data[i];
}
}
}
}
function makeFactory(constructor)
{
return function(json){
return new (constructor.bind.apply(constructor,json.data));
}
}
function makeFactory2(constructor){
return function(json){
var d = json.data;
var params = objArrays[json.meta.type].factory(d);
var c = THREE[constructor].bind.apply(THREE[constructor],params);
return new c();
}
}
function makeParamArray(arr){
return function(obj){
return arr.map(function(d){
return obj[d];
});
}
}
function toJSON(data,objInfo){
return new SerializationData(data,objInfo);
}
function mapArray(array){
if(array.meta){
return array.data.map(function(d){
return objArrays[array.meta.type].factory(d);
});
} else {
return array.map(function(d){
if(d.meta){
return objArrays[d.meta.type].factory(d.data);
} else {
return d;
}
});
}
}
// 対象オブジェクトのプロトタイプにtoJSONメソッドを定義する
THREE.Array = function SFArray (name,array){
this.meta = {type:name};
this.data = array.map(function(d){
return objArrays[name].transform(d) || d;
});
};
// オブジェクト保存・生成クラス
function ObjectInfo(objName,param){
this.name = objName;
if(param instanceof Array){
this.toJSON = toJSON;
this.transform = makeParamArray(param);
this.factory = makeFactory(THREE[objName]);
} else {
this.toJSON = param.toJSON || toJSON;
if(param.transform){
if(param.transform instanceof Array){
this.transform = makeParamArray(param.transform);
} else {
this.transform = param.transform;
}
}
if('factory' in param){
if(param.factory instanceof THREE[objName]){
this.factory = makeFactory(param.factory);
} else {
this.factory = param.factory;
}
} else {
this.factory = makeFactory(THREE[objName]);
}
}
}
// オブジェクト保存・生成情報配列
var objArrays2 = [
['Array',{factory:mapArray}],
['Vector2',['x','y']],
['Vector3',['x','y','z']],
['EllipseCurve',['aX','aY','xRadius','yRadius','aStartAngle','aEndAngle','aClockwise']],
['ArcCurve',['aX', 'aY', 'xRadius', 'aStartAngle', 'aEndAngle', 'aClockwise']],
['ClosedSplineCurve3',
{
factory:function (json) {
var d = json.data;
if(d){
var points = objArrays[d.meta.type].factory(d.data);
return new THREE.ClosedSplineCurve3(points);
}
return new THREE.ClosedSplineCurve3();
},
transform: function(d){
if(d.points){
return new THREE.Array('Vector3',points);
} else {
return null;
}
}
}],
['CubicBezierCurve',{factory: makeFactory2('CubicBezierCurve'),transform:function (o){
return new THREE.Array('Vector2',[o.v0,o.v1,o.v2,o.v3]);
}
}
],
['CubicBezierCurve3',{
factory: makeFactory2('CubicBezierCurve3'),
transform:function(o){
return new THREE.Array('Vector3',[o.v0,o.v1,o.v2,o.v3]);
}
}
],
['LineCurve',{
factory: makeFactory2('LineCurve'),
transform:function(o){
return new THREE.Array('Vector2',[o.v1,o.v2]);
}
}],
['LineCurve3',{
factory: makeFactory2('LineCurve3'),
transform:function(o){
return new THREE.Array('Vector3',[o.v1,o.v2]);
}
}],
['QuadraticBezierCurve',{
factory: makeFactory2('QuadraticBezierCurve'),
transform:function(o){
return new THREE.Array('Vector2',[o.v0,o.v1,o.v2]);
}
}],
['QuadraticBezierCurve3',{
factory: makeFactory2('QuadraticBezierCurve3'),
transform:function(o){
return new THREE.Array('Vector3',[o.v0,o.v1,o.v2]);
}
}],
['SplineCurve',
{
factory:function (json) {
var d = json.data;
if(d){
var points = objArrays[d.meta.type].factory(d.data);
return new THREE.SplineCurve(points);
}
return new THREE.SplineCurve();
},
transform: function(d){
if(d.points){
return new THREE.Array('Vector2',points);
} else {
return null;
}
}
}],
['SplineCurve3',
{
factory:function (json) {
var d = json.data;
if(d){
var points = objArrays[d.meta.type].factory(d.data);
return new THREE.SplineCurve3(points);
}
return new THREE.SplineCurve3();
},
transform: function(d){
if(d.points){
return new THREE.Array('Vector3',points);
} else {
return null;
}
}
}],
['CurvePath',
{
factory:function (json) {
var d = json.data;
var o = json.data;
var instance = new THREE.CurvePath();
if('curves' in o){
var curves = mapArray(o.curves);
instance.curves = curves;
}
if('bends' in o){
var bends = mapArray(o.bends);
instance.bends = bends;
}
instance.autoClose = o.autoClose;
return instance;
}
}],
['Path',
{
factory:function (json) {
var o = json.data;
var instance = new THREE.Path();
if('curves' in o){
instance.curves = mapArray(o.curves);
}
if('bends' in o){
instance.bends = mapArray(o.bends);
}
if('actions' in o){
instance.actions = mapArray(o.actions);
}
instance.autoClose = o.autoClose;
return instance;
}
}]
];
var objArrays = {};
objArrays2.forEach(function(d){
console.log(d);
objArrays[d[0]] = new ObjectInfo(d[0],d[1]);
});
for (var name in objArrays) {
(function () {
var name_ = name;
var objInfo = objArrays[name_];
var toJSON = objInfo.hasOwnProperty('toJSON') ? objInfo.toJSON : toJSONBase;
THREE[name_].prototype.toJSON = function () {
return toJSON(this, objInfo);
};
})();
};
function toJSONBase(obj, objInfo) {
var json = {
"meta": {
"type": objInfo.name,
},
"data": {}
};
for (var i in obj) {
if (typeof obj[i] !== 'function') {
json.data[i] = obj[i].toJSON ? obj[i].toJSON() : obj[i];
}
}
return json;
}
// Arrayを効率よくJSONデータ化
function arrayToJSON(array,objInfo){
if(this.length > 0){
var json = {
"meta": {
"type": name,
},
"data": array.map(function(d){
return ('toJSON' in d ) ? d.toJSON() : d;
})
}
return json;
} else {
return this;
}
}
SF.serialize = function(obj){
var ret = JSON.stringify(obj);
return ret;
}
SF.deserialize = function (json) {
if (objArrays[json.meta.type]) {
return objArrays[json.meta.type].factory(json);
}
}
})();
// (function test () {
// // EllipseCurve
// var tobj = new THREE.EllipseCurve(1, 2, 3, 4, 5, 6, 7);
// console.log(tobj);
// var jsonData = JSON.stringify(tobj);
// console.log(jsonData);
// var tobj2 = SF.deserialize(JSON.parse(jsonData));
// console.log(tobj2);
// // ArcCurve
// tobj = new THREE.ArcCurve(1, 2, 3, 4, 5, 6);
// console.log(tobj);
// jsonData = JSON.stringify(tobj);
// console.log(jsonData);
// tobj2 = SF.deserialize(JSON.parse(jsonData));
// console.log(tobj2);
// // CubicBezierCurve
// tobj = new THREE.CubicBezierCurve(new THREE.Vector2(0, 0), new THREE.Vector2(1, 1), new THREE.Vector2(2, 2), new THREE.Vector2(3, 3));
// console.log(tobj);
// jsonData = JSON.stringify(tobj);
// console.log(jsonData);
// tobj2 = SF.deserialize(JSON.parse(jsonData));
// console.log(tobj2);
// // CubicBezierCurve3
// tobj = new THREE.CubicBezierCurve(new THREE.Vector3(0, 0, 0), new THREE.Vector3(1, 1, 1), new THREE.Vector3(2, 2, 2), new THREE.Vector3(3, 3, 3));
// console.log(tobj);
// jsonData = JSON.stringify(tobj);
// console.log(jsonData);
// tobj2 = SF.deserialize(JSON.parse(jsonData));
// console.log(tobj2);
// // LineCurve
// tobj = new THREE.LineCurve(new THREE.Vector2(0, 0), new THREE.Vector2(1, 1));
// console.log(tobj);
// jsonData = JSON.stringify(tobj);
// console.log(jsonData);
// tobj2 = SF.deserialize(JSON.parse(jsonData));
// console.log(tobj2);
// // LineCurve
// tobj = new THREE.LineCurve3(new THREE.Vector3(0, 0), new THREE.Vector3(1, 1));
// console.log(tobj);
// jsonData = JSON.stringify(tobj);
// console.log(jsonData);
// tobj2 = SF.deserialize(JSON.parse(jsonData));
// console.log(tobj2);
// // QuadraticBezierCurve
// tobj = new THREE.QuadraticBezierCurve(new THREE.Vector2(0, 0), new THREE.Vector2(1, 1),new THREE.Vector2(2,2));
// console.log(tobj);
// jsonData = JSON.stringify(tobj);
// console.log(jsonData);
// tobj2 = SF.deserialize(JSON.parse(jsonData));
// console.log(tobj2);
// // QuadraticBezierCurve3
// THREE.QuadraticBezierCurve3.prototype.constructor = THREE.QuadraticBezierCurve3;
// var tobj = new THREE.Vector3(0, 0, 0);//;new THREE.QuadraticBezierCurve3(new THREE.Vector3(0, 0,0), new THREE.Vector3(1, 1,1),new THREE.Vector3(2,2,2));
// console.log(tobj.__proto__.constructor);
// var jsonData = JSON.stringify(tobj);
// console.log(jsonData);
// var tobj2 = SF.deserialize(JSON.parse(jsonData));
// console.log(tobj2);
// })();
//The MIT License (MIT)
//
//Copyright (c) 2015 Satoshi Fujiwara
//
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:
//
//The above copyright notice and this permission notice shall be included in
//all copies or substantial portions of the Software.
//
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//THE SOFTWARE.
/// <reference path="http://cdnjs.cloudflare.com/ajax/libs/d3/3.5.2/d3.js" />
/// <reference path="http://cdnjs.cloudflare.com/ajax/libs/three.js/r70/three.js" />
/// <reference path="..\intellisense\q.intellisense.js" />
/// <reference path="pathSerializer.js" />
//(function(){
// var fs = require('fs');
// try {
// fs.mkdirSync('./temp');
// } catch(e){
// if(e.code != "EEXIST"){
// throw e;
// }
// }
//})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment