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.

GeometricSince 0.10.0

Usage

TypeScript
containsPoints(positions: Float64Array, indices: Uint32Array, points: Float64Array, options?: ContainsOptions): Promise<ContainsAnswer>

Parameters

  • positionsFloat64Array

    Mesh points as x, y, z triples. Required. In model.

  • indicesUint32Array

    Three point indices per triangle; a triangle with an index out of range or a non-finite corner takes no part.

    Required

  • pointsFloat64Array

    Query points as x, y, z triples. Required. In model.

  • optionsContainsOptions

    prefer (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

TypeScript
typeof containsPoints // → "function"