EarClipTriangulator
interludesoftware.tick¶
Interlude.Tick¶
EarClipTriangulator Class¶
Ear-clipping triangulator for simple 2D polygons.
Input: List<Vector2> defining the polygon outline (CW or CCW).
Output: Unity Mesh with triangles on the XY plane.
Inheritance System.Object → EarClipTriangulator
Methods¶
EarClipTriangulator.Triangulate(List\<Vector2>) Method¶
Triangulate a polygon and return a new Mesh. Convenience allocator for one-shot callers and tests; the Drawer's per-frame hot path uses the fill-into-target overload below with a pooled mesh so it allocates nothing.
Parameters¶
polygon System.Collections.Generic.List<UnityEngine.Vector2>
Returns¶
EarClipTriangulator.Triangulate(List\<Vector2>, Mesh) Method¶
Triangulate a polygon into the supplied result mesh, clearing and refilling it in place. Lets the caller reuse a pooled mesh rather than allocate one per call.
Parameters¶
polygon System.Collections.Generic.List<UnityEngine.Vector2>
result UnityEngine.Mesh