Point clouds

Average an Attribute with pcopen

The classic point-cloud blur: open a cloud of nearby points with pcopen, then average an attribute over them with pcfilter.

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);
Context: paste this into an Attribute Wrangle running over points, unless noted otherwise.

Inputs and assumptions

Common mistakes

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.

Open Houdini VEX Lab