Crate line_drawing [] [src]

A collection of line-drawing algorithms for use in graphics and video games.

Currently implemented:

Modules

octant

A simple octant struct for transforming line points.

steps

An iterator that returns (start, end) tuples from the walk.

Structs

Bresenham3d

An 3-D implementation of bresenham, sourced from this site.

Midpoint

An implementation of the mid-point line drawing algorithm.

Supercover

Like WalkGrid but takes diagonal steps if the line passes directly over a corner.

WalkGrid

Walk along a grid, taking only orthogonal steps.

WalkVoxels

Walk between two voxels, taking orthogonal steps and visiting all voxels in between.

XiaolinWu

An implementation of Xiaolin Wu's line algorithm.

Functions

bresenham

A simple wrapper around bresenham-rs that includes the end point.

bresenham_3d

A convenience function to collect the points from Bresenham3d into a Vec.

bresenham_sorted

Sorts the points before hand to ensure that the line is symmetrical and collects into a VecDeque.

midpoint

A convenience function to collect the points from Midpoint into a Vec.

midpoint_sorted

Sorts the points before hand to ensure that the line is symmetrical and collects into a VecDeque.

supercover

A convenience function to collect the points from Supercover into a Vec.

walk_grid

A convenience function to collect the points from WalkGrid into a Vec.

walk_grid_sorted

Sorts the points before hand to ensure that the line is symmetrical and collects into a VecDeque.

walk_voxels

A convenience function to collect the points from WalkVoxels into a Vec.

xiaolin_wu

A convenience function to collect the points from XiaolinWu into a Vec.

xiaolin_wu_sorted

Sorts the points before hand to ensure that the line is symmetrical and collects into a VecDeque.

Type Definitions

Point

A point in 2D space.

Voxel

An point in 3D space.