Commonplace kernel API
    Preparing search index...

    Function carveSubRegionThroughHost

    • Experimental

      Cut a through-window in a host mesh, given the window's outline as an array of corner positions.

      Preconditions:

      • corners.length >= 3 (degenerate-polygon throw otherwise).
      • The corners form a non-degenerate planar polygon (Newell normal of non-zero magnitude — checked by addPolygonPrismShell).
      • |depth| > 1e-9 — the absolute through-cut depth.
      • host has no inner loops on any face (the composer-substrate's converter doesn't yet handle holed input; see scope note above).

      Side-effect contract: success mutates host in place by replacing its topology with the composed host − sweptPrism result. Failure leaves host untouched (validation throws before any mutation; a composer-bridge-not-ready response returns false without mutation).

      Parameters

      • host: HalfEdgeMesh

        The mesh the window is being punched into. Must not carry any inner loops at call time; if Phase 1's authoring step has been used to inscribe a loop, the caller should either pass a pre-authoring snapshot or accept that the composer will reject the holed input.

      • cornersIn: readonly Vec3Like[]
      • depth: number

        Signed through-cut depth along the corners' Newell normal. The sign chooses inward vs. outward sweep; the magnitude is the depth.

      • composeIn: "cutter-frame" | "model-frame" = 'cutter-frame'

        'cutter-frame' (the default) composes in the frame the prism is square to (cutterFrame), which is what keeps a cutter whose caps or walls lie in the host's own faces exact off-axis. 'model-frame' is for a cutter already in general position (the disc drill starts clear of its wall and ends past it): it has no such planes to keep, and the model's frame keeps whatever its outline shares with the model's axes.

      • Optionalcurves: readonly EdgeCurveJSON[]

      Returns boolean

      true on successful carve. Returns false only when the polyhedral composer's WASM bridge isn't loaded yet (the caller can retry after a few ms).

      If preconditions fail (degenerate depth, fewer than 3 corners, degenerate corner polygon, composer rejection).

      2026-Q2

      experimental — stable-by target: 2027-Q1