Put all point positions into an array and make parameter "t" slide e.g. from 0 to 1 inside a for loop.
int steps = chi('steps');
vector all_points[];
resize(all_points, npoints(0));
for (int i = 0; i < npoints(0); i++){
all_points[i] = point(0, "P", i);
}
int prim = addprim(0, "polyline");
for(int i = 0; i < steps; i++){
float slide = i / float(steps - 1);
vector pos = spline("catrom", slide, all_points);
int inter_pt = addpoint(0, pos);
addvertex(0, prim, inter_pt);
}
Also a simple function for interpolating 4 points to a curve by yourself would be:
int steps = chi('steps');
vector pt0 = point(0, "P", 0);
vector pt1 = point(0, "P", 1);
vector pt2 = point(0, "P", 2);
vector pt3 = point(0, "P", 3);
int prim = addprim(0, "polyline");
for(int i = 0; i < steps; i++) {
float slide = i / float(steps - 1);
vector pos0 = lerp(pt0, pt1, slide);
vector pos1 = lerp(pt2, pt3, slide);
vector ipol = lerp(pos0, pos1, slide);
int inter_pt = addpoint(0, ipol);
addvertex(0, prim, inter_pt);
}
VEX_spline.hipnc