# "Decimate: Planar" in Geo nodes?

Is there a way to decimate geometry in Geometry Nodes in the same way the decimate modifier does when set to planar?

I want to have less decimation near the edges. So I am planing to put the edges in a vertex group and use an inverted selection of those in Geometry Nodes. I don't think it is possible to control the distance from the edges in the modifiers (I will probably mix up the provided answer with some proximity stuff).

I am experienced with Geometry Nodes but don't know where to start for when it comes to planar decimation.

Yes.

There are not many ways to do this, but one way might be to disassemble the mesh, remove the excess edges, and reconstruct the missing parts.

It might look something like this:

Here I first split the mesh at those edges where the edge angles are not equal to $$0$$. This way I get planar surfaces as single elements.

Afterwards I remove the inner edges in these elements, so that I only get the "frame". I transform this into curves, so that it is possible for me to remove also the points lying on a straight line.

Then I simply instantiate along a mesh line a few curve circles with the same number as curves. This allows me to resample them further, with exactly the same number as the number of vertices in the original faces.

By then applying the node Fill Curve, these are converted to faces for me, whose points I move back to the original positions.

Finally, I only have to transfer the original normals back.

Of course, you can also add additional custom vertex groups at the beginning when splitting the mesh so that no decimation occurs at certain edges.

(Blender 3.6+)

This answer is basically based on an answer given earlier, however the solution shown here can be applied to any mesh even if it has tris or n-gons:
How can I delete edges/edge loops that are on a mostly flat surface using geometry nodes?

• ...sorry, small mistake: At the end when transferring the normals, the Compare node should not be set to Less Than, but to Less Than or Equal! Aug 17, 2023 at 14:46
• Whoops! I missed the "planar" part. Not only it makes the geometry nodes more possible (in fact using a repeat zone may be not that hard at all…), but my solution is wrong, decimate in planar mode doesn't support vertex groups. Aug 17, 2023 at 16:15

No.

You could reimplement the functionality in Geometry Nodes, but honestly it's unrealistic…

If you're fine splitting your geometry nodes tree in two, and put the Decimate modifier in middle, and the only problem is how to pass the selection - you can actually use Geometry Nodes to set a vertex group, though it's annoying (and requires even more modifiers):

Assign vertex group in Geometry Nodes (v3.3)

For example to animate a dynamic subdivision (that's a bad algorithm, as it subdivides first, then decimates… But it's an example of dynamic decimation):