Crate line_drawing [−] [src]
A collection of line-drawing algorithms for use in graphics and video games.
Currently implemented:
bresenham
throughbresenham-rs
.- The mid-point line algorithm.
- Xiaolin Wu's line algorithm.
WalkGrid
andSupercover
implemented from this article by Red Blob Games.Bresenham3d
- A 3-Dimensional implementation of bresenham.WalkVoxels
- A similar 3-Dimensional algorithm that only takes orthogonal steps.
Modules
octant |
A simple octant struct for transforming line points. |
steps |
An iterator that returns |
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 |
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_3d |
A convenience function to collect the points from |
bresenham_sorted |
Sorts the points before hand to ensure that the line is symmetrical and collects into a
|
midpoint |
A convenience function to collect the points from |
midpoint_sorted |
Sorts the points before hand to ensure that the line is symmetrical and collects into a
|
supercover |
A convenience function to collect the points from |
walk_grid |
A convenience function to collect the points from |
walk_grid_sorted |
Sorts the points before hand to ensure that the line is symmetrical and collects into a
|
walk_voxels |
A convenience function to collect the points from |
xiaolin_wu |
A convenience function to collect the points from |
xiaolin_wu_sorted |
Sorts the points before hand to ensure that the line is symmetrical and collects into a
|
Type Definitions
Point |
A point in 2D space. |
Voxel |
An point in 3D space. |