[][src]Crate lyon_path

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.move_to(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);
}

Re-exports

pub use lyon_geom as geom;

Modules

builder

Tools to build path objects from a sequence of imperative commands.

commands

A generic representation for paths that allow more control over how endpoints and control points are stored.

iterator

Tools to iterate over paths.

math

Basic types that are used everywhere. Most other lyon crates reexport them.

polygon

Specific path types for polygons.

Structs

ArcFlags

Flag parameters for arcs as described by the SVG specification.

AttributeSlice

A view over a contiguous storage of custom attributes.

Builder

Builds path objects.

BuilderWithAttributes

Builds path objects with custom attributes.

ControlPointId

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 Path and PathSlice.

Iter

An iterator for Path and PathSlice.

IterWithAttributes

An iterator for Path and PathSlice.

Path

A simple path data structure.

PathSlice

A view on a Path.

PathState

Represents the current state of a path while it is being built.

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.

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 Definitions

IdEvent

A path event representing endpoints and control points as IDs.

PathEvent

A path event representing endpoints and control points as positions.