0
$\begingroup$

I wonder how and if it is possible in Geometry Nodes to procedurally split a mesh?

I don't mean simply into uniform squares, like in this question, but a bit more complex.

The answer should meet the following requirements:

  • The mesh should be split into a flexible number of pieces on two axes.
  • The axis/rotation along which the slicing takes place should be freely selectable.
  • The individual parts are to be given a unique ID so that further processing is possible.

enter image description here
For example, here is a terrain I want to cut contour lines into.

How does this work?

$\endgroup$

1 Answer 1

7
$\begingroup$

The task is interesting, but unfortunately dependent on the node Mesh Boolean, which does not always work optimally (Depending on the task and the complexity or nature of the mesh to be cut).

The essential setup looks like this:

enter image description here

  • At the beginning, the mesh to be used is counter-rotated according to the given rotation and a Bounding Box is placed around it.

    In this way you get a kind of "cutting cage" that encloses the mesh as seen from a certain direction.

    enter image description here

  • From this bounding box you then create the actual geometry to cut the mesh.

    However, this is created from a grid instead of directly subdividing the bounding box, because this allows you to create any number of cuts on two axes.

    Then the cage is rotated again to match the given Rotation.

    enter image description here

    The goal here is that the cutting cage always encloses the mesh from a certain direction, which looks like this when in motion:

    enter image description here

  • Finally, the node Mesh Boolean cuts the mesh with this cutting cage and the intersecting edges are split with Split Edges.

    enter image description here


But there is more...

I have developed another variant here, which can do even more:

  • Showing the cutting cage
  • Leave only the cutting planes
  • Assigning a unique ID per slice element

enter image description here

Basically only a few switches are added here, as well as a mechanism to capture the indices of the cutting faces.

I achieve this by sending a raycast from each face to the grid of the cutting tool, and transferring the index from there:

enter image description here

With this variant some funny things are possible.

Here are a few examples...

enter image description here
Cut and move the individual elements on the X axis

enter image description here
Cutting up Suzanne and keeping the cutting planes

enter image description here
Contour lines of a landscape

enter image description here
Cut planes of a landscape

enter image description here
Uniform cutting of a landscape

And of course, this is available as a node group for convenient use:

enter image description here


(Blender 3.3+)

Note: The Mesh Boolean node is a bi***! The node basically does what it wants at a high resolution, and works sometimes bad and sometimes good. Just try a little bit with the settings, and maybe it will work. Mesh Boolean has a problem especially when intersections are on the same position.

Also important: The boolean operation is slow! This setup is definitely NOT meant for realtime or animation!

$\endgroup$
8
  • $\begingroup$ +1 another great solution!! $\endgroup$
    – Chris
    Commented Nov 15, 2022 at 7:34
  • $\begingroup$ Just to understand this... are you making up your own questions to give tutorials on how to do something...? Or just to accept your own answers since others don't even get a chance to answer? Because the timestamp says you asked and answered directly afterwards, so I wonder why? Or is there something wrong with the timestamp? $\endgroup$ Commented Nov 15, 2022 at 8:13
  • $\begingroup$ @GordonBrinkmann Well, I had done some tinkering with nodes and thought it might be helpful to others and wanted to share it. I thought this platform could benefit from it and invite users to stop by. And since it's a Q&A platform, I had to ask a question as well, but it should probably be more of an open source tutorial. My goal would be to produce a larger number of solved questions with helpful answers. For now, I would accept my own answer as it leads to the solution. Even if this solves the question for me personally, everyone is of course welcome to provide a better answer at any time. $\endgroup$
    – quellenform
    Commented Nov 15, 2022 at 8:58
  • $\begingroup$ So, some kind of tutorial, I understand ;) $\endgroup$ Commented Nov 15, 2022 at 9:08
  • 1
    $\begingroup$ @quellenform Jokes aside, I wonder if we should mark these with a "[Tutorial]" or something similar? It could pique the interest of more people, letting them know that there's (probably) a studied, well-prepared answer inside that's worth a look. Additionally it could remind people that you don't have to wait for a question to share your knowledge, so perhaps we would get more of them. Maybe this is a Meta question though, idk. $\endgroup$
    – Kuboå
    Commented Nov 15, 2022 at 21:11

You must log in to answer this question.

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