Commonplace kernel API
    Preparing search index...

    Function measureSubRegionWallDepth

    • Experimental

      ADR-026 Phase 2(b) — measure the available INWARD wall depth at an inscribed sub-region: how far the sub-region's bump can sweep before it would cross the opposite wall of the host solid.

      1. The inscribed face is innerLoopHalfEdge.twin.face (the same derivation extrudeFaceSubRegionBump uses). Its outer-loop vertices are the window corners; their centroid is the ray origin.
      2. The outward surface normal at that centroid is derived from the host's geometry:
        • Curved host (!isEffectivelyPlanar(host, hostFace)): the per-vertex–averaged RuledSurface.normalAt(host, hostFace, u, v) over the inscribed corners' host (u, v) projections — a representative outward normal of the curved patch under the window. (The bump itself follows the true per-vertex field; for the scalar depth a single representative direction is the right granularity — wall depth is one number.)
        • Planar / faceted host: the inscribed outer loop's Newell normal, which points outward for the CCW-from-outside winding ADR-006 gives inscribed loops. This is exact for a faceted wall (the inscribed face is coplanar with the host quad).
      3. The inward direction is the negated outward normal. A ray is cast from the centroid (nudged a hair inward to clear the origin face) along the inward normal and tested against every host face except the inscribed face and the host wall face the loop sits on (those are co-located with the origin and would self-hit). The nearest hit distance is the wall depth.
      • Nearest opposite hit wins. A non-convex host whose inward ray pierces several faces is handled by taking the first (nearest) hit — the wall whose crossing first turns the bump into a through-cut. This is the conservative, correct choice for the dispatch decision (cross the nearest wall ⇒ through-cut).
      • No opposite face ⇒ +Infinity. An open sheet (the inward ray escapes the solid), or a measurement-frame degeneracy, yields no hit. The dispatcher reads +Infinity as "an inward bump can never cross a wall here" and routes to the bump. This is safe: a bump that doesn't cross a wall is exactly what the kernel-native sweep handles. (Note: the depth is always measured along the INWARD normal — it is a geometric fact independent of the gesture's sign. The outward case is handled by the dispatcher's direction check, not by the depth.)
      • Representative-normal granularity. The depth is one scalar along one representative inward direction. For strongly-curved hosts where the wall depth varies across the window, this is the depth at the window's centroid — the dispatch point. A window that grazes a wall at one corner but not its centroid is out of scope (it would need a per-corner depth field); the single-scalar dispatch matches the single-scalar distance the operation takes.

      Parameters

      • host: HalfEdgeMesh

        The host mesh.

      • hostFace: Face

        The face carrying the inner loop.

      • innerLoopHalfEdge: HalfEdge

        A half-edge on the host's inner loop (.face === hostFace); its twin bounds the inscribed face.

      Returns SubRegionWallDepth

      The measured SubRegionWallDepth.

      If innerLoopHalfEdge.twin has no face (the inner loop is one-sided — no inscribed face to measure from).

      2026-Q2

      experimental — stable-by target: 2027-Q1