How can I flip only negative faces in Geometry Nodes?

TLDR: turn any red face blue in geometry nodes

Im using an extrude node on a edge without faces, some of the faces generated by the node come out as negative despite the edge orientation being positive.

Is there a way I can use the Flip Normals node to be like "hey, any face that has a negative orientation must be flipped!"

I tried using a normal node and separate XYZ so that any normal with a negative value would flip over but it didnt seem to work

• The "negative" faces are "positive" if you look at it from the other side. There should be some way to define what side is the right one for the surface direction. You should figure this out first, because at the moment there is no way for any algorithm or group of geometry nodes to determine what you consider the right direction. There is no "Read My Mind" node in Geometry Nodes yet unfortunately. Aug 22, 2022 at 6:49
• This looks strange to me. When a continuous mesh line is extruded without double edges, there is always only one direction of the faces. Please check if there are any double edges lying around. Aug 22, 2022 at 8:23
• no double edges, i have also asked in the Erindale Discord. since this was a single edge loop someone suggested mesh to curve then curve to mesh to recalculate edge normal data and it seemed to have solved my problem. although, this is not the solution on how to flip opposite facing directions. which is something im also interested in. but since my issue was solved should i change title and description of the post to better match my specific problem which was already solved in a different way? Aug 22, 2022 at 9:35
• Please be so kind and share your blend file with us (blend-exchange.com). Without seeing the mesh, it is not possible to tell what is going wrong in this case. Aug 22, 2022 at 9:36
• @quellenform oki, post updated. apologies for not doing so, for some reason the site wont recognize the file as a .blend file format, so i shared with Gdrive instead Aug 22, 2022 at 9:48

You're right, you can actually use the curves trick here, where you first convert the mesh to a curve, and then back to a mesh.

However, that doesn't answer the question, so here's the answer to the original question:

To align the normals of a face uniformly in this case, you would need to know in which direction the normals should point.

To do this, you would need to check the dot product of the position and the normals of the faces. If this value is greater than $$0$$, then the face points outward. However, this solution only works for a mesh like this one, where the faces are reasonably circular on a line.

If this technique doesn't work well because of the mesh, it can still be extended by using a common center point as a guide:

By the way, I've created a separate vertex group here that includes only the points along the edge. This way you save yourself some more nodes.

I suggest extruding first so the extrude operation has some info about surface direction and only after that delete the unnecessary geometry:

I think if you delete the unnecessary geometry first, you are left with an edge loop that has no info about surface direction, because it has no surface.

• P.S. I didn't know you can do math with vertex groups. Is that intended functionality? Aug 22, 2022 at 10:31
• i would say so!, since vertex groups is just float data stored in each vert it would make sense to be able to math with them Aug 22, 2022 at 22:22