Skip to main content

Crate shape

Crate shape 

Source
Expand description

This module defines primitive shapes. The origin is (0, 0) for 2D primitives and (0, 0, 0) for 3D primitives, unless stated otherwise.

Modules§

prelude
The shape prelude.

Structs§

Aabb2d
A 2D axis-aligned bounding box, or bounding rectangle
Aabb3d
A 3D axis-aligned bounding box
AabbCast2d
An intersection test that casts an Aabb2d along a ray.
AabbCast3d
An intersection test that casts an Aabb3d along a ray.
Annulus
A primitive shape formed by the region between two circles, also known as a ring.
Arc2d
A primitive representing an arc between two points on a circle.
BoundingCircle
A bounding circle
BoundingCircleCast
An intersection test that casts a BoundingCircle along a ray.
BoundingSphere
A bounding sphere
BoundingSphereCast
An intersection test that casts a BoundingSphere along a ray.
Capsule2d
A 2D capsule primitive, also known as a stadium or pill shape.
Capsule3d
A 3D capsule primitive centered on the origin A three-dimensional capsule is defined as a surface at a distance (radius) from a line
Circle
A circle primitive, representing the set of points some distance from the origin
CircularSector
A primitive representing a circular sector: a pie slice of a circle.
CircularSegment
A primitive representing a circular segment: the area enclosed by the arc of a circle and its chord (the line between its endpoints).
Cone
A cone primitive centered on the midpoint between the tip of the cone and the center of its base.
ConicalFrustum
A conical frustum primitive. A conical frustum can be created by slicing off a section of a cone.
ConvexPolygon
A convex polygon with N vertices.
Cuboid
A cuboid primitive, which is like a cube, except that the x, y, and z dimensions are not required to be the same.
Cylinder
A cylinder primitive centered on the origin
Ellipse
An ellipse primitive, which is like a circle, but the width and height can be different
Extrusion
A 3D shape representing an extruded 2D base_shape.
HalfSpace
A region of 3D space, specifically an open set whose border is a bisecting 2D plane.
InfinitePlane3d
An unbounded plane in 3D space. It forms a separating surface through the origin, stretching infinitely far
Line2d
An infinite line going through the origin along a direction in 2D space.
Line3d
An infinite line going through the origin along a direction in 3D space.
Plane2d
An unbounded plane in 2D space. It forms a separating surface through the origin, stretching infinitely far
Plane3d
A bounded plane in 3D space. It forms a surface starting from the origin with a defined height and width.
Polygon
A polygon with N vertices.
Polyline2d
A series of connected line segments in 2D space.
Polyline3d
A series of connected line segments in 3D space.
Ray2d
An infinite half-line starting at origin and going in direction in 2D space.
Ray3d
An infinite half-line starting at origin and going in direction in 3D space.
RayCast2d
A raycast intersection test for 2D bounding volumes
RayCast3d
A raycast intersection test for 3D bounding volumes
Rectangle
A rectangle primitive, which is like a square, except that the width and height can be different
RegularPolygon
A polygon centered on the origin where all vertices lie on a circle, equally far apart.
Rhombus
A rhombus primitive, also known as a diamond shape. A four sided polygon, centered on the origin, where opposite sides are parallel but without requiring right angles.
Ring
A 2D shape representing the ring version of a base shape.
Segment2d
A line segment defined by two endpoints in 2D space.
Segment3d
A line segment defined by two endpoints in 3D space.
Sphere
A sphere primitive, representing the set of all points some distance from the origin
Tetrahedron
A tetrahedron primitive.
Torus
A torus primitive, often representing a ring or donut shape The set of points some distance from a circle centered at the origin
Triangle2d
A triangle in 2D space
Triangle3d
A 3D triangle primitive.
ViewFrustum
A region of 3D space defined by the intersection of 6 HalfSpaces.

Enums§

ConvexPolygonError
An error that happens when creating a ConvexPolygon.
TorusKind
The type of torus determined by the minor and major radii
WindingOrder
The winding order for a set of points

Traits§

Bounded2d
A trait with methods that return 2D bounding volumes for a shape.
Bounded3d
A trait with methods that return 3D bounding volumes for a shape.
BoundedExtrusion
A trait implemented on 2D shapes which determines the 3D bounding volumes of their extrusions.
BoundingVolume
A trait that generalizes different bounding volumes. Bounding volumes are simplified shapes that are used to get simpler ways to check for overlapping elements or finding intersections.
Inset
A primitive that can be resized uniformly.
IntersectsVolume
A trait that generalizes intersection tests against a volume. Intersection tests can be used for a variety of tasks, for example:
Measured2d
A trait for getting measurements of 2D shapes
Measured3d
A trait for getting measurements of 3D shapes
Primitive2d
A marker trait for 2D primitives
Primitive3d
A marker trait for 3D primitives
ToRing
Provides a convenience method for converting a primitive to a Ring, with a given thickness.

Functions§

is_polygon_simple
Tests whether the vertices describe a simple polygon. The last vertex must not be equal to the first vertex.