Skip to content

LineTessellator

ClassChartGuruChartGuru
public static class LineTessellator

CPU-side line tessellator shared by sinks that cannot natively emit line primitives (for example UITKMeshDrawSink, whose UnityEngine.UIElements.MeshGenerationContext only accepts indexed triangles). Produces mitered quad strokes matching the visual weight of a single-pixel AA line in the GL path.

The class is intentionally stateless and fully allocation-free on repeated calls: callers pass in reusable output lists that the tessellator appends to.

TessellatePolyline(IReadOnlyList, float, bool, List)

Section titled “TessellatePolyline(IReadOnlyList, float, bool, List)”
public static void TessellatePolyline(IReadOnlyList<Vector2> points, float width, bool closed, List<Vector2> outTriangles)

Tessellates a polyline into a triangle list forming a mitered stroke of width pixels.

Parameters

Name Type Description
points System.Collections.Generic.IReadOnlyList{UnityEngine.Vector2} Sequence of polyline vertices in chart-space pixels.
width System.Single Stroke width in pixels (total, not half-width).
closed System.Boolean True to connect the last point back to the first.
outTriangles System.Collections.Generic.List{UnityEngine.Vector2} Output list of triangle vertices (appended 3-at-a-time).

TessellateLines(IReadOnlyList, float, List)

Section titled “TessellateLines(IReadOnlyList, float, List)”
public static void TessellateLines(IReadOnlyList<Vector2> pairs, float width, List<Vector2> outTriangles)

Tessellates an independent line list (pairs of points forming disjoint segments). Matches ChartGuru.DrawTopology.Lines semantics.

Parameters

Name Type Description
pairs System.Collections.Generic.IReadOnlyList{UnityEngine.Vector2}
width System.Single
outTriangles System.Collections.Generic.List{UnityEngine.Vector2}