iced_renderer::geometry::path::lyon_path

Crate geom

Available on crate feature geometry only.
Expand description

Simple 2D geometric primitives on top of euclid.

This crate is reexported in lyon.

§Overview.

This crate implements some of the maths to work with:

  • lines and line segments,
  • quadratic and cubic bézier curves,
  • elliptic arcs,
  • triangles.

§Flattening

Flattening is the action of approximating a curve with a succession of line segments.

The tolerance threshold taken as input by the flattening algorithms corresponds to the maximum distance between the curve and its linear approximation. The smaller the tolerance is, the more precise the approximation and the more segments are generated. This value is typically chosen in function of the zoom level.

The figure above shows a close up on a curve (the dotted line) and its linear approximation (the black segments). The tolerance threshold is represented by the light green area and the orange arrow.

Modules§

arc
Elliptic arc related maths and tools.
arrayvec
arrayvec provides the types ArrayVec and ArrayString: array-backed vector and string types, which store their contents inline.
cubic_bezier
euclid
A collection of strongly typed math tools for computer graphics with an inclination towards 2d graphics and layout.
quadratic_bezier
traits
utils

Structs§

Angle
An angle in radians
Arc
An elliptic arc curve segment.
ArcFlags
Flag parameters for arcs as described by the SVG specification.
CubicBezierSegment
A 2d curve segment defined by four points: the beginning of the segment, two control points and the end of the segment.
Line
An infinite line defined by a point and a vector.
LineEquation
A line defined by the equation a * x + b * y + c = 0; a * a + b * b = 1.
LineSegment
A linear segment.
QuadraticBezierSegment
A 2d curve segment defined by three points: the beginning of the segment, a control point and the end of the segment.
SvgArc
An elliptic arc curve segment using the SVG’s end-point notation.
Triangle
A 2D triangle defined by three points a, b and c.

Traits§

Scalar
Segment
Common APIs to segment types.

Functions§

point
Shorthand for Point::new(x, y).
size
Shorthand for Size::new(x, y).
vector
Shorthand for Vector::new(x, y).

Type Aliases§

Box2D
Point
Rotation
Alias for euclid::default::Rotation2D
Scale
Size
Transform
Alias for euclid::default::Transform2D
Translation
Alias for euclid::default::Translation2D
Vector