Module nannou::geom[][src]

Expand description

Types, functions and other items related to geometry. This module is the source of all graphics and lazer primitives and aids work in 2D and 3D space.

Each module provides a set of general tools for working with the named geometry including:

  • A typed, object representation.
  • Functions for producing vertices, triangles and triangulation indices.
  • Functions for checking whether or not the geometry contains a point.
  • Functions for determining the bounding rectangle or cuboid.
  • A function for finding the centroid.

Re-exports

pub use self::path::path;
pub use self::path::Path;

Modules

cuboid

Items related to cube geometry.

ellipse
path

Items related to working with paths for 2D geometry and vector graphics.

point

Implementation of the Point types.

polygon
quad
range

A type for working with one-dimensional ranges.

rect
scalar
tri
vector
vertex

Structs

Cuboid

A light-weight Cuboid type with many helper and utility methods.

DVec2

A 2-dimensional vector.

DVec3

A 3-dimensional vector.

DVec4

A 4-dimensional vector.

Ellipse

A simple ellipse type with helper methods around the ellipse module’s functions.

IVec2

A 2-dimensional vector.

IVec3

A 3-dimensional vector.

IVec4

A 4-dimensional vector.

Padding

The distance between the inner edge of a border and the outer edge of the inner content.

Polygon

A simple type wrapper around a list of points that describe a polygon.

Quad

A quad represented by its four vertices.

Range

Some start and end position along a single axis.

Rect

Defines a Rectangle’s bounds across the x and y axes.

Tri

A triangle as three vertices.

Vec2

A 2-dimensional vector.

Vec3

A 3-dimensional vector without SIMD support.

Vec4

A 4-dimensional vector.

Enums

Align

Describes alignment along a range.

Corner

Either of the four corners of a Rect.

Edge

Represents either the Start or End Edge of a Range.

Traits

Scalar

Implemented for all numeric scalar types used within geom.

Vertex

Types used as vertices that can be used to describe geometric points in space.

Vertex2d

Vertex types that have at least 2 dimensions.

Vertex3d

Vertex types that have at least 3 dimensions.

Functions

bounding_cuboid

The Cuboid that bounds the given sequence of vertices.

bounding_rect

The Rect that bounds the given sequence of vertices.

centroid

The centroid (average position) of all vertices in the given iterator.

dvec2

Creates a 2-dimensional vector.

dvec3

Creates a 3-dimensional vector.

dvec4

Creates a 4-dimensional vector.

ivec2

Creates a 2-dimensional vector.

ivec3

Creates a 3-dimensional vector.

ivec4

Creates a 4-dimensional vector.

pt2

Construct a 2-dimensional point.

pt3

Construct a 3-dimensional point.

pt4

Construct a 4-dimensional point.

vec2

Creates a 2-dimensional vector.

vec3

Creates a 3-dimensional vector.

vec4

Creates a 4-dimensional vector.

Type Definitions

Point2

A 2-dimensional point type.

Point3

A 3-dimensional point type.

Point4

A 4-dimensional point type.

Vector2Deprecated

A common alias for the glam::Vec2 type.

Vector3Deprecated

A common alias for the glam::Vec3 type.

Vector4Deprecated

A common alias for the glam::Vec4 type.