BelfrySCAD / BOSL2

The Belfry OpenScad Library, v2.0. An OpenSCAD library of shapes, masks, and manipulators to make working with OpenSCAD easier. BETA
https://github.com/BelfrySCAD/BOSL2/wiki
BSD 2-Clause "Simplified" License
829 stars 105 forks source link

Duplicate Vertices in VNFs not allowed with Manifold #1430

Open adrianVmariano opened 1 month ago

adrianVmariano commented 1 month ago

From https://github.com/openscad/openscad/issues/5134

"What changed in OpenSCAD lately is that we moved away from using "polygon soups" as an internal format, and we now use indexed polygon meshes. Each topological vertex must be specified at one unique index. If you specify the same vertex position twice, it's treated as two separate vertices, and you must hence construct a mesh to account for that."

This seems like it will affect a lot of the nontrivial closed VNF constructions in BOSL2. It's not clear how we can address this without a massive slowdown from constantly running vnf_merge_points().

Like have VNFs also carry an edge list to reduce the number of vertices that need to be checked when joining VNFs?

adrianVmariano commented 1 month ago

It looks like duplicate vertices will still work, but it's a warning, so if you're using "stop on first warning" it will be a fatal error.

adrianVmariano commented 1 month ago

New issue https://github.com/openscad/openscad/issues/5135 on the idea of making it not a warning when they correct for duplicate vertices.

adrianVmariano commented 1 week ago

Latest word on this is that they've changed it so that perfectly identical vertices are merged without a warning. Almost identical vertices are merged with a warning.

And they noted this:

Be aware that there is a subset of manifold objects not representable after merging vertices, things like:

So this means for example that a path_sweep without twist is probably OK because the first and last transformation are probably equal. But if there is twist, round-off error is probably introduced and the points won't be exact, so you'll get the warning. If you join beziers patches that mathematically share a boundary it seems likely that they might not be exactly equal on the boundary.

I wonder if we could make a faster merging method by merging when VNFs are joined and explicitly searching each VNF in the join list for its boundary and then looking for duplicates just in those boundaries.