[][src]Module flo_curves::bezier::path

Manipulates multiple Bezier curves joined into a path

The BezierPath trait provides a way to represent a bezier path. flo_curves considers a path to be a single closed loop, unlike many libraries which allow for open paths and paths with subpaths. Instead, a path with multiple subpaths is represented as a collection - ie Vec<impl Path>. This reduces the number of edge cases the library has to deal with.

The path_add(), path_sub() and path_intersect() functions can be used to perform path arithmetic: combining multiple paths into a single result. The GraphPath type is used to implement these functions: it can represent paths where points can have more than one following edge attached to them and provides functions for implementing similar operations.

BezierPathBuilder provides a way to quickly build paths from any type implementing the factory trait without needing to generate all of the primitives manually.

Modules

algorithms

Structs

BezierPathBuilder

Used to build a bezier path

GraphEdge

Represents an edge in a graph path

GraphEdgeRef

Reference to a graph edge

GraphPath

A graph path is a path where each point can have more than one connected edge. Edges are categorized into interior and exterior edges depending on if they are on the outside or the inside of the combined shape.

PathLabel

Label attached to a path used for arithmetic

Enums

CollidedGraphPath

Indicates the result of colliding two graph paths

GraphPathEdgeKind

Kind of a graph path edge

GraphRayCollision

Represents a collision between a ray and a GraphPath

PathCombine

Description of an arithmetic operation to perform on a bezier path

PathDirection

Winding direction of a particular path

Traits

BezierPath

Trait representing a path made out of bezier sections

BezierPathFactory

Trait implemented by types that can construct new bezier paths

PathWithIsClockwise

Trait implemented by paths that can determine if their points are in a clockwise ordering or not

Functions

path_add

Generates the path formed by adding two sets of paths

path_add_chain

Adds multiple paths in a single operation

path_bounding_box

Finds the bounds of a path

path_combine

Performs a series of path combining operations to generate an output path

path_contains_point

Returns true if a particular point is within a bezier path

path_fast_bounding_box

Finds the bounds of a path

path_intersect

Generates the path formed by intersecting two sets of paths

path_intersects_line

Determines the intersections of a path and a line

path_intersects_path

Finds the points where a path intersects another path

path_intersects_ray

Determines the intersections of a path and a ray.

path_remove_interior_points

Generates the path formed by removing any interior points from an existing path. This considers only the outermost edges of the path to be the true edges (so a ring will be treated as a single path)

path_remove_overlapped_points

Generates the path formed by removing any interior points from an existing path. This considers all edges to be exterior edges and will remove those that are obscured by another part of the path.

path_sub

Generates the path formed by subtracting two sets of paths

path_to_curves

Converts a path to a series of bezier curves

points_are_clockwise

Determines if a set of points are in a clockwise ordering (assuming that a positive y value indicates an upwards direction)

Type Definitions

SimpleBezierPath

Basic Bezier path type