Skip to content

Scientific geometry

Point clouds ​

scenes/point-clouds
const { positions, scalars } = shell(count);
const cloud = plot.uploadPoints({ positions, scalars });
plot.showPoints(cloud);
plot.frameScene();
return { readout: `${count.toLocaleString("en-GB")} points` };

Calls

3 in the code above, in the order it makes them

plot.uploadPoints(points: PointSet): PointsHandle

Upload a point cloud and return a handle naming it.

plot.showPoints(handle: PointsHandle): void

Draw the point cloud handle names.

plot.frameScene(): void

Point the camera at the middle of everything uploaded, far enough back to see it.

Call after uploading. A scene measured in grid cells or in millimetres is nowhere near where a camera starts, and without this the first thing a caller sees is an empty canvas.