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:
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.
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.
The goal here is that the cutting cage always encloses the mesh from a certain direction, which looks like this when in motion:
Finally, the node Mesh Boolean
cuts the mesh with this cutting cage and the intersecting edges are split with Split Edges
.
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
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:
With this variant some funny things are possible.
Here are a few examples...
Cut and move the individual elements on the X axis
Cutting up Suzanne and keeping the cutting planes
Contour lines of a landscape
Cut planes of a landscape
Uniform cutting of a landscape
And of course, this is available as a node group for convenient use:
(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!