Fun with batches and generators. #1609
tonious
started this conversation in
Show and tell
Replies: 1 comment 7 replies
-
|
That's amazing! Though, would you be sad if I told you it's probably easier to hack |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment




Uh oh!
There was an error while loading. Please reload this page.
-
As part of playing around with chamfers, I've been making looking at meshes up close. I could just save the result, and view that in something like meshlab. But where's the fun in that? It would be easy to... Look at each triangle, place a sphere at each vertex, hull those in pairs to make line segments and then union the whole thing together. That should be fast, right?
Unoptimized:
Deduplicating segments, and performing unions in batches:
This second run is faster, even though it's forcing a mesh evaluation every 500 segments.
Check it out!
meshTriangleWireframe()accepts aMeshobject, and returns aManifoldrepresentation of the triangle mesh.batchUnion()is a drop-in replacement forManifold.union()with a few creature comforts. It prints feedback as each batch is completed, via a callback so it can be customized. It will accept iterators as well as flat arrays, which is a side-benefit of using generators.And now I don't have to leave the browser to check my work.
Beta Was this translation helpful? Give feedback.
All reactions