Sampling more points on the surface

Four ways to turn bigpointcloud_001.ply (11,357 points) into a fixed-budget point cloud, each scored against the object's true surface — motherboard.stl, 477,957 triangles, 445.1 units² — rather than against the input cloud.

Why score against the mesh? The input .ply is itself only a sparse sampling of the board. Measuring a downsample against it would reward reproducing the input's own gaps. Both files sit in the same coordinate frame, so the STL can serve as ground truth.

Interactive comparison

Pick a cloud in each pane and drag to orbit — the two cameras are locked together. Start with voxel 4096 against surface_pd 4096 to see the difference in evenness, or put input next to dense surface to see what the extra points buy.

3-D viewer could not load three.js from the CDN. The static renders below show the same clouds.

The strategies

namewhat it does
randomRandom subsample of the input cloud — the usual one-liner.
voxelVoxel downsample of the input cloud; voxel size bisected to hit the budget exactly. The trivial good baseline.
surfaceDraw 200,000 Poisson-disk points on the mesh surface, then voxel-downsample that to the budget. This is voxel_downsample.py --surface-points 200000 --target-points N.
surface_pdPoisson-disk sample the mesh straight at the budget — no downsampling step at all.

Numbers

accuracy — distance from each point to the true surface. Lower = points really lie on the object. coverage — distance from 500,000 uniform mesh samples to the nearest cloud point. Lower = fewer bald patches. NN CV — spread of nearest-neighbour spacing ÷ its mean. 0 = perfectly even.
Read cov max with care. On this mesh the one-sided Hausdorff is decided by a handful of reference samples landing on an isolated sliver at the base of the board — for the input cloud it is a single point out of 500,000. cov p99.9 is the honest worst-case column; cov max is kept only because it is the number people usually quote.

What actually changed

The ceiling, not the budget

At a fixed budget the surface route is not a coverage win over plain voxel downsampling: at 4,096 points, voxel reaches 0.1295 mean / 0.2661 p99.9 coverage and surface reaches 0.1316 / 0.2639. Those are the same number. Anyone hoping "sample the mesh instead" would fix coverage at 4k points should not bother.

The win is that there is no ceiling. The input cloud tops out at 11,357 points with 0.0799 mean coverage; the dense surface resample reaches 0.0187 — 4.3× better — and keeps going as high as you ask. Screw holes, mounting bosses and pad edges that the scan simply never sampled show up in the top-down render below.

Accuracy is where sampling the mesh is unbeatable

surface_pd points lie on the surface by construction: accuracy is 0.0000 at every budget, against 0.0156 mean / 0.0606 p95 for voxel. Both voxel-based routes average the points inside each voxel, and near an edge or a corner that centroid floats off the surface — which is also why surface (0.0196) is very slightly worse than voxel here despite starting from points that were exactly on the mesh.

Evenness

Poisson-disk gives a nearest-neighbour CV of 0.09 versus 0.25 for voxel and 0.32 for random — blue noise, visibly regular in the viewer. Voxel downsampling is the only method with a deterministic coverage bound though (no occupied voxel is ever dropped), which is why surface is the one strategy whose cov max stays near its p99.9 instead of blowing up on the sliver.

Which to use

For feeding PointNet++ at 1,024–4,096 points from a cloud you already have, voxel is fine and random is not. If a mesh exists, surface_pd at the budget is strictly better on accuracy and evenness for the same cost. The dense surface resample is worth it when the input's own sampling density — not the budget — is the limit.

Static renders

Isometric (top row) and top-down (bottom). All fixed-budget clouds are 4,096 points.

Six point clouds rendered from two viewpoints: input, dense surface, random, voxel, surface, surface_pd