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

Terminals in Wire Mesh #963

Closed
twodee opened this Issue Oct 21, 2018 · 4 comments

Comments

Projects
None yet
3 participants
@twodee
Copy link

twodee commented Oct 21, 2018

The new wire mesh feature is great. I've been looking at implementing this for a long time, and then I saw Alec's blog post about it. Thank you!

My understanding of the algorithm is that the regular polygons must be pushed away from the endpoints a bit to ensure a reasonable surface. This offset works well for generating wire meshes of solid models.

For networks that have a lot of terminal endpoints, this offset isn't so agreeable. We end up with lots of pointy spears. See https://twodee.org/forothers/pointed.png.

Would it be possible to eliminate this offset when a vertex is connected to the network by only one edge? So that the endcaps are flat? If there's interest but not time, I'm happy to look into implementing it myself and submitting a pull request.

@jdumas

This comment has been minimized.

Copy link
Collaborator

jdumas commented Oct 21, 2018

A quick workaround would be to place spheres at the endpoints, and use libigl's boolean to "resolve" the self-intersections (this is already what the code is doing if you pass the option solid = true). I personnaly don't really use this feature so I can't comment on usability.

@jdumas jdumas added the enhancement label Oct 21, 2018

@alecjacobson

This comment has been minimized.

Copy link
Contributor

alecjacobson commented Oct 21, 2018

@twodee could you describe what you'd like? Flat tops? round tops?

unioning spheres would work but would be quite messy compared to the wire meshes we currently make. If you want round caps it might be better to come up with a procedurally way so it perfectly matches the existing vertex from the edge-parts.

@twodee

This comment has been minimized.

Copy link
Author

twodee commented Oct 22, 2018

Flat endcaps would be my preference and probably the simplest to implement. I think it's just a matter of setting dist to 0 in wire_mesh.cpp, but I'm not so certain about how to check that a vertex is only incident on one edge.

@alecjacobson

This comment has been minimized.

Copy link
Contributor

alecjacobson commented Oct 22, 2018

yeah, that would do it. To find the vertices with only a single edge, I'd create an array of length #Vertices, initialize it to zero and then iterate over all of the edges, incrementing the counter of each vertex that is touched.

@twodee twodee referenced this issue Nov 7, 2018

Merged

Flatten wiremesh caps when vertex on single edge. #999

1 of 5 tasks complete

@jdumas jdumas closed this Feb 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.