Crate lyon_path  
Available on crate feature 
geometry only.Expand description
Data structures and traits to work with paths (vector graphics).
To build and consume paths, see the builder and iterator modules.
This crate is reexported in lyon.
§Examples
use lyon_path::Path;
use lyon_path::math::{point};
use lyon_path::builder::*;
// Create a builder object to build the path.
let mut builder = Path::builder();
// Build a simple path.
let mut builder = Path::builder();
builder.begin(point(0.0, 0.0));
builder.line_to(point(1.0, 2.0));
builder.line_to(point(2.0, 0.0));
builder.line_to(point(1.0, 1.0));
builder.close();
// Generate the actual path object.
let path = builder.build();
for event in &path {
    println!("{:?}", event);
}Modules§
- builder
- Path building utilities.
- commands
- A generic representation for paths that allow more control over how endpoints and control points are stored.
- geom
- Simple 2D geometric primitives on top of euclid.
- iterator
- Tools to iterate over paths.
- math
- f32 version of the lyon_geom types used everywhere. Most other lyon crates reexport them.
- path
- The default path data structure.
- path_buffer 
- A container to store multiple paths contiguously.
- polygon
- Specific path types for polygons.
- traits
- lyon_pathtraits reexported here for convenience.
Structs§
- ArcFlags
- Flag parameters for arcs as described by the SVG specification.
- AttributeSlice 
- A view over a contiguous storage of custom attributes.
- BuilderImpl 
- The default builder for Path.
- BuilderWith Attributes 
- A builder for Pathwith custom attributes.
- ControlPoint Id 
- ID of a control point in a path.
- EndpointId 
- ID of an endpoint point in a path.
- EventId
- Refers to an event in a path.
- IdIter
- An iterator of endpoint and control point ids for PathandPathSlice.
- IdPolygon
- A view over a sequence of endpoint IDs forming a polygon.
- Iter
- An iterator for PathandPathSlice.
- IterWith Attributes 
- An iterator for PathandPathSlice.
- Path
- A simple path data structure.
- PathBuffer 
- An object that stores multiple paths contiguously.
- PathBuffer Slice 
- A view on a PathBuffer.
- PathCommands 
- The commands of a path encoded in a single array using IDs to refer to endpoints and control points externally.
- PathCommands Slice 
- A view over PathCommands.
- PathSlice 
- A view on a Path.
- Polygon
- A view over a sequence of endpoints forming a polygon.
- Reversed
- An iterator of over a Pathtraversing the path in reverse.
Enums§
- Event
- Represents an event or edge of path.
- FillRule 
- The fill rule defines how to determine what is inside and what is outside of the shape.
- LineCap
- Line cap as defined by the SVG specification.
- LineJoin 
- Line join as defined by the SVG specification.
- Side
- The positive or negative side of a vector or segment.
- Winding
- The two possible orientations for the edges of a shape to be built in.
Constants§
- NO_ATTRIBUTES 
- An empty attribute slice.
Traits§
- AttributeStore 
- Interface for objects storing custom attributes associated with endpoints.
- Position
- Interface for types types (typically endpoints and control points) that have a 2D position.
- PositionStore 
- Interface for objects storing endpoints and control points positions.
Type Aliases§
- AttributeIndex 
- An alias for usize.
- Attributes
- An alias for a slice of f32values.
- Builder
- IdEvent
- A path event representing endpoints and control points as IDs.
- PathEvent 
- A path event representing endpoints and control points as positions.