S or /

SourceClass Tessellator

from egui import Tessellator
class Tessellator:

Converts Shapes into triangles (Mesh).

For performance reasons it is smart to reuse the same Tessellator.

Methods§

Sourcedef set_clip_rect(self, /, clip_rect: Rect) -> None§

Set the Rect to use for culling.

Sourcedef tessellate_circle(self, /, shape: CircleShape, out: Mesh) -> None§

Tessellate a single CircleShape into a Mesh.

  • shape: the circle to tessellate.
  • out: triangles are appended to this.
Sourcedef tessellate_clipped_shape(self, /, clipped_shape: Any) -> list[ClippedPrimitive]§

Tessellate a clipped shape into a list of primitives.

Sourcedef tessellate_cubic_bezier(self, /, cubic_shape: CubicBezierShape, out: Mesh) -> None§

Tessellate a single CubicBezierShape into a Mesh.

  • cubic_shape: the shape to tessellate.
  • out: triangles are appended to this.
Sourcedef tessellate_ellipse(self, /, shape: EllipseShape, out: Mesh) -> None§

Tessellate a single EllipseShape into a Mesh.

  • shape: the ellipse to tessellate.
  • out: triangles are appended to this.
def tessellate_line(self, /, points: Sequence[Pos2], stroke: Stroke, out: Mesh) -> None§
Sourcedef tessellate_line_segment(self, /, points: Sequence[Pos2], stroke: Stroke, out: Mesh) -> None§

Tessellate a line segment between the two points with the given stroke into a Mesh.

  • shape: the mesh to tessellate.
  • out: triangles are appended to this.
Sourcedef tessellate_mesh(self, /, mesh: Mesh, out: Mesh) -> None§

Tessellate a single Mesh into a Mesh.

  • mesh: the mesh to tessellate.
  • out: triangles are appended to this.
Sourcedef tessellate_path(self, /, path_shape: PathShape, out: Mesh) -> None§

Tessellate a single PathShape into a Mesh.

  • path_shape: the path to tessellate.
  • out: triangles are appended to this.
Sourcedef tessellate_quadratic_bezier(self, /, quadratic_shape: QuadraticBezierShape, out: Mesh) -> None§

Tessellate a single QuadraticBezierShape into a Mesh.

  • quadratic_shape: the shape to tessellate.
  • out: triangles are appended to this.
Sourcedef tessellate_rect(self, /, shape: RectShape, mesh: Mesh) -> None§

Tessellate a single Rect into a Mesh.

  • rect: the rectangle to tessellate.
Sourcedef tessellate_shape(self, /, shape: Any, mesh: Mesh) -> None§

Tessellate a single Shape into a Mesh.

This call can panic the given shape is of Shape.Vec or Shape.Callback. For that, use egui.Tessellator.tessellate_clipped_shape instead. * shape: the shape to tessellate.

Sourcedef tessellate_shapes(self, /, shapes: Any) -> list[ClippedPrimitive]§

Turns Shape:s into sets of triangles.

The given shapes will tessellated in the same order as they are given. They will be batched together by clip rectangle.

  • pixels_per_point: number of physical pixels to each logical point
  • options: tessellation quality
  • shapes: what to tessellate
  • font_tex_size: size of the font texture. Required to normalize glyph uv rectangles when tessellating text.
  • prepared_discs: What egui.TextureAtlas.prepared_discs returns. Can safely be set to an empty vec.

The implementation uses a Tessellator.

Returns

A list of clip rectangles with matching Mesh.

Sourcedef tessellate_text(self, /, shape: TextShape, out: Mesh) -> None§

Tessellate a single TextShape into a Mesh.

  • out: triangles are appended to this.