Skip to content

Get

Input from ancillary

vex
//where 1 is the input 2 of the attribute wrangles node
@P = point(1,"P",@ptnum);

Get number of points from ancillary

vex
// detail mode
int numpnts = npoints(1);
printf("%g" , numpnts);

Bounding box from second input (1)

vex
// Get bounding box from second input
vector bbox = getbbox_max(1);
// set/create new vector with only one component
vector maxy = set(0, bbox.y, 0);
v@P = v@P + maxy;

Get the Component of a Matrix

vex
float some_val = getcomp(4@transform, 0, 1);
printf("%f", some_val);

getcomp-vexreference

Get Point Neighbors

vex
// point wrangle, points that share an edge
i[]@Neighbors = neighbours(0, @ptnum);
// or sorted
i[]@Neighbors = sort(neighbours(0, @ptnum));

Get Interpolated Value from pcloud

vex
// run over points
int samples = chi("samples");
float radius = chf("radius");
int handle = pcopen(1, "P", @P, radius, samples);
vector rest = pcfilter(handle, 'rnml');
v@rnml = rest;

Interpolated Values from xyzdist and primuv

vex
// run over points
int posprim;
vector param_uv;
float maxdist = 10;
float dist = xyzdist(1,@P,posprim,param_uv,maxdist);
float curveu = primuv(1,"curveu",posprim,param_uv);
vector tangentu = primuv(1,"tangentu",posprim,param_uv);
f@curveu = curveu;
v@tangentu = tangentu;

source: The joy of xyzdist() and primuv()