Skip to main content

Crate emblema_geometry

Crate emblema_geometry 

Source
Expand description

Path types and tessellation.

Everything is tessellated. A convex path takes a fan fill, which avoids both the sweep and the stencil pass, and everything else goes through the general fill — so path::Path::convexity is what chooses between them.

Detection is conservative in one direction only: a wrong Concave answer costs speed, and a wrong Convex answer renders incorrectly, because a fan applies no fill rule and cannot express what filling a self-crossing path means. That asymmetry is why the classifier measures how far a polygon turns in total rather than only whether its turns agree.

Not implemented, and named here because this header described it as though it were: analytic coverage for rects, rounded rects, circles and ellipses, computed in the fragment shader instead of tessellating. There is no rounded rect or ellipse in this crate at all, and a circle is four cubics that get flattened like any other curve. It is the intended shape – it is where most of the draw calls in a real interface land – rather than something that exists.

Re-exports§

pub use flatten::flatten;
pub use flatten::DEFAULT_TOLERANCE;
pub use path::Convexity;
pub use path::FillRule;
pub use path::Path;
pub use path::PathBuilder;
pub use path::Rect;
pub use path::Verb;
pub use path::MAX_COORDINATE;
pub use stroke::LineCap;
pub use stroke::LineJoin;
pub use stroke::StrokeStyle;
pub use tessellate::Tessellator;
pub use tessellate::VertexBuffers;
pub use transform::invert_to_local;
pub use transform::max_scale;
pub use transform::to_local_columns;
pub use transform::transform_points;
pub use transform::unbounded;
pub use transform::viewport_projection;
pub use transform::Transform2D;

Modules§

dash
Cutting a path into the pieces a dash pattern leaves behind.
flatten
Adaptive Bezier flattening.
path
Path representation.
stroke
Stroke style.
superellipse
Flutter’s rounded superellipse – the iOS-style squircle.
tessellate
Turning paths into triangles.
transform
Mapping user space onto clip space.