How to find non-manifold vertices?

(Albert Li) #1

Hi,

Recently, I encounter a problem that I wanna find non-manifold vertices from a mesh model like this figure. It is very important to conversion from FEA elements to Rhino meshes. Does anyone know how to find them?

Albert

#2

Can you send me an example? I have a Python script that may do this. If I get it to work on your test case, I will send you the script.
Regards,
Terry.

1 Like
(Albert Li) #3

Hi, here is an example. Thanks a lot! :grin:
Regards,
Albert
Non-ManifoldVertices.3dm (80.0 KB)

#4

Here is the starting mesh:

Here is the mesh after 191 non-manifold parts were removed:

Here are the non-manifold parts of the mesh:

Is this what you wanted?

You can look at these results in the .3dm file on the layers named Start Mesh, Cleaned and Non-Manifold.
ManifoldNonManifoldCleaned.3dm (104.5 KB)

You cannot make a good mesh out of mesh cubes that are overlapped as many edges are then connected to more than two faces. Do you want a mesh made out of only the external faces, with the internal faces removed? This may get you a mesh with only manifold edges (connected to no more than two mesh faces).

Regards,
Terry.

1 Like
(Pfotiad0) #5

Albert

I assume that you speak something since you post the issue in this class. If that something is C# I can provide tons of examples about anything imaginable … but you must be familiar with mesh elementary matters: what is a vertex? what is a topo vertex? a topo edge ? etc etc PLUS mesh connectivity.

For instance (alias mesh M, var MTV = M.TopologyVertices, var MTE = M.TopologyEdges):

For any topoVertexIndex (tv) - in the collection MTV get the connected faces indices.

List < int > fList = MTV.ConnectedFaces(tv).ToList();

Then do a classic custering in order to find the groups of faces that are separated with regard intersections of their topo vertices Lists:

If there’s 2 or more clusters around > this topo vertex is a bad one.

Of course there’s the Mesh[ ] pieces = M.SplitDisjointPieces(); and - for other purposes - the Mesh[ ] pieces = M.ExplodeAtUnweldedEdges();

Same kind of logic for finding edges that are connected with more than 2 faces or anything imaginable related with vertices, topo vertices, topo edges and faces. That said NEVER use a collection of vertices (var MV = M.Vertices;) since MTV indexing has nothing to do with MV indexing PLUS a topo vertex MAY be assosiated with more than one vertex (unwelded edges and the likes). That said a MeshFace at creation time is assosiated with … er … vertices (this appears LOL but is the way to go).

Tip: don’t use Sandbox against a collection of meshes (Lists, that is).

1 Like
(Pfotiad0) #6

BTW: I think that all that are a bit weird (and the approach briefly outlined is not 100% the real one).

Allow me some minutes to set-up a demo on that matter (as simple as possible - assuming that you speak C#).

And here it is:

Mesh_NonManifoldVertices_V1.3dm (119.1 KB)
Mesh_NonManifoldVertices_V1.gh (123.6 KB)

NOTE: If you want to check indices and the likes DO NOT use anything that outputs mesh vertices/indices instead of mesh topo vertices/indices. That said the V in the C# outputs topo vertices anyway.

1 Like
(Albert Li) #7

Thanks a lot.
I’m sorry, maybe the method I described was wrong. I wanna know how to find the indices of non-manifold vertices according to some algorithm. Actually, these boxes are voxels, so there is a kind of data structure in this problem.

Regards,
Albert

(Albert Li) #8

Thanks so much! I got your mean.
I will try it.
Albert

(Pfotiad0) #9

Have in mind that finding bananas MTV points doesn’t mean that the quest is over (you need to check faces connected to edges as well: if > 2 … call Houston).

1 Like
(Albert Li) #10

OK i got it. I wanna use this to solve voxel problems. Thanks again

(Pfotiad0) #11

Added the MIA bananas edge thingy. Spot the fact that a mesh can pass OK the bananas TV check … while being in fact non manifold due to failure in the TE check.

See demo mesh at 3: you can’t split it in disjoined pieces ( in case that you think that this method is the Holly Grail of all things).

Mesh_NonManifoldVertices_V1A.3dm (99.2 KB)
Mesh_NonManifoldVertices_V1A.gh (118.8 KB)

That said the classic clustering Method used to detect the bananas MTV stuff is not the one used in real-life for colossal meshes with 1+++Z TV/TE/F etc etc … but the other high performance Methods are strictly internal to the practice (so I can’t post them).

Moral: bananas, what else?

Update:

Added a LOL option for a kind of “map” Tree that works:

  1. If MV.Count != MTV.Count,
  2. If a given TV is assosiated with more than 1 V.

Mesh_NonManifoldVertices_V1C.gh (120.5 KB)

PS: You can add a M.Vertices.CombineIdentical(true,true); option as well.

2 Likes