fill_mesh
Mojo function 🡭
fill_mesh
fn def fill_mesh(mut canvas: Canvas, points: List[FPoint], faces: List[Int], colors: List[Color])Many adjacent triangles in one call, drawn as one anti-aliased shape: no seam along an edge two faces share, and anti-aliasing only at the outline of the whole. Faces are drawn in the order given, so a mesh sorted back to front composites the way the painter’s algorithm expects where faces overlap.
This is what a surface plot draws. Filling each face on its own
with fill_path_aa leaves a light line along every shared edge,
because each face’s edge coverage blends against the background
rather than against its neighbour (#425).
Under a transform the vertices map to device space first, as every batched primitive’s geometry does. Inside a batch or a supersampled region the whole call records as one op. A degenerate face (zero area) draws nothing; a face wound either way draws the same.
Args:
- canvas (
Canvas): Canvas to draw on. - points (
List[FPoint]): The vertices, in the canvas’s coordinates. - faces (
List[Int]): Index triples intopoints, one triangle each, in draw order. - colors (
List[Color]): One color per triangle, same count as triples.
Raises:
Error: faces is not whole triples, an index is out of range,
or colors is not one per triangle.