Curves from Ramp Parameters

calendar_today

16.05.2026

label

VEX

mouse

Houdini 20.5

Description

Create polygon curves from a curve ramp parameter by looping over its positions, values, and interpolation parameters.

1 Linear Curve Ramps

Creates a linear curve from a linear ramp.

CPP
        float shape = chramp('shape', 0.0);
int num = chi('shape');

int pts[] = {};

for(int i = 1; i <= num; i++){
    string name = 'shape' + itoa(i);
    float x = chf(name + 'pos');
    float y = chf(name + 'value');
    
    int pt = addpoint(0, set(x, y, 0.0));
    append(pts, pt);
}

addprim(0, 'polyline', pts);
    

2 Interpolated Curve Ramps

Shapes an existing line with many segments according to the ramp.

CPP
        float u = vertexcurveparam(0, i@vtxnum);
float shape = chramp('shape', u);

int num = chi('shape');

vector p[];
resize(p, num);

string basis[];
resize(basis, num);

for(int i = 0; i < num; i++){
    string name = 'shape' + itoa(i + 1);
    float x = chf(name + 'pos');
    float y = chf(name + 'value');
    p[i] = set(x, y, 0.0); 
    basis[i] = chs(name + 'interp');
}

v@P = spline(basis, u, p);
    
download

Downloads

link

Related articles

favorite

435

label

VEX

Attribute to Match across Inputs

favorite

367

label

VEX

Sphere Packing / Dart Throwing Algorithm

favorite

389

label

VEX

Deintersecting spheres with Voronoi

favorite

427

label

VEX

Fitting Planes to Point Clouds

favorite

418

label

VEX

How to Analyze VEX Code

favorite

274

label

VEX

Monte Carlo Geometry Processing