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

WIP: Triangle Fans #644

Merged
merged 1 commit into from Aug 7, 2020
Merged

WIP: Triangle Fans #644

merged 1 commit into from Aug 7, 2020

Conversation

phkahler
Copy link
Member

@phkahler phkahler commented Jul 8, 2020

This is still experimental. I noticed that ear triangulation calls RemoveTagged() for every ear and that function scans (copies?) the entire list of verticies. It also has to check IsEar() for the adjacent verticies afterward. I figured we can make a pass looking for chains of ears that form a sort of meta-ear and triangulate that independently, and only make one call to RemoveTagged() to dispose all those ears. This runs prior to the existing triangulation code (and only for flat surfaces) so it might be faster overall for very complex surfaces. It does tend to make better-formed triangles.

Still some bugs and odd cases to figure out.
The logic is not clear yet.
Haven't proven any practical benefit like speed improvement.

One odd thing I did notice. If you look at the mesh for a circle it can look less round when showing the triangles. It's not, but your eyes can trick you due to the structured lines.

@phkahler
Copy link
Member Author

phkahler commented Jul 8, 2020

Tri-fans

@phkahler phkahler force-pushed the triangle-fans branch 2 times, most recently from 316b8c3 to 2a2d092 Compare July 19, 2020 02:06
@phkahler
Copy link
Member Author

It's working a lot better. On one model this actually reduces the number of naked edges. Maybe chance, or maybe because the triangles are of better shape?
Also removed a redundant pass over all the verticies. That was an n^2 but not the only one so not an O(n) reduction. I left that as a separate commit but it would conflict with the first one so added to this PR.
triangle_fans

@phkahler
Copy link
Member Author

@ruevs can you try this out? It's very subjective weather this one should go in or not.

@ruevs
Copy link
Member

ruevs commented Jul 23, 2020

I'll try but probably next week.

…angles will have smaller bounding boxes and look better.
@phkahler phkahler merged commit 575ddb5 into solvespace:master Aug 7, 2020
@phkahler phkahler deleted the triangle-fans branch August 13, 2020 23:21
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

Successfully merging this pull request may close these issues.

None yet

2 participants