Replies: 2 comments 20 replies
-
No, this library fundamentally can't handle non-manifold geometry, as all the intersections are based on winding numbers, which are not defined for the kinds of meshes you describe. If you want to do major surgery on your app, I'd recommend looking at our |
Beta Was this translation helpful? Give feedback.
-
I am working on converting my non-manifold thin surfaces into manifolds (duplicate mesh, swap triangle node order, swap normal vector direction, then merge boundary points and connect front/back mesh together). I am creating a MeshGL and am supplying unique faceID for every triangle (this helped). I am also assigning a unique (integer) property to every vertex (this didn't help). When I create a manifold from my MeshGL, it moves two vertices to apparently lose some triangles. However, because the faceID's are unique, the tris are still there, they are simply collapsed in space. The blue line is the mesh I start with. The gold is what I get out of the manifold immediately after creation. How can I keep manifold from collapsing those tris? The blue is a thin manifold surface. I.e. all of the perimeter vertices for the front and back copy are shared, but the interior six vertices on the front/back sides are independent. So, the two triangles that vanish have three shared vertices and two shared edges. The third edges should be unique, but they actually connect identical verts, so the only way to distinguish the top/bottom edges of those tris is by which faceID's they pair up to. The MeshGL data structure has mergeFromVert and mergeToVert, which makes me think I could use this to make the thin surface manifold (instead of my DIY approach). I.e. I could send the non-manifold mesh twice (with verts and tris in identical order), and then tell it to merge the verts around the perimeter to make a manifold. That said, I think this would put me in the same position. |
Beta Was this translation helpful? Give feedback.
-
Thanks for all your work on this library and for making it available.
My program has a ~20 year old home-grown CSG engine that is a bit long in the tooth. When it was pulled together, the developer didn't know about modern ideas of robust geometry etc. I am looking to replace our code with something external and modular that I can rely on.
However, our program has several good use cases for non-manifold geometry. I am curious if this library will tolerate them well enough for my purposes.
Specifically, we sometimes create surfaces that are not intended to represent a solid. Usually these are planar. Sometimes they extend beyond the solid's bounding box and are used as a cutting plane. Other times, they have finite dimension (say a disk).
We often intersect solids with the membrane. All of the normal triangle mesh-mesh intersection stuff should work as normal.
Then, we make the decision of which triangles to keep. Since the membrane has no interior or exterior, it can never contribute to the decision as to whether to keep a triangle associated with a triangle. However, we can define rules for whether to keep a membrane triangle depending on whether it is inside or outside a solid.
Sometimes we use the plane to construct a cross section cut -- say for slicing in 3D printing applications. In that case, we want to keep the triangles inside the solid. We also use this rule to construct ribs and spars and other structures inside an aircraft's wing. These are eventually fed to FEA software using shell elements.
Other times, we want to keep the part of the membrane that is outside the solid -- say when the membrane represents an actuator disk (a model of a propeller) or a wake shed by a wing.
The final challenge representing these meshes is that a single edge can have three triangles -- two for the solid and one for an attached membrane.
However, if we have two meshes...
MeshA; // Manifold solid
MeshB; // Non-watertight surface, has boundary edges, but no 'bad' triangles.
And the ability to compute the intersections (i.e. add the intersection edges and re-triangulate all cut tris)
intersect(MeshA, MeshB);
And then the ability to classify the meshes...
classify( MeshB, MeshA, MeshBinA, MeshBoutA );
Normally, one would also...
classify( MeshA, MeshB, MeshAinB, MeshAoutB );
But since B is not a solid, this has no meaning.
Normally, one would construct a Boolean operation by merging appropriate results...
merge( MeshBoutA, MeshAoutB); // Boolean union
Which will result in a watertight manifold solid.
In my case, I would want to
merge(MeshA, MeshBinA)
or
merge(MeshA, MeshBoutA)
Which would result in non-manifold meshes.
However, if I could successfully do 'intersect' and 'classify', using your library, I could handle the rest myself. I think you will find that the intersection and one-way classification do not require the manifold assumption and might be permissible with this library.
Thanks for any suggestions.
Beta Was this translation helpful? Give feedback.
All reactions