Thanks to visit codestin.com
Credit goes to docs.rs

Skip to main content

Crate use_geometry

Crate use_geometry 

Source
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

GroupReexported crates
Foundationsuse-coordinate, use-dimension, use-angle, use-point
Affine and Euclidean primitivesuse-bounds, use-line, use-ray, use-segment, use-plane, use-hyperplane, use-circle, use-sphere, use-hypersphere, use-torus
Transformationsuse-transform, use-affine, use-projection, use-reflection, use-inversion
Metric and relational geometryuse-distance, use-orientation, use-intersection, use-containment, use-congruence, use-similarity, use-dihedral
Curves and conicsuse-conic, use-curve, use-polyline, use-bezier, use-spline
Surfaces and manifoldsuse-surface, use-manifold
Planar regionsuse-triangle, use-rectangle, use-polygon
Polytopes and solidsuse-simplex, use-orthotope, use-polytope, use-polyhedron, use-regular-polytope, use-archimedean, use-catalan-solid, use-johnson-solid
Polytope notation and classificationuse-schlafli, use-wythoff, use-coxeter, use-uniform-polytope
Incidence, projective geometry, and configurationsuse-incidence, use-projective, use-configuration, use-duality
Representations and complexesuse-mesh, use-face, use-cell, use-geometric-complex
Constructions and decompositionsuse-hull, use-triangulation, use-tessellation, use-voronoi, use-delaunay
Folding and unfoldinguse-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, and regular_polytope mirror child crates.
  • The prelude reexports the same child crate surface through enabled features.
  • Named objects belong inside family crates, not standalone crates.
  • use-vector remains in the use-math workspace and is used directly by child crates that need vector types.
  • The use-geometric-complex package provides geometric complex and cell-complex vocabulary; the use-complex package 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.
AffinePair
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.
CellComplex
A collection of geometric cells.
Circle
A circle in 2D Euclidean space.
CongruenceTolerance
A non-negative tolerance for congruence-style comparisons.
Conic
A small conic descriptor.
ConvexHull2
A 2D convex hull point set descriptor.
Coordinate2
A raw two-dimensional coordinate pair.
Coordinate3
A raw three-dimensional coordinate triple.
CoxeterDiagram
A Coxeter diagram record.
CoxeterEdge
An edge in a Coxeter diagram.
CoxeterNode
A node in a Coxeter diagram.
Crease
A crease segment in a flat pattern.
Cube
A cube.
CubicBezier2
A cubic Bezier curve in 2D.
Cuboid
A rectangular cuboid.
CurveParameter
A normalized curve parameter in [0, 1].
CurveSample2
A sampled 2D curve point.
DelaunayTriangulation
A Delaunay triangulation represented by indexed triangles.
DihedralAngle
A dihedral angle stored as an Angle.
Dimension
A positive spatial dimension count.
DoubleSix
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.
FiveCell
Marker for the 5-cell.
FoldState
A fold assignment with an angle.
GeometricComplex
A general geometric complex count summary.
GeometricConfiguration
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.
IncidenceMatrix
A dense incidence matrix.
IncidencePair
A point-line incidence pair.
IncidenceStructure
A sparse incidence structure.
Inversion
A planar geometric inversion represented by center and radius.
JohnsonSolid
A Johnson solid descriptor.
JohnsonSolidId
A Johnson solid identifier from J1 through J92.
JointId
A linkage joint identifier.
Line2
An infinite 2D line represented by two sample points.
Linkage
A linkage summary.
Manifold
A lightweight manifold descriptor.
ManifoldDimension
A non-negative manifold dimension.
Mesh
A lightweight mesh count summary.
MeshFaceIndex
A mesh face index.
MeshVertexIndex
A mesh vertex index.
NetEdge
An adjacency edge in a polyhedral net.
OneHundredTwentyCell
Marker for the 120-cell.
OrigamiModel
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 f64 coordinates.
Polygon
An ordered planar polygon boundary.
PolyhedralNet
A polyhedral net descriptor.
Polyhedron
A polyhedron count summary.
PolyhedronFace
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.
ProjectiveLine
A projective line represented by homogeneous coefficients.
ProjectivePlane
A projective plane descriptor.
ProjectivePoint
A projective point represented by homogeneous coordinates.
QuadraticBezier2
A quadratic Bezier curve in 2D.
Ray2
A half-infinite 2D ray.
Rectangle
An axis-aligned rectangle.
RegularPolygon
A regular polygon descriptor.
RigidFold
A rigid fold around a crease index.
RigidFoldSequence
A sequence of rigid folds.
Rotation
A geometric rotation represented by one angle.
Scale
A geometric scale.
SchlafliDoubleSix
The Schlafli double-six configuration metadata.
SchlafliSymbol
A Schlafli symbol represented by its numeric entries.
Segment2
A finite line segment between two 2D points.
SimilarityRatio
A positive finite scale ratio used for geometric similarity.
Simplex
A general simplex descriptor.
SimplicialComplex
A simplicial complex represented by simplex dimensions.
SixHundredCell
Marker for the 600-cell.
SixteenCell
Marker for the 16-cell.
Sphere
A three-dimensional Euclidean sphere represented by radius.
Spline2
A 2D spline control-point sequence.
SurfacePatch
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.
TwentyFourCell
Marker for the 24-cell.
UnfoldingPlan
A sequence of unfolding steps.
UnfoldingStep
A single unfolding step between adjacent faces.
UniformPolytope
A lightweight uniform polytope descriptor.
Vertex
A polyhedron vertex.
VoronoiCell
A Voronoi cell represented by its site index and boundary vertices.
VoronoiDiagram
A Voronoi diagram record.
WythoffSymbol
A lightweight Wythoff construction symbol.

Enums§

ArchimedeanSolid
The thirteen Archimedean solids.
Axis2
Axis labels for two-dimensional coordinates.
Axis3
Axis labels for three-dimensional coordinates.
AxisReflection2
Axis-aligned 2D reflection choices.
BoundaryKind
Boundary metadata for a manifold.
CatalanSolid
The thirteen Catalan solids.
ConicKind
The high-level family of a conic section.
Containment
A simple inside, boundary, or outside classification.
CreaseKind
A crease classification.
FoldAssignment
A fold assignment.
GeometryError
Errors returned by validated geometry constructors and tolerance-aware helpers.
HullAlgorithm
Common convex hull algorithm families.
Intersection2
A minimal two-dimensional intersection result.
Orientation2
The winding order of three 2D points.
PlatonicSolid
The five Platonic solids.
ProjectionKind
Broad projection families.
RegularPolytope
A regular polytope descriptor across common dimensions.
RegularPolytope4
The six convex regular four-dimensional polytopes.
SurfaceKind
Broad surface families.
TessellationKind
Broad tessellation families.
TriangulationMethod
Triangulation method families.
UniformPolytopeKind
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 None for 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§

RegularPolytope2
Two-dimensional regular polytopes are regular polygons.
RegularPolytope3
Three-dimensional regular polytopes are the Platonic solids.
ThreeSphere
A 3-sphere, the boundary of a four-dimensional ball.