I am not quite sure what non-manifold geometry is. I thought non-manifold geometry was just floating vertices and hole in a mesh. From my experience this is not always the case however. What is non-manifold geometry and what are the types of it and how do I avoid it? Is there a case where it is acceptable?
Non-manifold geometry is essentially geometry which cannot exist in the real world (which is why it's important to have manifold meshes for 3D printing).
As JulianHzg points out in the comments, intersecting geometry (faces sticking through other faces) is not technically non-manifold geometry on it's own. However it will often cause the same issues as non-manifold geometry, i.e. confused volume calculations.
Non-manifold geometry can be problematic, because it complicates some tools & operations:
Rendering of refractive effects
Among many other cases.
You might want non-manifold geometry in some kind abstract model (as non-manifold geometry cannot exist in the real world), or as an approximation of a very thin object (e.g. paper, leaves, etc.)
Common causes of non-manifold geometry:
Disconnected vertices and edges:
Areas with no thickness:
Fixing non-manifold geometry:
You can select all non-manifold geometry in the 3D view, in edit mode, under Select > Select All by Trait > Non Manifold (CtrlShiftAltM in the 2.7x keymap)
Internal faces can be selected by pressing 3D view > Header > Select > Internal Faces in edit mode.
Loose geometry (elements without any other connecting elements) can be selected with 3D view > Header > Select > Loose geometry. Note that it only selects vertices, edges, and faces depending on the current selection mode.
Other useful tools for repairing non-manifold geometry:
ShiftG (Select Similar). This is often useful to select vertices with only one connecting edge, etc.
CtrlL (Select Linked). This is often useful in combination with Select loose and Select similar to select all geometry connected to the selected geometry.
W> Specials > Remove doubles Doubles, (multiple vertices in the same place) are usually non-manifold (not always).
Since a common cause of non-manifold geometry is lack of thickness, the solidify modifier can also be useful.
How To Find Non Manifold Areas in a Mesh
While in Edit mode, you can select all non manifold areas with CTRLSHIFTALTM.
One type of non manifold situation is when you have overlapping edges.
For example, I'd frequently have a mesh that'd look fine, like this:
But then when I checked for non manifolds, I would get an edge highlighted like this:
I discovered the reason this edge was highlighted was because there were overlapping edges.
The way to find the overlapping edges is to grab one of the middle vertices in the highlighted area (circled in green), drag it around and see if you discover a hidden edge, like the white one here:
Once you find that edge, delete it, then put the dragged vertex back into place. One trick I discovered about how to put the vertex back into place easily is when you are first dragging it out out of place, only drag it on one axis, rather than freely in 3, because then you only have to snap it back to that one axis, rather than 3.
When Non-Manifold Geometry is Useful or OK
Ok, I haven't found any uses for interior faces or overlapping edges, but I find open ended meshes and intersecting ("sunken") sub-meshes to be useful in some situations, provided you are:
- NOT making an object that's supposed to be transparent, translucent, refractive, or have other internal light effects
- NOT making an object that's expected to hold up in simulation by itself
- NOT doing that 3d-printer stuff
This is probably mostly useful for lowpoly modelers, though I use it with solid subsurf stuff sometimes as well. Here is a device I've been working on for a modding project:
It's made up of several mesh object. The front iPhone-colored-specular-map-showing one is protruding into the rear cargo unit so that no gaps are visible. If we hide the back one with the hatches, we can see:
There isn't actually a inside-rear to this part. Also you can see that the sidelights also have open edges sticking into the head mesh, and that the grate-things are protruding into the head a little too despite being closed objects. In this case, users probably aren't going to be able to get close enough to the object that modelling any more detailed connections between things would be meaningful.
One more thing to note about open edges like this: you can actually loop select them. If you were to fill the hidden area with an N-gon or an efficient triangle spread, you wouldn't be able to loop select anymore, which I find kind of annoying.
When making environmental static meshes for games and such, some designers go for designs like this to save polygons:
(In these examples, presume that the giant yellow UV map is some ugly/error texture that the users are hopefully never to see, and the other three colors are proper textures)
The problem with this design, is that each tiny error in meshing by the map designers can cause a huge immersion-breaking mess for the users:
From my experience wandering artificial environments, these errors, like software bugs, are not so much a 'if' as a 'how many, how bad, and where' situation.
It does cost some extra polygons, but I find I much prefer making a backing hull for this kind of mesh:
In this case, after extruding the top and bottom edges and creating the rear face, I created an N-gon in each side loop and then triangulated it for a minimal fill. I unwrapped the UVs on these faces and shrunk them to a tiny dark spot in the corner of the map. If I were making lightmaps, I'd try to minimize all these faces to a combined pixel or so as well.
The result when looking at the messed up seam:
I find the pretense of solid mass here much less immersion breaking, even though the unintended faces are minimally texture. Even when you look dead on through the gap:
You can barely even see the 'bad texture' texture.
As a final note, some game engines -- or at least later versions of Unreal engine as of UDK a bit before UE4 was announced -- require solid, enclosed meshes to make their magical static-mesh-occlusion-optimization-magic work, which is important for managing framerate and so when putting maps together.
The question is not well stated. There is nothing like non-manifold geometry. Non-manifoldness is a topological property and when we come to computers non-manifoldness is a combinatorial property.
Given a bunch of triangles you can build a manifold or a non-manifold stitching together edges in different ways. Manifoldness of what comes out do not depends of the shape of triangles you use. You can end up in a nightmare of self intersecting triangles but this can not be considered strictly related to non-manifoldness. You can choose other vertexes or you can let yourself float out of 3D to a nD space and all intersections can go away, pushing n high enough. Nevertheless if you stitch a segment to a triangle vertex the broomstick you get is a non-manifold even if you can see all the dimensions of the String Theory.
Defining non-manifoldness could be surprisingly daunting. Manifoldness is a black night in which all the cows are black. Recognizing manifold cows is obvious for triangulated meshes (a.k.a. 2-complexes) and tetrahedralization (3-complexes) but recognizing if a n-complex is a manifold, in general, cannot be done for n greather than six (let alone the String Theory...). That has something to do with the Halting Problem.
So, all manifolds are equal but some are more equal. There are Pseudomanifolds, Lienhardt's Quasi Manifolds and Initial Quasi Manifolds, the latter being something that you cannot decide easily how to decompose into parts. There is a linear time algorithm for a non-preemptive decompositon of a non-manifold into Initial Quasi Manifolds.
What hell do I mean for a non-premptive decomposition? Take this tetrahedralization Without being too preemptive you might consider this natural decomposition Next you cannot decide how to go on (seriously?). The orange edge is a non-manifold edge. If you look at this complex as a triangulation then you can see that there is a unique natural option, i.e. to inflate it.
However if you consider this as a tetrahedralization you have several options to decompose but none is more equal than the others. You can take this four component decomposition and decide to stitch one or two of the lonely tetrehedra (marked 1 and 2) to one of the two pies or both to the same and get either a three or two component decomposition. Furthermore, a one component decomposition can be obtained cutting at the orange edge and thru one of the thick black triangles. However, There is no good reason to chose one of these decomposition. Interested in this? See the Maths behind this here.
So in the end non-manifoldness is a combinatorial property that depends on how I stitch together things. If I am not careful at the way I stitch together things I end up in a non-manifold. However, looking at a non-manifold it is not always possible to tell which was the wrong stitching. Sometimes you (or an AI system) look at the 3D non-manifold object and see its assembly, sometimes you can't.
It's not so tricky to define non-manifold in the context of Blender. Non-manifold is what shows up when you use the select non manifold operation.
Non-manifold is better defined by instead defining what "manifold" means:
- Every edge connects two and only two faces.
- Every vertex is part of a face.
- As we travel along one side of the mesh, every normal we come across points toward us; or, from the other side of the mesh, away from us.
Non-manifold meshes are just meshes for which one or more of those characteristics is not true.
If we use the select non manifold operation, we can see that there are multiple options for this. Note that the "extend" option is not actually a non-manifold characteristic, but just means to add the selection to our old selection, so we'll ignore that. Let's go through the other options to demonstrate:
- Wire. Edges that are not involved in any faces are selected. These edges do not meet our first criterion above:
- Boundary. Edges that are connected to only a single face are selected. Again, this does not meet our first criterion:
- Multiple faces. Edges that connect more than two faces are selected. First criterion:
- Non-contiguous. Edges where the normals flip direction when crossing over the edge are selected. This does not meet our third criterion:
- Vertices. Straight from the manual: "Selects vertices that belong to wire and multiple face edges, isolated vertices, and vertices that belong to non-adjoining faces." This is the only mode that actually selects vertices (other modes select vertices only via the edges they select), and it selects based on several criteria, but will catch those verts that violate criterion 2 above:
Is non-manifold geometry ever acceptable? Absolutely, yes! This is visual art. Everything is permitted! Non-manifold geometry is acceptable. But if you want to use non-manifold geometry, you'll want to know that you're using it. (And, for most rendering meshes, you probably won't want to use non-manifold geometry.)
The biggest issue with non-manifold geometry is how it affects your normals. That's particularly true with smooth-shaded normals, which are interpolated across your faces from vertex normals; and vertex normals are calculated from the face normals of the faces they form. If those faces switch normals, consider that we're interpolating from a negative normal to a positive normal. That creates a line of singularity of zero normals (or infinity normals), although our samples aren't likely to see it. It also affects our lighting across the entire face.
Normals are also used by many operations-- booleans, physics, more-- to determine what's the inside of the mesh and what's the outside. For example, the difference between a cave and a rock is simply which direction the normals are pointing. When we have non-manifold geometry, there is no clear inside or outside to the mesh, and these operations are going to fail, or act in unexpected ways.
There are also plenty of operations we can do that are built around an expectation of manifold geometry. Catmull clark subdivision is likely to do what we want with manifold geometry; it is not likely to do what we want with non-manifold geometry.
However, there are some clear cases where non-manifold geometry is not only acceptable, but ideal!
Thin meshes-- meshes that fail the "boundary" condition-- are routinely used in 3D rendering. Think of hair cards as an example. The fact that these meshes do not have a clear inside or outside doesn't matter, because we're not doing anything with them that needs a volume defined. The fact that their normals aren't defined by a full complement of faces doesn't matter, because the normals are consistent-- and besides, if we wanted, we could give them custom normals, or use a normal map.
Non-rendering meshes are also routinely non-manifold. The easiest way to make a bone that can have only a few specific, arbitrary positions is to shrinkwrap it, nearest vert, to a mesh composed only of verts. Soft body physics meshes routinely have loose edges so that we can create and control forces to affect their operation (and then mesh deform a rendering mesh from these physics meshes.)
And if we're making an emission mesh, then its normals don't affect rendering, and we can make a mesh that violates contiguous or multiple faces conditions and just not worry about it, even though those are the conditions that we are usually most concerned with.
Note also that just because non-manifold geometry causes rendering artifacts, that doesn't mean that all geometry that causes rendering artifacts is non-manifold. A degenerate quad (with three collinear verts, or joining another quad by two of its edges) is just as bad news as multiple faces for smooth shaded normals, but it is not non-manifold geometry. Understanding what non-manifold means, and why to avoid it (or why not to!) is an important part of understanding how to create good topology, but it is not the only part.