DriftCapture · function

segmentGeometry

Regions from the geometry alone: runs of triangles that share a plane.

Explained in DriftCapture.

function segmentGeometry(mesh: MeshData, options?: SegmentOptions): Region[]
import { segmentGeometry } from '@driftengine/capture';

Parameters

ParameterTypeDescription
meshMeshData
options?SegmentOptions

In depth

Two triangles join when they share an edge and their normals agree within the crease angle. Two surfaces that are parallel but apart — a table top and the floor under it — stay apart because they share no edge, not because anything measured the gap.

A plane offset is deliberately not compared, and the reason is worth keeping. It was, and the check could never say what it claimed: two triangles either side of a shared edge both contain that edge, so equal normals force equal offsets, and unequal normals make the difference grow with distance from the origin — the same crease would join near the origin and split far from it, on a capture whose origin is wherever the first camera happened to stand.