Convex Hull Node #87315

Closed
opened 2021-04-08 22:13:48 +02:00 by Henrik D. · 12 comments
Member

Screenshot_20210408_215104.png

Screenshot_20210408_224244.png

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.

![Screenshot_20210408_215104.png](https://archive.blender.org/developer/F9926097/Screenshot_20210408_215104.png) ![Screenshot_20210408_224244.png](https://archive.blender.org/developer/F9926137/Screenshot_20210408_224244.png) 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.
Author
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Author
Member

Added subscriber: @HDMaster84

Added subscriber: @HDMaster84
Member

Added subscriber: @wannes.malfait

Added subscriber: @wannes.malfait
Member

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.

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.
Author
Member

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.

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.
Contributor

Added subscriber: @KenzieMac130

Added subscriber: @KenzieMac130
Member

Added subscriber: @HooglyBoogly

Added subscriber: @HooglyBoogly
Henrik D. was assigned by Hans Goudey 2021-04-09 15:28:38 +02:00
Member

In #87315#1143320, @wannes.malfait wrote:
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.

> In #87315#1143320, @wannes.malfait wrote: > 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.

This issue was referenced by df2a19eac7

This issue was referenced by df2a19eac7daf4943b22f74890cebd14eb811f4e

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'

Added subscriber: @bjj

Added subscriber: @bjj

Instances have a unique ID (although it seems to be lost when they are meshified?) but assuming the ID could get through it would be very useful for the convex hull node to have a "partition by" input and then you could select "ID" so that you'd get individual convex hulls per unique ID

Instances have a unique ID (although it seems to be lost when they are meshified?) but assuming the ID could get through it would be very useful for the convex hull node to have a "partition by" input and then you could select "ID" so that you'd get individual convex hulls per unique ID
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
7 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#87315
No description provided.