8000 Optimize triangulator with collider by elalish · Pull Request #830 · elalish/manifold · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Optimize triangulator with collider #830

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

Merged
merged 6 commits into from
Jun 5, 2024
Merged

Optimize triangulator with collider #830

merged 6 commits into from
Jun 5, 2024

Conversation

elalish
Copy link
Owner
@elalish elalish commented Jun 4, 2024

Fixes #723, or so's the hope. Does anyone have a good polygon to contribute to a TEST that would make clear the performance improvement? 35x improvement on #831 without degrading our other test times, so I think we're good! And this is just the simple version: using our 3D collider for 2D boxes. Could probably be sped up a bit more with a templatized Collider, though I'm not sure it's worth the trouble.

@pca006132 I seem to be hitting a linker error - I told CMake to link to collider, but apparently that's not good enough? I'm guessing it's just a line I forgot somewhere.

@elalish elalish self-assigned this Jun 4, 2024
@elalish elalish requested a review from pca006132 June 4, 2024 22:22
@pca006132
Copy link
Collaborator

Remove the OBJECT in

add_library(${PROJECT_NAME} OBJECT ${SOURCE_FILES})

For polygon, I think things like the polygon in openscad/openscad#4679 can be a good test.

@pca006132
Copy link
Collaborator

and also #831

@elalish
Copy link
Owner Author
elalish commented Jun 5, 2024

Remove the OBJECT

You're right! What voodoo is this? Thanks - not sure what I'd do without you.

@pca006132
Copy link
Collaborator

You will figure this out when you see the linker command used by cmake, which somehow skips the dependencies of polygon when linking with executable (minimizeTests or something) that depends on polygon lib only. I have no idea why cmake works like this, but this is what we get...

@elalish
Copy link
Owner Author
elalish commented Jun 5, 2024

@kintel Okay, this PR reduces the time for #831 from 11.8 seconds to 0.6 seconds. It doesn't make much difference on our overall test set (not surprising since we don't have much in the way of large polygons) but at least it's not a detriment, so that's good.

Now I just need to figure out what's wrong with the Zebra.

@elalish
Copy link
Owner Author
elalish commented Jun 5, 2024

I forgot a simple optimization - with that #831 is now down to 0.33 seconds for a total of 35x improvement!

@elalish elalish merged commit 0577aab into master Jun 5, 2024
18 checks passed
@elalish elalish deleted the triangulatorCollider branch June 5, 2024 17:29
This was referenced Jun 5, 2024
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.

triangulator optimization
2 participants
0