VEX —— Functions|Point Clouds

Houdini点云函数介绍
该博客主要介绍了Houdini中一系列点云相关函数,如pcfind、pcopen、pcfilter等。涵盖了返回最近点列表、打开点云文件、过滤点、迭代点云等功能,还说明了各函数的使用方法及特点,如pcopen可用于打开文件并排队访问点,pcclose能关闭对应句柄等。

目录

pcfind —— 返回最近点的列表

pcfind_radius —— 返回最近点的列表(考虑半径)

pcopen —— 打开点云文件的handle

pcfilter —— 过滤由pcopen找到的点

pcfarthest —— 返回到最大点的距离

pcnumfound —— 返回pcopen找到的点数

pcsize —— 返回点云内点的总数

pciterate —— 迭代点云内所有点

pcunshaded —— 迭代读写通道内所有点(通道没有被写入任何数据)

pcimport —— 在pciterate或pcunshaded循环内导入点云通道数据

pcexport —— 在pciterate或pcunshaded循环内写入数据到点云

pcclose —— 关闭对应pcopen函数的handle

pcwrite —— 将数据写入到点云

pgfind —— 返回最近点的列表

pcline —— 返回在指定方向上点的列表

pcline_radius —— 返回在指定方向上点的列表(考虑半径)

pccone —— 返回在指定圆锥上点的列表

pccone_radius —— 返回在指定圆锥上点的列表(考虑半径)

pcsegment —— 返回在指定线段上点的列表

pcsegment_radius —— 返回在指定线段上点的列表(考虑半径)

pcopenlod —— 打开点云文件的handle

pcgenerate —— 生成点云

pcconvex —— 计算2D投射的凸包面积


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)
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值