Blending multiple cross sections

calendar_today

06.05.2024

label

Modeling, VEX

mouse

Houdini 20.0

Description

Houdini's sweep node supports multiple cross-sections. We isolate one of its surfaces to blend into all others using multiparm-blocks with curve ramps and VEX.

1 Code

Weighted average positions along the length based on dynamically created channel ramps of each cross section.

C
        // INPUT
int num = chi('sections');
vector uv = vertex(0, 'uv', i@vtxnum);

// WEIGHTS
float weights[];
for(int k = 0; k <= num; k++){
    float weight = chramp('weight' + itoa(k), uv[1]);
    append(weights, weight);
}
float weight_sum = sum(weights);

// POSITIONS
vector pos = vector(0.0);
foreach(int i; float w; weights){
    string grp = "@index==" + itoa(i);
    vector pos_i = uvsample(1, grp, 'P', 'uv', uv);
    pos_i *= weights[i] / weight_sum;
    pos += pos_i;
}

// OUTPUT
v@P = pos;
    
download

Downloads

smart_display

Videos

Blending multiple Cross Sections of Sweeps – Houdini Tutorial

link

Related articles

favorite

135

label

Modeling

Adaptive Resampling of Curves

favorite

279

label

Modeling

Applying Scales to Mesh Surfaces

favorite

222

label

Modeling

Approximating subdivision surfaces

favorite

185

label

Modeling

Blending COPs SDFs into 3D Volume

favorite

269

label

Modeling

Branching Subdivision Curves

favorite

125

label

Modeling

Circuit Networks