Page MenuHome

Convex Hull Node
Confirmed, NormalPublicDESIGN

Description

This node creates a convex hull of a mesh or a point cloud. If you don't know what a convex hull is, here is a quick refresher https://en.wikipedia.org/wiki/Convex_hull. It can be used to create an enclosing geometry around a set of points. This can be useful as is for various effects, but can also be used in combination with the point instance node to create a minkowski sum of convex shapes (https://en.wikipedia.org/wiki/Minkowski_addition) which is very useful in some situations, like perfect convex bevels.

An example of a Minkowski sum can be seen in the second image above. There is a torus with the convex hull node and a cube. The torus gets instanced on the vertices of the cube and then the convex hull is created to get the Minkowski sum.

The node also handles mixed type geometry and instanced geometry.

Implementation

For the implementation there is a convex hull operator in edit mode. That one just calls the convex hull operation implemented in Bullet the rigid body physics engine. That implementation is very stable and fast. It is also simple to adapt the BMesh operation to instead work with normal Meshes, which are preferred for speed.

Open Questions

There are multiple ways to handle instances.

The simplest way is to make them all real and then create the convex hull.

If the instances themself are not convex, then it might be worth running the convex hull operation on them first and only accumulate the vertices which are on the hull, to reduce the overall complexity. But this is also something the user can do with a second convex hull node, before instancing.

It would also be possible to build the convex hull in an incremental fashion, by calling the convex hull operation after a certain number (1?) of instances are added. This would eliminate most of the memory consumption of making the instances real, but would likely be much slower.

Revisions and Commits

Event Timeline

Henrik Dick (weasel) changed the task status from Needs Triage to Confirmed.Apr 8 2021, 10:13 PM
Henrik Dick (weasel) created this task.

Maybe for instances the convex hull can be instanced as well (so created once for each kind of object that is instanced)? Don't know if that is possible or useful.

Oh sorry maybe I was a bit unclear, let me post some more images.
My plan was to make a convex hull around any position data passed to the node.

Maybe for instances the convex hull can be instanced as well (so created once for each kind of object that is instanced)? Don't know if that is possible or useful.

I think that's a bit counter to the current design philosophy for geometry nodes, that instances are mainly an implementation detail and are realized when necessary.
However we don't really have the tools to apply the same operation to a bunch of different geometries, so I see where that idea comes from, hmm.