Voronoi cells in volumes

calendar_today

08.05.2022

label

Organic

mouse

Houdini 19.0

Description

Converting a closed mesh into smooth voronoi cells and cell boundaries.

1 Code

Voronoi cells in a volume, point cloud in second input.

CPP
        float radius = chf('radius');

int pts[] = nearpoints(1, v@P, 1e3);
vector pos_0 = point(1, 'P', pts[0]);
vector pos_1 = point(1, 'P', pts[1]);
float dist_0 = distance(v@P, pos_0);
float dist_1 = distance(v@P, pos_1);
float dist = dist_1 - dist_0;

f@surface = -min(dist - radius, -f@surface);
    

Replace the last line by this to invert for cell boundaries:

CPP
        f@surface = max(dist - radius, f@surface);
    

2 Shading point colors

Let's shade the point colors using the mask by feature and the ray-node and a bit of color adjustments. The color can be set randomly per connected piece.

3 Occlusion

The mask from feature-node adds a blurred occlusion pass and a shadowmask for later use.

4 Color bleeding

The ray node gathers surrounding surface colors along with ray distances for some fake Global Illumination.

5 Glossiness

For glossiness we calculate the dot product of the surface normals and the up vector multiplied by the shadowmask for blocking.

download

Downloads

smart_display

Videos

3D Voronoi Cells in Volumes – Houdini Tutorial

link

Related articles

favorite

222

label

Organic

Banana from Sweep SOP

favorite

131

label

Organic

Static Cloth and Soft Body Solver

favorite

140

label

Organic

Collision Deformer with Wrinkles

favorite

202

label

Organic

Damaging surfaces using volume noise

favorite

108

label

Organic

Dinosaur from curves inside volumes

favorite

160

label

Organic

Donut with sprinkles