Skip to main content

emblema_geometry/
lib.rs

1//! Path types and tessellation.
2//!
3//! Everything is tessellated. A convex path takes a fan fill, which avoids
4//! both the sweep and the stencil pass, and everything else goes through the
5//! general fill — so [`path::Path::convexity`] is what chooses between them.
6//!
7//! Detection is conservative in one direction only: a wrong `Concave` answer
8//! costs speed, and a wrong `Convex` answer renders incorrectly, because a fan
9//! applies no fill rule and cannot express what filling a self-crossing path
10//! means. That asymmetry is why the classifier measures how far a polygon
11//! turns in total rather than only whether its turns agree.
12//!
13//! **Not implemented**, and named here because this header described it as
14//! though it were: analytic coverage for rects, rounded rects, circles and
15//! ellipses, computed in the fragment shader instead of tessellating. There is
16//! no rounded rect or ellipse in this crate at all, and a circle is four
17//! cubics that get flattened like any other curve. It is the intended shape --
18//! it is where most of the draw calls in a real interface land -- rather than
19//! something that exists.
20
21pub mod dash;
22pub mod flatten;
23pub mod path;
24pub mod stroke;
25pub mod superellipse;
26pub mod tessellate;
27pub mod transform;
28
29pub use flatten::{flatten, DEFAULT_TOLERANCE};
30pub use path::{Convexity, FillRule, Path, PathBuilder, Rect, Verb, MAX_COORDINATE};
31pub use stroke::{LineCap, LineJoin, StrokeStyle};
32pub use tessellate::{Tessellator, VertexBuffers};
33pub use transform::{
34    invert_to_local, max_scale, to_local_columns, transform_points, unbounded, viewport_projection,
35    Transform2D,
36};