Skip to main content

Module shape

Module shape 

Source
Expand description

Geometric representations of common shapes in N-dimensional space.

Geometric primitives defined in this package are designed to be lightweight representations of geometry, independent of a global reference. This design makes struct suitible for use with simulation code, and ensures shapes are constructible from minimal information.

For shapes with parameterizable dimension, a const N: usize generic parameter encodes the dimensionality.

Structs§

Capsule
All points less than or equal to a distance r from a line segment of length h.
ConvexPolytope
A faceted solid defined by the convex hull of its vertices.
Cylinder
A circle with normal [0 0 1] swept by h/2 in the +z and -z directions.
EightEight
A regular octagon in two-dimensional hyperbolic space.
HyperbolicConvexPolytope
A faceted hyperbolic solid defined by the convex hull of its vertices.
Hypercuboid
A shape with with all perpendicular angles made from axis-aligned edges.
Hyperellipsoid
The geometry resulting from an Hypersphere that is scaled along the Cartesian axes.
Hypersphere
All points within a given radius from the origin.
Simplex3
The hull of any 4 noncoplanar points in three dimensions.
Sphero
Round a shape with a given radius.

Type Aliases§

Circle
A circle in two dimensions.
ConvexPolygon
A faceted convex body in two dimensions.
ConvexPolyhedron
A faceted convex body in three dimensions.
Cuboid
An axis-aligned cuboid.
Ellipse
A circle scaled along the x and y axes.
Ellipsoid
A sphere scaled along the x, y, and z axes.
HyperbolicConvexPolygon
A two-dimensional hyperbolic convex polytope.
Rectangle
An axis-aligned rectangle.
Sphere
A sphere in three dimensions.
Spherocylinder
A sphere swept along a line segment in $\mathbb{R}^3$.