Module primitives

Module primitives 

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.

Structs§

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.
BoxedPolygon
A polygon with a variable number of vertices, allocated on the heap in a Box<[Vec2]>.
BoxedPolyline2d
A series of connected line segments in 2D space, allocated on the heap in a Box<[Vec2]>.
BoxedPolyline3d
A series of connected line segments in 3D space, allocated on the heap in a Box<[Vec3]>.
Capsule2d
A 2D capsule primitive, also known as a stadium or pill shape.
Capsule3d
A 3D capsule primitive. A three-dimensional capsule is defined as a surface at a distance (radius) from a line
Circle
A circle primitive
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.
Cuboid
A cuboid primitive, more commonly known as a box.
Cylinder
A cylinder primitive
Ellipse
An ellipse primitive
Extrusion
A 3D shape representing an extruded 2D base_shape.
InfinitePlane3d
An unbounded plane in 3D space. It forms a separating surface through the origin, stretching infinitely far
Line2d
An infinite line along a direction in 2D space.
Line3d
An infinite line 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.
Rectangle
A rectangle primitive
RegularPolygon
A polygon where all vertices lie on a circle, equally far apart.
Rhombus
A rhombus primitive, also known as a diamond shape.
Segment2d
A segment of a line along a direction in 2D space.
Segment3d
A segment of a line along a direction in 3D space.
Sphere
A sphere primitive
Tetrahedron
A tetrahedron primitive.
Torus
A torus primitive, often representing a ring or donut shape
Triangle2d
A triangle in 2D space
Triangle3d
A 3D triangle primitive.

Enums§

TorusKind
The type of torus determined by the minor and major radii
WindingOrder
The winding order for a set of points

Traits§

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