# [−][src]Crate line_drawing

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` and `Supercover` - 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

octant | A simple octant struct for transforming line points.
steps | An iterator that returns `(start, end)` tuples from the walk.

## Structs

Bresenham | An implementation of Bresenham's line algorithm.
Bresenham3d | An 3-D implementation of bresenham, sourced from this site.
BresenhamCircle | An implementation of Bresenham's circle algorithm.
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.

## Enums

VoxelOrigin | Where the center of the voxel is, at the center or a corner.

## Traits

FloatNum | All the floating-point primitives.
SignedNum | All the signed integer primitives.

## Type Definitions

Point | A point in 2D space.
Voxel | An point in 3D space.

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g., `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g., `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)