4
$\begingroup$

I stumbled upon an issue in this thread where I discovered that some of my same-sized overlapping faces did not merge with each other despite doing a M > Merge By Distance. But fortunately found a fix in this thread by doing Mesh > Split > Faces by Edges and then Merge By Distance. Upon further inspection I discovered that just doing the Merge By Distance function could indeed not have resolved the problem because the 2 faces were sharing the same 4 vertices.

enter image description here

I was able to reproduce this scenario using the below script by drawing 2 faces on the 4 vertices, each with opposite Winding Orders so both faces would have normals facing in opposite directions. In Blender, a CCW winding order is a Blue face and CW order is Red face. It's a bit confusing and does not make sense to have such geometry be allowed to exist. Hence my question: Is having 2 faces with 4 shared vertices a bug or expected valid 3D geometry?

import bpy

context = bpy.context

verts = ((-1.0, -1.0, 0.0),
         (1.0, -1.0, 0.0),
         (-1.0, 1.0, 0.0),
         (1.0, 1.0, 0.0))

faces = ((0, 1, 3, 2), (2, 3, 1, 0))

me = bpy.data.meshes.new("Plane")
me.from_pydata(verts, [], faces)
ob = bpy.data.objects.new("Plane", me)
context.collection.objects.link(ob)
context.view_layer.objects.active = ob
ob.select_set(True)

Thank's to @Nathan for pointing out that you can actually create this scnario with regular Blender operations which made me discover a method to create as many faces as you want! Here's a scenario where I reached 5 faces sharing all same 4 vertices and you can go and create as many faces as 100 or as you like with this method:

enter image description here

enter image description here

But if you attempt to dissolve 1 vertex it changes into a triangle with only 1 face left.

$\endgroup$
3
  • $\begingroup$ It kinda depends on what you mean by "valid geometry." It's geometry, Blender can draw it. But man, it breaks a ton of stuff. It is not something you ever want to have. It is way up there at the top of the topology no-no list. $\endgroup$
    – Nathan
    Dec 27, 2022 at 6:38
  • 1
    $\begingroup$ I know people who have written papers about polytopes where many faces share the same vertices. In the extreme case that every face shares the same vertices they're called flat polytopes. $\endgroup$ Dec 28, 2022 at 2:05
  • $\begingroup$ Update of the open issue here projects.blender.org/blender/blender/issues/70977 $\endgroup$ Feb 1 at 6:03

2 Answers 2

6
$\begingroup$

Blender lets you make geometry that is not often a good idea:

enter image description here

This is non-manifold geometry, in the way that matters: we have a single edge that is a part of 3 different faces. This is terrible topology. You never want to make a rendering mesh that looks like this. It will break normal calculation, it will break autoweights, it will break tons of stuff.

But is it ever useful? Sure. I can use one of those faces to create anchors for a smooth modifier on the bad edge, and then I can mask away one of those faces with a follow-up modifier. "Bad" topology is really only bad topology in certain contexts. In a rendering context? Awful. As some kind of technique to create a later mesh that's okay for rendering? It's fine.

enter image description here

Do I ever do that? Hell yeah. I use non-manifold geo all the time for physics meshes, to create forces that make my physics act how I want. Then I mask away the bad stuff, or I surface/mesh deform from it (which doesn't care about loose edges/verts.)

We can make a doubled-face like you're describing without a script. Here's how we'd start:

enter image description here

It's just four verts, triangulated two different ways. If we tris to quads twice, we can make that into two different quads with only four verts. Believe it or not, this isn't even non-manifold yet-- but the instant we want to do anything interesting to it, it'll stop being manifold:

enter image description here

Extruding out just a single face from an edge, we've already got an edge connecting 3 different faces, which is one of our biggest rendering topology no-nos-- bigger than "no tris", bigger than no degenerate quads, bigger than no concave ngons. Only as big as no zero-area faces.

So is this now "valid" geometry? It's bad rendering topo. But is it useless? No:

enter image description here

By virtue of that weird set of faces, we've changed how our smooth modifier works. And we can always follow this up with a mask modifier to make it good rendering topo.

However-- do I ever do this? No. Unlike loose edges and verts, I don't find this useful. That doesn't mean that nobody else finds it useful, but I don't.

I think we have to say that this is not good geometry for rendering, but we can say that without saying that this is not valid geometry. These kind of doubled up faces have certain properties that we could use as desired in modifier stacks (including in GN stacks.) The fact that we'd never want to render them doesn't mean that they're invalid.

Blender, probably by virtue of being a collection of open-source developers' inputs, developers who often have a limited window on the various ways that Blender is used, sometimes makes some mistakes by assuming, "No sane person would ever want to do this." But sometimes, some sane people would like to do that. I would love it if I didn't have to jump through hoops now to get a solidify modifier to get its normals facing in the same direction, but a few years ago, they decided no sane person would ever want to do that. Treatment of normals in shaders is similarly changing from controllable to uncontrollable, with many nodes (but not all) flipping normals depending on backfacing. This is happening all the time, and it's not a good thing.

In other words, if you don't want doubled faces, don't make doubled faces. It's entirely within your power; you don't need to ask Blender to be smarter than you are, and you don't want to, because it never will be.

$\endgroup$
2
  • $\begingroup$ Thank you very much for your inputs! Appreciated! Yes you're right it does make sense to let blender allow us to do all kinds of funny stuff. But it did try to get smart with me by merging the faces when I dissolved 1 vertex but but but... I wanted to keep both faces :p $\endgroup$ Dec 27, 2022 at 7:39
  • $\begingroup$ btw it was confirmed as a bug developer.blender.org/T70977 $\endgroup$ Dec 28, 2022 at 14:20
3
$\begingroup$

Update: Yes this is a bug and has already been confirmed in https://developer.blender.org/T70977

I concluded that this must be a bug because either (1) Blender should have never allowed 2 faces to share exactly all same vertices, and essentially automatically merged both faces; or (2) Blender should not merge both faces when dissolving 1 vertex. I logged an issue https://developer.blender.org/T103482.

The manual fix for this problem can be found in this answer:

  • Select all with A
  • Go to menu Mesh > Split > Faces by Edges
  • Press M > Merge By Distance

Or you can simply validate your mesh with the workaround presented in this answer, which is to run the following code line in the Python Console:

for m in D.meshes: m.validate()

and press Enter twice. Then select any object to update the UI.

$\endgroup$
1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .