Crate line_drawing[−][src]
Expand description
A collection of line-drawing algorithms for use in graphics and video games.
Currently implemented:
Bresenham
- An implementation of Bresenham’s line algorithm.Bresenham3d
- A 3-Dimensional implementation of bresenham.BresenhamCircle
- Bresenham’s circle algorithm.Midpoint
- The mid-point line algorithm.WalkGrid
andSupercover
- implemented from this article by Red Blob Games.WalkVoxels
- A similar 3-Dimensional algorithm that only takes orthogonal steps.XiaolinWu
- Xiaolin Wu’s line algorithm.
Modules
A simple octant struct for transforming line points.
An iterator that returns (start, end)
tuples from the walk.
Structs
An implementation of Bresenham’s line algorithm.
An 3-D implementation of bresenham, sourced from this site.
An implementation of Bresenham’s circle algorithm.
An implementation of the mid-point line drawing algorithm.
Like WalkGrid
but takes diagonal steps if the line passes directly over a corner.
Walk along a grid, taking only orthogonal steps.
Walk between two voxels, taking orthogonal steps and visiting all voxels in between.
An implementation of Xiaolin Wu’s line algorithm.
Enums
Whether the center or corner of a voxel is aligned with the “grid”.