Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

holes in the mesh #6

Open
morandd opened this issue Jun 6, 2017 · 0 comments
Open

holes in the mesh #6

morandd opened this issue Jun 6, 2017 · 0 comments

Comments

@morandd
Copy link

morandd commented Jun 6, 2017

The AFrame plugin
https://github.com/7dir/aframe-svgfile-component/
uses this svg-mesh-3d library to get SVG into Three.js geometry.

I encountered the problem that overlapping paths creates holes in the mesh.

overlaptest.svg.txt
hole

The AFrame plugin is a bit rough because it simple extracts all the "d=" attributes from the SVG and aggreagtes them together into one long string, which it passes to svg-mesh-3d. So this includes plenty of M and Z commands. I suspect it's these M and Z commands that are confusing svg-mesh-3d.

I changed the AFrame plugin to treat each svg separately, passing them one at a time to svg-mesh-3d and getting a mesh back, then creating one Three.js Object3d for each . This works perfectly.

So I think there's a bug in how svg-mesh-3d handles complex "d" strings with M and Z's.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant