Deintersecting spheres with Voronoi

calendar_today

21.04.2024

label

VEX

mouse

Houdini 18.0

Description

Deintersecting overlapping spheres by iteratively extending voronoi diagrams based on point scales.

1 Code

Point wrangle inside a SOP solver node:

C
        int nbs[] = neighbours(0, i@ptnum);

foreach(int nb; nbs){
    vector pos_nb = point(0, 'P', nb);
    float scale_nb = point(0, 'pscale', nb);
    float dist_nb = distance(v@P, pos_nb);
    vector dir_nb = normalize(v@P - pos_nb);
    if(dist_nb < (scale_nb + f@pscale)){
        v@P += dir_nb * 0.01;
    }
}
    
download

Downloads

link

Related articles

favorite

370

label

VEX

Attribute to match across inputs

favorite

247

label

VEX

Sphere Packing / Dart Throwing Algorithm

favorite

315

label

VEX

Fitting Planes to Point Clouds

favorite

318

label

VEX

How to Analyze VEX Code

favorite

153

label

VEX

Monte Carlo Geometry Processing

favorite

146

label

VEX

Predicate Incircles from 3 points