What it does
Opens a point cloud of the nearest points around each point and averages an attribute over that neighbourhood. It is how you blur or smooth an attribute (here Cd) across nearby geometry without changing topology.
When to use it
Reach for it when you want a spatial average - smoothing colour, density or any attribute over the points near each point. It is the building block behind grain removal, soft falloffs and cheap diffusion-style looks.
The VEX code
// Open a cloud of up to 16 points within radius 1.0 of @P,
// then average Cd over that neighbourhood.
int handle = pcopen(0, "P", @P, 1.0, 16);
@Cd = pcfilter(handle, "Cd");
pcclose(handle);
Inputs and assumptions
- Input 0 has the points you are searching, with a
Pattribute (always present) and the attribute you are averaging (Cdhere). - The radius (
1.0) and max point count (16) control the neighbourhood size - scale the radius to your geometry. - Runs per point in an Attribute Wrangle over points.
Common mistakes
- Forgetting
pcclose(handle), which leaks the handle - always close what you open. - A radius that is too large or a max count that is too high makes it slow on dense geometry; tune both.
- Averaging an attribute that does not exist on the cloud returns zero - check the attribute name and input.
- Expecting it to find points across a gap larger than the radius; increase the radius or it finds nothing.
Frequently asked questions
What does pcopen do in Houdini?
pcopen opens a point cloud - a handle to the nearest points within a radius - so you can read or average their attributes with pcfilter or pcimport before closing it with pcclose.
How do I average a different attribute?
Change the attribute name in pcfilter, for example pcfilter(handle, "N") to average normals, and make sure that attribute exists on the input.