Need help understanding a piece of Extrude code. #734
-
I have two questions...
if (isCone)
for (int j = 0; j < polygons.size(); ++j) // Duplicate vertex for Genus
vertPos.push_back({0.0f, 0.0f, height}); The code appears to be adding a full set (i.e. the size of the incoming CS) of vertices that are all zero points at height. Essentially you seem to be making a set of triangles that share a common point. To make it more clear, is the triangles pointing to different vertices that are in fact the same My extruder, alas, is a bit too complex to get the index / vertices right. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
It's only foring over the number of polygons, not polygon verts. If you extrude a donut into a cone, you have two polygons, but if you only add one top vert, it's a non-manifold vert otherwise known as a "kissing vert" - imagine a bowtie. Genus is the standard topological definition, coming from the Euler characteristic, but that assumes there aren't any non-manifold verts. The fundamental difference between this Manifold library and many other geometry libraries that have come before is that it allows duplicate verts as necessary to keep the topology sane. Anything that combines all verts that have the same position in space will not be able to retain manifoldness in general. So it basically all comes down to bookkeeping indices. |
Beta Was this translation helpful? Give feedback.
-
@elalish Wow, thanks! |
Beta Was this translation helpful? Give feedback.
It's only foring over the number of polygons, not polygon verts. If you extrude a donut into a cone, you have two polygons, but if you only add one top vert, it's a non-manifold vert otherwise known as a "kissing vert" - imagine a bowtie. Genus is the standard topological definition, coming from the Euler characteristic, but that assumes there aren't any non-manifold verts.
The fundamental difference between this Manifold library and many other geometry libraries that have come before is that it allows duplicate verts as necessary to keep the topology sane. Anything that combines all verts that have the same position in space will not be able to retain manifoldness in general. So it basic…