2
$\begingroup$

I have a series of meshes that display the pattern highlighted in red in the image below: triangles adjacent to pentagons or hexagons.

Blender session screenshot showing the problem

It is evident how the topology of the models could be greatly improved by restoring the edge loops, as in the example of what I want to achieve in the center of the screen.

To try to achieve this improvement with geometry nodes, I started by creating the node tree you see, capable of eliminating the superfluous vertices, which creates the situation visible on the right.

But filling the gaps left by this operation and reaching the final result is in a whole other league of skill compared to mine. I suspect that, perhaps, it is necessary to select the edges of the holes, separate them from the rest, transform them into islands, and do some kind of magic with the indexes, separated by an accumulate fields node, maybe...

The other day I posted a similar question always on the topic of mesh topology modifications, and users Cornivius and Markus von Broady showed me how in that case the solution was a Merge by Distance node away! But this time I really see it as tough.

$\endgroup$
5
  • 1
    $\begingroup$ i.imgur.com/xLA0ucn.png - (1) if you make the holes, you shouldn't have a problem selecting the borders of it (e.g. storing a boolean TRUE on the edges). (2) out of those selected boundaries, select the vertices that have exactly 4 edges. Now separate those edges, split all edges, temporarily capture current vertex positions, move one of corners just marked away, merge by distance, move the corner you just moved away to its original position. Convert to curves. For each spline check if the index 1 is the marked corner, if so, "reverse" that spline (curve). $\endgroup$ Commented Jul 5 at 11:54
  • 1
    $\begingroup$ (3) Now it should be easy to loft this topology: 1st rectangle is indices 0, 1, LAST-2, LAST-1, then 2nd rect is 1, 2, LAST-3, LAST-2 and so on. $\endgroup$ Commented Jul 5 at 11:54
  • $\begingroup$ Hi Markus, thanks for the suggestions. But how do I create a square face? I found that the "Quadrilateral" node allows you to set four points to create a curve, but I don't think I can fill it if it's not perpendicular to the Z-axis. Otherwise, how should I do it? $\endgroup$
    – crucchi
    Commented Jul 7 at 9:31
  • 1
    $\begingroup$ You can create a Grid (Mesh Primitive) with 2 vertices in X and Y. It is made of a single face, 4 vertices and 4 edges. $\endgroup$ Commented Jul 7 at 9:37
  • $\begingroup$ Thanks StefLAncien, also now that I think about it, I can extrude an edge to create a square face. The problem is that I haven't yet learned how to use the nodes in the "attribute" section, and I believe they are essential for this task (to move and merge precisely what needs to be merged). $\endgroup$
    – crucchi
    Commented Jul 7 at 9:38

1 Answer 1

4
+100
$\begingroup$

Essentially, this task can be solved by following these steps:

  1. First isolate the faces that are to be removed
  2. Convert the outer line of this selection into curves
  3. Divide the curves into two parts (upper part and lower part) and convert them back into a mesh
  4. Extrude one of the two edges and move the points to the positions of the points of the opposite edge

Something like this:

Result Overview

1. Split Geometry

This step depends a lot on the geometry of your mesh. In this particular case, I am using a game of values created by interpolating across different attribute domains:

Step 1 Step 1 - Nodes

2. Prepare Curves

In order to obtain the desired edge for an extrusion, a consistent corner point must first be determined. I achieve this by removing one of the vertical edges and then converting the remaining mesh lines into a curve. Again, it depends a lot on the geometry of your mesh:

Step 2 Step 2 - Nodes

3. Separate Upper/Lower

Since each curve now starts at a corner point, I only need to divide these curves into an upper and lower part:

Step 3 Step 3 - Nodes

4. Extrude & Move

After splitting the curves, I reverse the lower part so that the indices match the upper part exactly. If one of the two curves is then converted back into a mesh line and extruded, I can use the previously captured indices to sample the positions of the opposite curve and transfer them to the extruded part:

Step 4 Step 4 - Nodes


(Blender 4.1.1+)

$\endgroup$
5
  • $\begingroup$ Hello quellenform, thank you for your response. It works perfectly for the presented case, but as I feared, and as I mentioned in the bounty announcement, if the pattern to be corrected appears on two consecutive lines, it results in a mess (see the attached file). Is there maybe a way to select and replace the patterns one by one, to avoid the problem? That is to say: find a line that presents the criss-cross pattern, eliminate it, fill with the quads, then move on to the next line. In any case, you have faithfully responded to my request, so I approve your response and thank you immensely. $\endgroup$
    – crucchi
    Commented Jul 8 at 8:54
  • $\begingroup$ Example modified to show where it fail: blend-exchange.com/b/EmJ2Xkvz/ $\endgroup$
    – crucchi
    Commented Jul 8 at 8:55
  • $\begingroup$ @crucchi Yes, you're right, in this particular case, where several such patterns are directly adjacent to each other, the selection fails. I am sure that there is a solution for this too. ...let me see. $\endgroup$
    – quellenform
    Commented Jul 8 at 9:18
  • 1
    $\begingroup$ @crucchi In your particular case (where several crossed sections meet) you can use this solution. Here I process the two fundamentally different patterns separately: blend-exchange.com/b/d7prnvjs $\endgroup$
    – quellenform
    Commented Jul 8 at 10:46
  • $\begingroup$ I have tried it, it works. I will study it to understand how it works. Many thanks. $\endgroup$
    – crucchi
    Commented Jul 8 at 10:55

You must log in to answer this question.

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