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

417

label

VEX

Attribute to match across inputs

favorite

311

label

VEX

Sphere Packing / Dart Throwing Algorithm

favorite

331

label

VEX

Deintersecting spheres with Voronoi

favorite

371

label

VEX

Fitting Planes to Point Clouds

favorite

363

label

VEX

How to Analyze VEX Code

favorite

215

label

VEX

Monte Carlo Geometry Processing