目录
pcfind_radius —— 返回最近点的列表(考虑半径)
pcunshaded —— 迭代读写通道内所有点(通道没有被写入任何数据)
pcimport —— 在pciterate或pcunshaded循环内导入点云通道数据
pcexport —— 在pciterate或pcunshaded循环内写入数据到点云
pcclose —— 关闭对应pcopen函数的handle
pcline_radius —— 返回在指定方向上点的列表(考虑半径)
pccone_radius —— 返回在指定圆锥上点的列表(考虑半径)
pcsegment_radius —— 返回在指定线段上点的列表(考虑半径)
pcfind —— 返回最近点的列表
int [] pcfind(<geometry>geometry, string Pchannel, vector P, float radius, int maxpoints) int [] pcfind(<geometry>geometry, string ptgroup, string Pchannel, vector P, float radius, int maxpoints) int [] pcfind(<geometry>geometry, string Pchannel, vector P, float radius, int maxpoints, float &distances[]) int [] pcfind(<geometry>geometry, string ptgroup, string Pchannel, vector P, float radius, int maxpoints, float &distances[])
pcfind_radius —— 返回最近点的列表(考虑半径)
int [] pcfind_radius(<geometry>geometry, string Pchannel, string RadChannel, float radscale, vector P, float radius, int maxpoints) int [] pcfind_radius(<geometry>geometry, string ptgroup, string Pchannel, string RadChannel, float radscale, vector P, float radius, int maxpoints) int [] pcfind_radius(<geometry>geometry, string Pchannel, string RadChannel, float radscale, vector P, float radius, int maxpoints, float &distances[]) int [] pcfind_radius(<geometry>geometry, string ptgroup, string Pchannel, string RadChannel, float radscale, vector P, float radius, int maxpoints, float &distances[])
pcopen —— 打开点云文件的handle
- 此函数打开点云文件(.pc),并排队访问其中包含的点;然后可使用pcunshaded、pciterate迭代点;
- 当使用pcopen()与pciterate()时,点将由近到远存储;
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)
int handle = pcopen(texturename, "P", P, maxdistance, maxpoints);
while (pcunshaded(handle, "irradiance"))
{
pcimport(handle, "P", cloudP);
pcimport(handle, "N", cloudN);
ir = computeIrraciance(cloudP, cloudN);
pcexport(handle, "irradiance", ir);
}
pcfilter(handle, radius, "irradiance", ir);
pcfilter —— 过滤由pcopen找到的点
<type> pcfilter(int handle, string channel_name, ...)
//此函数等价于,越近权重越高
float pcfilter(int handle; string channel)
{
float sum, w, d;
float value, result = 0;
while (pciterate(handle))
{
pcimport(handle, "point.distance", d);
pcimport(handle, channel, value);
w = 1 - smooth(0, radius, d);
sum += w;
result += w * value;
}
result /= sum;
return result;
}
pcfarthest —— 返回到最大点的距离
- 如未搜索到点,则返回一个非常大的值(-2147483648=1.0×10^37);
float pcfarthest(int handle)
pcnumfound —— 返回pcopen找到的点数
int pcnumfound(int handle)
pcsize —— 返回点云内点的总数
int pcsize(int handle)
pciterate —— 迭代点云内所有点
int pciterate(int handle)
pcunshaded —— 迭代读写通道内所有点(通道没有被写入任何数据)
int pcunshaded(int handle, string channel_name)
pcimport —— 在pciterate或pcunshaded循环内导入点云通道数据
- 此函数仅在pciterate、pcunshaded循环内有效;
int pcimport(int handle, string channel_name, <type>&value)
pcexport —— 在pciterate或pcunshaded循环内写入数据到点云
int pcexport(int handle, string channel_name, <type>value, ...) int pcexport(int handle, string channel_name, vector value, float radius, ...)
pcclose —— 关闭对应pcopen函数的handle
void pcclose(int &handle)
- VEX会自动关闭句柄,但调用此函数是好习惯;
- 如循环中不调用此函数,可能占用额外空间;
pcwrite —— 将数据写入到点云
int pcwrite(string filename, ...)
pgfind —— 返回最近点的列表
- 类似pcfind,不同在于使用grid-based的加速结构;
- 使用正确的divsize,可更快的初始化和查找;如使用近似恒定的搜索半径搜索点云,则该半径可以用作divsize;
- divsize不可每点变化;
int [] pgfind(<geometry>geometry, vector P, float radius, int maxpoints, float divsize) int [] pgfind(<geometry>geometry, string ptgroup, vector P, float radius, int maxpoints, float divsize)
pcline —— 返回在指定方向上点的列表
int [] pcline(<geometry>geometry, string PChannel, vector P, vector dir, float max_distance, int maxpoints) int [] pcline(<geometry>geometry, string ptgroup, string PChannel, vector P, vector dir, float max_distance, int maxpoints)
//detail层级,10000个原点位置点,搜索10000个尺寸为1的box内点
i[]@pts = pcline(1, 'P', @P, chv('dir'), 0.5, chi('maspoints'));
foreach(int pt; @pts)
{
vector pos = point(1, 'P', pt);
setpointattrib(0, 'P', pt, pos);
}
pcline_radius —— 返回在指定方向上点的列表(考虑半径)
int [] pcline_radius(<geometry>geometry, string PChannel, string RadChannel, float radscale, vector P, vector dir, float max_distance, int maxpoints) int [] pcline_radius(<geometry>geometry, string ptgroup, string PChannel, string RadChannel, float radscale, vector P, vector dir, float max_distance, int maxpoints)
pccone —— 返回在指定圆锥上点的列表
int [] pccone(<geometry>geometry, string PChannel, vector P, vector dir, float angle, float max_distance, int maxpoints) int [] pccone(<geometry>geometry, string ptgroup, string PChannel, vector P, vector dir, float angle, float max_distance, int maxpoints)
//detail层级,10000个原点位置点,搜索10000个尺寸为1的box内点
i[]@pts = pccone(1, 'P', @P, chv('dir'), radians(ch('angle')), 0.5, chi('maspoints'));
foreach(int pt; @pts)
{
vector pos = point(1, 'P', pt);
setpointattrib(0, 'P', pt, pos);
}
pccone_radius —— 返回在指定圆锥上点的列表(考虑半径)
int [] pccone_radius(<geometry>geometry, string PChannel, string RadChannel, float radscale, vector P, vector dir, float angle, float max_distance, int maxpoints) int [] pccone_radius(<geometry>geometry, string ptgroup, string PChannel, string RadChannel, float radscale, vector P, vector dir, float angle, float max_distance, int maxpoints)
pcsegment —— 返回在指定线段上点的列表
int [] pcsegment(<geometry>geometry, string PChannel, vector P0, vector P1, float max_distance, int maxpoints) int [] pcsegment(<geometry>geometry, string ptgroup, string PChannel, vector P0, vector P1, float max_distance, int maxpoints) int [] pcsegment(<geometry>geometry, string PChannel, vector P0, vector P1, float max_distance, int maxpoints, float &distances[]) int [] pcsegment(<geometry>geometry, string ptgroup, string PChannel, vector P0, vector P1, float max_distance, int maxpoints, float &distances[])
//detail层级,10000个原点位置点,搜索10000个尺寸为1的box内点
i[]@pts = pcsegment(1, 'P', {-0.1,0,0}, {0.1,0,0}, 0.2, chi('maspoints'));
foreach(int pt; @pts)
{
vector pos = point(1, 'P', pt);
setpointattrib(0, 'P', pt, pos);
}
pcsegment_radius —— 返回在指定线段上点的列表(考虑半径)
int [] pcsegment_radius(<geometry>geometry, string PChannel, string RadChannel, float radscale, vector P0, vector P1, float max_distance, int maxpoints) int [] pcsegment_radius(<geometry>geometry, string ptgroup, string PChannel, string RadChannel, float radscale, vector P0, vector P1, float max_distance, int maxpoints) int [] pcsegment_radius(<geometry>geometry, string PChannel, string RadChannel, float radscale, vector P0, vector P1, float max_distance, int maxpoints, float &distances[]) int [] pcsegment_radius(<geometry>geometry, string ptgroup, string PChannel, string RadChannel, float radscale, vector P0, vector P1, float max_distance, int maxpoints, float &distances[])
pcopenlod —— 打开点云文件的handle
- 此函数打开点云文件(.pc),并排队访问其中包含的点;然后可使用pcunshaded、pciterate迭代点,并使用pcexport将新数据添加到点云;
- 此函数类似pcopen,主要区别在于它排队的点可能是整组点的集合;
int pcopenlod(string filename, string Pchannel, vector P, int min_pts, ...)
pcgenerate —— 生成点云
int pcgenerate(string filename, int npoints)
pcconvex —— 计算2D投射的凸包面积
float pcconvex(int handle, string channel, vector N)