VEX Dictionary / pcopen
pcopen
Opens a point cloud query around a position and returns a handle for the other pc functions.
group: ptcloudptcloudfile
Available in every context
Usage
int pcopen(string filename, string channel, int shaded, ...)
int pcopen(string filename, string Pchannel, vector P, float radius, int maxpoints, ...)
int pcopen(string filename, string Pchannel, vector P, string Nchannel, vector N, float radius, int maxpoints, ...)
int pcopen(int opinput, string Pchannel, vector P, float radius, int maxpoints)
Examples
// Point Wrangle, run over Points
int handle = pcopen(0, "P", @P, chf("radius"), chi("maxpts"));
vector avg = pcfilter(handle, "P");
@P = lerp(@P, avg, chf("amount"));
pcclose(handle);int handle = pcopen(0, "P", @P, chf("radius"), 50);
float d = fit(pcnumfound(handle), 0, 50, 0, 1);
@Cd = set(d, 0.2, 1 - d);
pcclose(handle);pcnumfound tells you how many points the query found, which is a cheap way to measure density. Crowded areas turn red and sparse areas blue.
Use cases
- Smoothing and relaxing Average position, normal or colour over a neighbourhood.
- Density and clumping masks Count neighbours to drive scattering, wetmaps or FX emission.
- Transferring attributes Pull filtered values from another input with
pcopen(1, ...).
Signatures (from vcc -X)
int pcopen(int, string, vector, float, int)all contextsint pcopen(string, string, int, ...)all contextsint pcopen(string, string, vector, float, int, ...)all contextsint pcopen(string, string, vector, string, vector, float, int, ...)all contexts