Expand description
§use-geometry
use-geometry is the feature-gated facade crate for the RustUse geometry workspace.
It reexports the focused child crates that make up the set so callers can depend on one crate for pure geometry primitives, descriptors, notation, validation errors, and direct measurement helpers while implementation stays split into explicit child crates.
The facade contains only crate-level documentation, public reexports, feature-gated child-crate
namespaces, and the prelude module. Many child crates begin with minimal primitives and metadata
rather than full algorithms.
§Taxonomy
| Group | Reexported crates |
|---|---|
| Foundations | use-coordinate, use-dimension, use-angle, use-point |
| Affine and Euclidean primitives | use-bounds, use-line, use-ray, use-segment, use-plane, use-hyperplane, use-circle, use-sphere, use-hypersphere, use-torus |
| Transformations | use-transform, use-affine, use-projection, use-reflection, use-inversion |
| Metric and relational geometry | use-distance, use-orientation, use-intersection, use-containment, use-congruence, use-similarity, use-dihedral |
| Curves and conics | use-conic, use-curve, use-polyline, use-bezier, use-spline |
| Surfaces and manifolds | use-surface, use-manifold |
| Planar regions | use-triangle, use-rectangle, use-polygon |
| Polytopes and solids | use-simplex, use-orthotope, use-polytope, use-polyhedron, use-regular-polytope, use-archimedean, use-catalan-solid, use-johnson-solid |
| Polytope notation and classification | use-schlafli, use-wythoff, use-coxeter, use-uniform-polytope |
| Incidence, projective geometry, and configurations | use-incidence, use-projective, use-configuration, use-duality |
| Representations and complexes | use-mesh, use-face, use-cell, use-geometric-complex |
| Constructions and decompositions | use-hull, use-triangulation, use-tessellation, use-voronoi, use-delaunay |
| Folding and unfolding | use-folding, use-crease, use-origami, use-linkage, use-unfolding, use-rigid-folding, use-polyhedral-net |
§Installation
[dependencies]
use-geometry = "0.2.1"The default feature set enables full, which reexports every child crate. Disable default features
when you want a smaller facade surface:
[dependencies]
use-geometry = { version = "0.2.1", default-features = false, features = ["point", "schlafli", "regular-polytope"] }Every child crate has a matching feature name without the use- prefix. Hyphenated feature names
use underscore namespace modules, such as regular-polytope through use_geometry::regular_polytope.
The line feature depends on the use-line package while exposing the use_line library through
use_geometry::line. The complex feature depends on the use-geometric-complex package while
exposing the use_complex library through use_geometry::complex.
§Example
use use_geometry::{
Aabb2, Circle, Line2, Orientation2, Point2, RegularPolytope4, Segment2, Sphere,
Triangle, try_orientation_2d,
};
let a = Point2::try_new(0.0, 0.0)?;
let b = Point2::try_new(4.0, 0.0)?;
let c = Point2::try_new(0.0, 3.0)?;
let segment = Segment2::try_new(a, b)?;
let triangle = Triangle::try_new(a, b, c)?;
let circle = Circle::try_new(a, 3.0)?;
let line = Line2::try_from_points(a, b)?;
let bounds = Aabb2::from_points(a, c);
let sphere = Sphere::new(3.0).expect("valid sphere");
assert_eq!(segment.midpoint(), Point2::new(2.0, 0.0));
assert_eq!(triangle.area(), 6.0);
assert_eq!(try_orientation_2d(a, b, c)?, Orientation2::CounterClockwise);
assert_eq!(sphere.diameter(), 6.0);
assert!(circle.contains_point(Point2::new(0.0, 3.0)));
assert!(line.contains_point(Point2::new(2.0, 0.0)));
assert!(bounds.contains_point(Point2::new(0.0, 1.5)));
assert_eq!(RegularPolytope4::TwentyFourCell.schlafli_symbol().to_string(), "{3, 4, 3}");§Notes
- Root exports are feature-gated reexports from child crates.
- Namespace modules such as
point,schlafli, andregular_polytopemirror child crates. - The prelude reexports the same child crate surface through enabled features.
- Named objects belong inside family crates, not standalone crates.
use-vectorremains in theuse-mathworkspace and is used directly by child crates that need vector types.- The
use-geometric-complexpackage provides geometric complex and cell-complex vocabulary; theuse-complexpackage remains the sibling math complex-number crate.
Re-exports§
pub use use_affine as affine;pub use use_angle as angle;pub use use_archimedean as archimedean;pub use use_bezier as bezier;pub use use_bounds as bounds;pub use use_catalan_solid as catalan_solid;pub use use_cell as cell;pub use use_circle as circle;pub use use_complex as complex;pub use use_configuration as configuration;pub use use_congruence as congruence;pub use use_conic as conic;pub use use_containment as containment;pub use use_coordinate as coordinate;pub use use_coxeter as coxeter;pub use use_crease as crease;pub use use_curve as curve;pub use use_delaunay as delaunay;pub use use_dihedral as dihedral;pub use use_dimension as dimension;pub use use_distance as distance;pub use use_duality as duality;pub use use_face as face;pub use use_folding as folding;pub use use_hull as hull;pub use use_hyperplane as hyperplane;pub use use_hypersphere as hypersphere;pub use use_incidence as incidence;pub use use_intersection as intersection;pub use use_inversion as inversion;pub use use_johnson_solid as johnson_solid;pub use use_line as line;pub use use_linkage as linkage;pub use use_manifold as manifold;pub use use_mesh as mesh;pub use use_orientation as orientation;pub use use_origami as origami;pub use use_orthotope as orthotope;pub use use_plane as plane;pub use use_point as point;pub use use_polygon as polygon;pub use use_polyhedral_net as polyhedral_net;pub use use_polyhedron as polyhedron;pub use use_polyline as polyline;pub use use_polytope as polytope;pub use use_projection as projection;pub use use_projective as projective;pub use use_ray as ray;pub use use_rectangle as rectangle;pub use use_reflection as reflection;pub use use_regular_polytope as regular_polytope;pub use use_rigid_folding as rigid_folding;pub use use_schlafli as schlafli;pub use use_segment as segment;pub use use_similarity as similarity;pub use use_simplex as simplex;pub use use_sphere as sphere;pub use use_spline as spline;pub use use_surface as surface;pub use use_tessellation as tessellation;pub use use_torus as torus;pub use use_transform as transform;pub use use_triangle as triangle;pub use use_triangulation as triangulation;pub use use_unfolding as unfolding;pub use use_uniform_polytope as uniform_polytope;pub use use_voronoi as voronoi;pub use use_wythoff as wythoff;
Modules§
- prelude
- Prelude reexports for the RustUse geometry facade.
Structs§
- Aabb2
- An axis-aligned bounding box represented by inclusive minimum and maximum corners.
- Affine
Pair - A pair of affine weights for two points.
- Angle
- An angle stored in radians.
- Bar
- A bar connecting two joints.
- Cell
- A cell used by geometric complex crates.
- Cell
Complex - A collection of geometric cells.
- Circle
- A circle in 2D Euclidean space.
- Congruence
Tolerance - A non-negative tolerance for congruence-style comparisons.
- Conic
- A small conic descriptor.
- Convex
Hull2 - A 2D convex hull point set descriptor.
- Coordinate2
- A raw two-dimensional coordinate pair.
- Coordinate3
- A raw three-dimensional coordinate triple.
- Coxeter
Diagram - A Coxeter diagram record.
- Coxeter
Edge - An edge in a Coxeter diagram.
- Coxeter
Node - A node in a Coxeter diagram.
- Crease
- A crease segment in a flat pattern.
- Cube
- A cube.
- Cubic
Bezier2 - A cubic Bezier curve in 2D.
- Cuboid
- A rectangular cuboid.
- Curve
Parameter - A normalized curve parameter in
[0, 1]. - Curve
Sample2 - A sampled 2D curve point.
- Delaunay
Triangulation - A Delaunay triangulation represented by indexed triangles.
- Dihedral
Angle - A dihedral angle stored as an
Angle. - Dimension
- A positive spatial dimension count.
- Double
Six - Two rows of six labels used in double-six configurations.
- Dual
- A named dual pair.
- Duality
- Metadata describing a duality relationship.
- Edge
- A polyhedron edge represented by vertex indices.
- Ellipse
- An ellipse represented by a center and two positive radii.
- Face
- A face boundary represented by vertex indices.
- Five
Cell - Marker for the 5-cell.
- Fold
State - A fold assignment with an angle.
- Geometric
Complex - A general geometric complex count summary.
- Geometric
Configuration - Basic point-line configuration metadata.
- Hyperbola
- A hyperbola represented by a center and positive transverse/conjugate radii.
- Hyperplane
- An n-dimensional hyperplane represented by
coefficients.dot(point) + offset = 0. - Hypersphere
- An n-sphere represented by its topological dimension and radius.
- Incidence
Matrix - A dense incidence matrix.
- Incidence
Pair - A point-line incidence pair.
- Incidence
Structure - A sparse incidence structure.
- Inversion
- A planar geometric inversion represented by center and radius.
- Johnson
Solid - A Johnson solid descriptor.
- Johnson
Solid Id - A Johnson solid identifier from
J1throughJ92. - JointId
- A linkage joint identifier.
- Line2
- An infinite 2D line represented by two sample points.
- Linkage
- A linkage summary.
- Manifold
- A lightweight manifold descriptor.
- Manifold
Dimension - A non-negative manifold dimension.
- Mesh
- A lightweight mesh count summary.
- Mesh
Face Index - A mesh face index.
- Mesh
Vertex Index - A mesh vertex index.
- NetEdge
- An adjacency edge in a polyhedral net.
- OneHundred
Twenty Cell - Marker for the 120-cell.
- Origami
Model - A compact origami model summary.
- Orthotope
- An n-dimensional orthotope represented by positive edge lengths.
- Parabola
- A parabola descriptor using a vertex and focal parameter.
- Plane3
- A 3D plane represented by
normal.dot(point) + offset = 0. - Point2
- A 2D point represented with
f64coordinates. - Polygon
- An ordered planar polygon boundary.
- Polyhedral
Net - A polyhedral net descriptor.
- Polyhedron
- A polyhedron count summary.
- Polyhedron
Face - A polyhedron face record represented by vertex indices.
- Polyline2
- An ordered 2D polyline.
- Polytope
- A small n-dimensional polytope descriptor.
- Projection2
- A tiny 2D projection descriptor.
- Projective
Line - A projective line represented by homogeneous coefficients.
- Projective
Plane - A projective plane descriptor.
- Projective
Point - A projective point represented by homogeneous coordinates.
- Quadratic
Bezier2 - A quadratic Bezier curve in 2D.
- Ray2
- A half-infinite 2D ray.
- Rectangle
- An axis-aligned rectangle.
- Regular
Polygon - A regular polygon descriptor.
- Rigid
Fold - A rigid fold around a crease index.
- Rigid
Fold Sequence - A sequence of rigid folds.
- Rotation
- A geometric rotation represented by one angle.
- Scale
- A geometric scale.
- Schlafli
Double Six - The Schlafli double-six configuration metadata.
- Schlafli
Symbol - A Schlafli symbol represented by its numeric entries.
- Segment2
- A finite line segment between two 2D points.
- Similarity
Ratio - A positive finite scale ratio used for geometric similarity.
- Simplex
- A general simplex descriptor.
- Simplicial
Complex - A simplicial complex represented by simplex dimensions.
- SixHundred
Cell - Marker for the 600-cell.
- Sixteen
Cell - Marker for the 16-cell.
- Sphere
- A three-dimensional Euclidean sphere represented by radius.
- Spline2
- A 2D spline control-point sequence.
- Surface
Patch - A rectangular parameter-domain surface patch.
- Tessellation
- A tessellation summary.
- Tesseract
- Marker for the tesseract.
- Tetrahedron
- A 3-simplex in 3D space.
- TileId
- A tessellation tile identifier.
- Torus
- A torus represented by major and minor radii.
- Transform2
- A homogeneous 2D transform matrix.
- Transform3
- A homogeneous 3D transform matrix.
- Translation
- A geometric translation.
- Triangle
- A constructed 2D triangle represented by three vertices.
- Triangulation2
- A 2D triangulation represented by indexed triangles.
- Twenty
Four Cell - Marker for the 24-cell.
- Unfolding
Plan - A sequence of unfolding steps.
- Unfolding
Step - A single unfolding step between adjacent faces.
- Uniform
Polytope - A lightweight uniform polytope descriptor.
- Vertex
- A polyhedron vertex.
- Voronoi
Cell - A Voronoi cell represented by its site index and boundary vertices.
- Voronoi
Diagram - A Voronoi diagram record.
- Wythoff
Symbol - A lightweight Wythoff construction symbol.
Enums§
- Archimedean
Solid - The thirteen Archimedean solids.
- Axis2
- Axis labels for two-dimensional coordinates.
- Axis3
- Axis labels for three-dimensional coordinates.
- Axis
Reflection2 - Axis-aligned 2D reflection choices.
- Boundary
Kind - Boundary metadata for a manifold.
- Catalan
Solid - The thirteen Catalan solids.
- Conic
Kind - The high-level family of a conic section.
- Containment
- A simple inside, boundary, or outside classification.
- Crease
Kind - A crease classification.
- Fold
Assignment - A fold assignment.
- Geometry
Error - Errors returned by validated geometry constructors and tolerance-aware helpers.
- Hull
Algorithm - Common convex hull algorithm families.
- Intersection2
- A minimal two-dimensional intersection result.
- Orientation2
- The winding order of three 2D points.
- Platonic
Solid - The five Platonic solids.
- Projection
Kind - Broad projection families.
- Regular
Polytope - A regular polytope descriptor across common dimensions.
- Regular
Polytope4 - The six convex regular four-dimensional polytopes.
- Surface
Kind - Broad surface families.
- Tessellation
Kind - Broad tessellation families.
- Triangulation
Method - Triangulation method families.
- Uniform
Polytope Kind - Broad uniform polytope families.
Traits§
- Contains
- A trait for values that can classify containment of
T. - Intersects
- A trait for values that can report whether they intersect
Rhs.
Functions§
- aabb_
from_ points - Creates a bounding box from any two corners.
- affine_
combination_ 2d - Returns the affine interpolation between two 2D points.
- distance_
2d - Returns the Euclidean distance between two 2D points.
- distance_
squared_ 2d - Returns the squared Euclidean distance between two 2D points.
- midpoint_
2d - Returns the midpoint between two 2D points.
- orientation_
2d - Returns the winding order of three 2D points.
- orientation_
2d_ with_ tolerance - Returns the winding order of three 2D points using an explicit area tolerance.
- signed_
twice_ area_ 2d - Returns twice the signed area of the triangle formed by three 2D points.
- slope
- Returns the slope between two points, or
Nonefor a vertical line. - triangle_
area - Returns the 2D triangle area.
- triangle_
twice_ area - Returns twice the unsigned 2D triangle area.
- triangle_
twice_ signed_ area - Returns twice the signed 2D triangle area using the shoelace formula.
- try_
orientation_ 2d - Returns the winding order of three 2D points with finite coordinates.
- try_
orientation_ 2d_ with_ tolerance - Returns the winding order of three finite 2D points using an explicit area tolerance.
- try_
slope - Returns the slope between two points when both points contain only finite coordinates.
Type Aliases§
- Regular
Polytope2 - Two-dimensional regular polytopes are regular polygons.
- Regular
Polytope3 - Three-dimensional regular polytopes are the Platonic solids.
- Three
Sphere - A 3-sphere, the boundary of a four-dimensional ball.