AutoMovie API
    Preparing search index...

    Function legalizeAutoMovieSolidMesh

    • Flip a triangulation's free diagonals until each is locally Delaunay in the face's uniform metric: the constrained Delaunay triangulation (Lawson 1977).

      A boundary-only ear triangulation fans a dense rail into triangles of its own consecutive vertices before any interior point exists, and an interior insertion never revisits them. Three points of one curve span its osculating plane, which for a rail on a curved skin stands across the skin, so those triangles stand edge-on and can face inward. Legalization flips a diagonal whose quadrilateral's fourth vertex lies strictly inside the circumcircle of a triangle. An ear's tip is convex, so the circle of three nearly collinear rail vertices bulges into the face and holds the opposite vertex; such a diagonal always flips, joining the tip to the interior.

      The in-circle test reads the chart with phase multiplied by scale: Delaunay under a uniform anisotropic metric (George and Borouchaki 1998, Delaunay Triangulation and Meshing, parametric surfaces), here the face's mean first fundamental form without its shear term. The scale carries the length unit (millimetres of skin per radian), so a body in another unit scales station and scaled phase alike and reads the same decisions up to the rounding of nearly cocircular quadruples, the premise the planner's other rounded admissions already state. The in-circle sign is exact on the represented scaled points of one canonical cover, and that one constant linear map keeps Lawson's termination: a flip lowers the lifted paraboloid surface, so a removed edge never returns and at most n (n - 1) / 2 flips occur for n vertices (Edelsbrunner 2001, Geometry and Topology for Mesh Generation); a longer run is a named failure.

      A face whose metric changes across it is legalized in its local first fundamental form instead (local): each quadrilateral is read about its own centroid under the form its four points span, shear included, the anisotropic Delaunay criterion of the same authors with the metric frozen per test. A face's mean scale left the trunk's triangles beside the armscye's loop, where the skin spans twice the mean per radian, 4 to 7 degrees thin on the skin; read without the shear, a twisted band took the longer diagonal of its quads. A flip and its reverse read one quadrilateral and so one form, so no pair of flips undoes itself; the lifting argument no longer bounds longer cycles, and the same flip count stays the named failure.

      Every source constraint (trim, domain and retained-cell boundaries) is fixed, so the rails, their vertices and the seam they share with another face are unchanged. A flip is admitted only when both new triangles keep the planner's own rules: positive chart orientation, a represented strict interior, a sub-half-period phase span (strict when indexed), a new vertex pair absent from the face's edges, its constraints and the occupied global pairs. Each quadrilateral is read in one canonical cover, its least vertex ID's occurrence at lift zero, so a flip and its reverse read the same four represented points. Free diagonals are visited in triangle and corner order, and every flip queues its four outer sides in that order.

      Parameters

      • vertices: ReadonlyMap<number, readonly [number, number]>

        Indexed native chart positions; no coordinate changes.

      • constraints: readonly IAutoMovieSolidMeshConstraints.ISegment[]

        Subdivided source constraints, never flipped.

      • triangles: readonly IAutoMovieSolidMeshPlan.ITriangle[]

        Positive triangle occurrences covering the region once.

      • period: number | undefined

        Positive phase period, absent for a planar chart.

      • indexed: boolean

        Whether the consumer drops lifts into a global index buffer, which forbids a half-period span.

      • occupied: ReadonlySet<string> | undefined

        Prior global endpoint pairs minID/maxID a new diagonal cannot reuse.

      • scale: number

        Phase scale of the uniform metric, positive and finite, in length units per radian.

      • Optionallocal: (
            ids: readonly number[],
            charts: readonly [number, number][],
        ) => [number, number]

        A quadrilateral's own first fundamental form from its four vertex IDs and their chart points in its cover, as [shear, scale] for the map (u, v) -> (u + shear v, scale v), read in place of scale, so the face is Delaunay in the metric each quadrilateral spans; absent, scale holds everywhere with no shear. A flip and its reverse read the same four points and so the same form.

      Returns string | IAutoMovieSolidMeshPlan.ITriangle[]

      New positive triangle occurrences over the same region and vertices, or the broken premise.