containment.containsPoints
Whether each point is inside a triangle mesh by the point-in-solid rule (|winding number| > ½), certified on the GPU or computed on the CPU.
Usage
containsPoints(positions: Float64Array, indices: Uint32Array, points: Float64Array, options?: ContainsOptions): Promise<ContainsAnswer>Parameters
positionsFloat64ArrayMesh points as x, y, z triples. Required. In model.
indicesUint32ArrayThree point indices per triangle; a triangle with an index out of range or a non-finite corner takes no part.
pointsFloat64ArrayQuery points as x, y, z triples. Required. In model.
optionsContainsOptionsprefer (auto, cpu, gpu), deterministic (auto, yes, no), and the host’s measured cost model or crossover in query × triangle pairs. Default
{}.
Returns
One boolean per point, and how it ran: backend, the router’s reason, precision class "certified", and how many points the GPU and the CPU decided.
Guarantees
- the answers are bit-identical on every route: the GPU’s f32 sum is trusted only where its error bound proves the side of ½, and kernel-3d’s certified FastWindingNumber.is_inside answers every other point
- The same result on every machine, whichever hardware runs it.
Example
typeof containsPoints // → "function"