pub struct Tessellator { /* private fields */ }
Expand description

Converts Shapes into triangles (Mesh).

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

Se also tessellate_shapes, a convenient wrapper around Tessellator.

Implementations

Create a new Tessellator.

  • font_tex_size: size of the font texture. Required to normalize glyph uv rectangles when tessellating text.
  • prepared_discs: What TextureAtlas::prepared_discs returns. Can safely be set to an empty vec.

Set the Rect to use for culling.

Tessellate a clipped shape into a list of primitives.

Tessellate a single Shape into a Mesh.

This call can panic the given shape is of Shape::Vec or Shape::Callback. For that, use Self::tessellate_clipped_shape instead.

  • shape: the shape to tessellate.
  • out: triangles are appended to this.

Tessellate a single CircleShape into a Mesh.

  • shape: the circle to tessellate.
  • out: triangles are appended to this.

Tessellate a single Mesh into a Mesh.

  • mesh: the mesh to tessellate.
  • out: triangles are appended to this.

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

  • shape: the mesh to tessellate.
  • out: triangles are appended to this.

Tessellate a single PathShape into a Mesh.

  • path_shape: the path to tessellate.
  • out: triangles are appended to this.

Tessellate a single Rect into a Mesh.

  • rect: the rectangle to tessellate.
  • out: triangles are appended to this.

Tessellate a single TextShape into a Mesh.

  • text_shape: the text to tessellate.
  • out: triangles are appended to this.

Tessellate a single QuadraticBezierShape into a Mesh.

  • quadratic_shape: the shape to tessellate.
  • out: triangles are appended to this.

Tessellate a single CubicBezierShape into a Mesh.

  • cubic_shape: the shape to tessellate.
  • out: triangles are appended to this.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.