mattdesl / svg-mesh-3d

:rocket: converts a SVG path to a 3D mesh
http://mattdesl.github.io/svg-mesh-3d/
MIT License
1.2k stars 92 forks source link

problem with SVG without closed paths #5

Open karims opened 7 years ago

karims commented 7 years ago

I am trying to render the following SVG, which does not have closed paths. But, the result I am getting is very different. Can you help me out, please?

My svg: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 180.97 289.14"><defs><style>.cls-1,.cls-2,.cls-3,.cls-4{fill:none;stroke:#010101;}.cls-1,.cls-2,.cls-3{stroke-linejoin:round;}.cls-2{stroke-width:0.5px;stroke-dasharray:1.98 0.99;}.cls-3{stroke-width:0.75px;}</style></defs><title>ALine Mini</title><g id="Layer_2" data-name="Layer 2"><g id="Layer_1-2" data-name="Layer 1"><path class="cls-1" d="M149.83,12.14S139,66.77,155.41,82.79"/><line class="cls-1" x1="118.18" y1="0.47" x2="150.26" y2="12.3"/><path class="cls-1" d="M31.14,12.14S42,66.77,25.56,82.79"/><line class="cls-1" x1="62.79" y1="0.47" x2="30.71" y2="12.3"/><path class="cls-2" d="M147.34,11.34c-1.83,10.83-10.33,60.33,7.83,74.5"/><path class="cls-2" d="M33.67,11.18c2.5,14.5,9.33,60.67-7.5,74.08"/><line class="cls-3" x1="118.01" y1="3.86" x2="148.83" y2="15.14"/><line class="cls-3" x1="62.96" y1="3.86" x2="32.14" y2="15.14"/><path class="cls-4" d="M155.35,82.42C153.4,95.5,146,118,146,145.17c0,9.59,3.88,22,7.18,35.57C159.92,208.42,180.48,289,180.48,289"/><path class="cls-4" d="M.48,289s20.44-80.6,27.3-108.28c3.36-13.54,7.15-26,7.17-35.57C35,118,27.57,95.5,25.62,82.42"/><path class="cls-3" d="M27.17,181.3a409.82,409.82,0,0,0,63.5,5,389,389,0,0,0,62.53-5"/></g></g></svg>

My result attached-

screen shot 2017-03-02 at 6 19 30 am
morandd commented 7 years ago

lines are not supported, it seems. It treats all paths as polygon boundaries.