Skip to main content

Crate oxiphysics_geometry

Crate oxiphysics_geometry 

Source
Expand description

Geometric shape types for collision detection and physics simulation.

Provides primitives (sphere, box, capsule, cylinder, cone) and complex shapes (convex hull, triangle mesh, compound, height field) with support point queries, volume/inertia computation, and ray casting.

Re-exports§

pub use shape::RayHit;
pub use shape::Shape;
pub use sphere::Sphere;
pub use box_shape::BoxShape;
pub use capsule::Capsule;
pub use cylinder::Cylinder;
pub use cone::Cone;
pub use convex_hull::functions::approximate_convex_decomposition;
pub use convex_hull::functions::box_support;
pub use convex_hull::functions::capsule_support;
pub use convex_hull::functions::chamfer_build;
pub use convex_hull::functions::chamfer_hull;
pub use convex_hull::functions::cylinder_support;
pub use convex_hull::functions::deduplicate_points;
pub use convex_hull::functions::ellipsoid_support;
pub use convex_hull::functions::gjk_intersect;
pub use convex_hull::functions::hull_aspect_ratio;
pub use convex_hull::functions::hull_face_normals;
pub use convex_hull::functions::hull_face_offsets;
pub use convex_hull::functions::hull_sphericity;
pub use convex_hull::functions::icosahedron_vertices;
pub use convex_hull::functions::lower_hull_2d;
pub use convex_hull::functions::minkowski_difference_hull;
pub use convex_hull::functions::minkowski_difference_hulls;
pub use convex_hull::functions::minkowski_sum_hull;
pub use convex_hull::functions::minkowski_sum_hulls;
pub use convex_hull::functions::monotone_chain_hull_2d;
pub use convex_hull::functions::octahedron_vertices;
pub use convex_hull::functions::point_cloud_aabb;
pub use convex_hull::functions::point_cloud_centroid;
pub use convex_hull::functions::point_cloud_covariance;
pub use convex_hull::functions::simplify_hull_points;
pub use convex_hull::functions::sphere_support;
pub use convex_hull::functions::tetrahedron_vertices;
pub use convex_hull::functions::upper_hull_2d;
pub use convex_hull::functions::vertex_decimation;
pub use convex_hull::types::ConvexHull;
pub use convex_hull::types::ConvexHull3D;
pub use convex_hull::types::ConvexHullAabb;
pub use convex_hull::types::HullWithQuality;
pub use convex_hull::types::IncrementalConvexHull;
pub use triangle_mesh::TriangleMesh;
pub use heightfield::HeightField;
pub use compound::Compound;
pub use torus::Torus;
pub use mesh_ops::TriMesh;
pub use quickhull::ConvexHull3DVec;
pub use offset_surface::OffsetMesh;
pub use offset_surface::Sdf;
pub use offset_surface::SdfBox;
pub use offset_surface::SdfCapsule;
pub use offset_surface::SdfCone;
pub use offset_surface::SdfCylinder;
pub use offset_surface::SdfDifference;
pub use offset_surface::SdfIntersection;
pub use offset_surface::SdfOffset;
pub use offset_surface::SdfPlane;
pub use offset_surface::SdfScaled;
pub use offset_surface::SdfSmoothIntersection;
pub use offset_surface::SdfSmoothUnion;
pub use offset_surface::SdfSphere;
pub use offset_surface::SdfTorus;
pub use offset_surface::SdfTranslated;
pub use offset_surface::SdfUnion;
pub use offset_surface::VoxelSdf;
pub use offset_surface::approximate_medial_axis;
pub use offset_surface::detect_edge_features;
pub use offset_surface::extract_zero_crossings_slice;
pub use offset_surface::generate_shell;
pub use offset_surface::inward_offset;
pub use offset_surface::offset_curve_3d;
pub use offset_surface::offset_polyhedron;
pub use offset_surface::outward_offset;
pub use offset_surface::variable_offset;
pub use point_cloud::functions::aabb_extent;
pub use point_cloud::functions::compute_bounding_box;
pub use point_cloud::functions::compute_point_cloud_normals;
pub use point_cloud::functions::estimate_normals;
pub use point_cloud::functions::farthest_point_sampling;
pub use point_cloud::functions::fpfh_feature;
pub use point_cloud::functions::icp_align;
pub use point_cloud::functions::icp_point_to_point;
pub use point_cloud::functions::pca_obb;
pub use point_cloud::functions::ransac_fit_plane;
pub use point_cloud::functions::statistical_outlier_removal;
pub use point_cloud::functions::voxel_downsample;
pub use point_cloud::types::IcpRegistration;
pub use point_cloud::types::IcpResult;
pub use point_cloud::types::KdNode3D;
pub use point_cloud::types::KdTree3D;
pub use point_cloud::types::NormalEstimation;
pub use point_cloud::types::PointCloud;
pub use point_cloud::types::PointCloudFilter;
pub use point_cloud::types::RansacPlaneResult;
pub use mesh_param::LscmParameterization;
pub use mesh_param::ParamTriMesh;
pub use mesh_param::TutteParameterization;
pub use mesh_param::boundary_vertices;
pub use mesh_param::build_halfedge;
pub use mesh_param::fill_holes;
pub use mesh_param::is_boundary_vertex;
pub use mesh_param::loop_subdivision;
pub use mesh_param::midpoint_subdivision;
pub use mesh_param::remove_duplicate_vertices;
pub use mesh_param::texture_distortion;
pub use mesh_param::uv_overlap_check;
pub use mesh_param::uv_stretch;
pub use mesh_param::vertex_neighbors;
pub use voronoi::DelaunayTriangle;
pub use voronoi::DelaunayTriangulation;
pub use voronoi::LegacyVoronoiCell;
pub use voronoi::Point2D;
pub use voronoi::VoronoiCell;
pub use voronoi::VoronoiDiagram;
pub use voronoi::VoronoiSite;
pub use voronoi::bowyer_watson;
pub use voronoi::circumcircle;
pub use voronoi::delaunay_to_voronoi;
pub use voronoi::in_circumcircle;
pub use voronoi::is_delaunay;
pub use voronoi::lloyd_relaxation;
pub use voronoi::nearest_site;
pub use voronoi::power_diagram;
pub use voronoi::voronoi_area;
pub use voxel_grid::VoxelGrid;
pub use vhacd::VHacdConfig;
pub use vhacd::VHacdError;
pub use vhacd::VHacdVoxel;

Modules§

architectural_geometry
Architectural geometry — free-form surfaces, panelization, grid shells, tensile structures, geodesic domes, structural glass, and parametric facades.
boolean_ops
Auto-generated module structure
box_shape
Axis-aligned box shape.
bspline
Auto-generated module structure
capsule
Capsule shape (sphere-swept line segment along Y axis).
cell_complex
CW complex and cell complex geometry.
compound
Auto-generated module structure
computational_geometry
Auto-generated module structure
cone
Cone shape (Y-axis aligned, apex at top).
convex_decomposition
Convex decomposition of concave meshes for collision detection.
convex_hull
Auto-generated module structure
csg
Auto-generated module structure
cylinder
Cylinder shape (Y-axis aligned).
decimation
Auto-generated module structure
discrete_geometry
Discrete differential geometry on triangle meshes.
fractal_geometry
Auto-generated module structure
geodesic
Auto-generated module structure
geodesic_geometry
Auto-generated module structure
heightfield
Auto-generated module structure
implicit
Implicit surfaces and signed distance fields (SDF).
implicit_geometry
Auto-generated module structure
implicit_surfaces
Implicit surface representations and operations.
level_set
Auto-generated module structure
medial_axis
Medial axis transform, skeleton computation, and related distance-transform utilities.
medical_geometry
Medical imaging geometry — DICOM coordinate systems, CT/MRI volume reconstruction, bone segmentation, vessel centerline extraction, organ bounding volumes, anatomical coordinate systems (RAS/LPS), surgical planning geometry, marching-cubes mesh extraction, measurement tools, and mesh smoothing for medical applications.
mesh_boolean
Mesh boolean operations on triangle meshes.
mesh_ops
Triangle mesh operations: normals, volume, surface area, point containment.
mesh_param
Triangle mesh parameterization (UV unwrapping) and mesh processing utilities.
mesh_processing
Auto-generated module structure
mesh_quality
Mesh quality metrics and repair operations.
mesh_repair
Auto-generated module structure
mesh_repair_ext
Extended mesh repair: remeshing, smoothing, simplification, quality metrics.
mesh_simplification
Auto-generated module structure
nurbs_geometry
NURBS (Non-Uniform Rational B-Splines) geometry module.
offset_geometry
Offset / buffer geometry operations.
offset_surface
Offset surface generation and signed distance field (SDF) operations.
origami
Origami and kirigami mechanics — fold pattern geometry, rigid origami kinematics, and tessellation analysis.
parametric
Auto-generated module structure
point_cloud
Auto-generated module structure
procedural_geometry
Auto-generated module structure
quickhull
3D Convex Hull via QuickHull algorithm.
remesh
Mesh remeshing algorithms.
robot_geometry
Robot geometry: DH parameters, forward/inverse kinematics, Jacobians, workspace computation, collision checking, and self-collision detection.
shape
Shape trait and raycast types.
signed_distance_field
Signed Distance Field (SDF) geometry module.
spatial_hash
Spatial hashing, loose octree, k-nearest neighbours, ray grid traversal, and spatial statistics.
sphere
Sphere shape.
sphere_packing
Auto-generated module structure
spline_geometry
Auto-generated module structure
subdivision
Mesh subdivision schemes.
swept
Auto-generated module structure
terrain_processing
Terrain processing and analysis algorithms.
topology
Auto-generated module structure
topology_geometry
Computational topology for geometry: persistent homology, Reeb graphs.
torus
Torus shape.
triangle_mesh
Triangle mesh shape with adjacency queries, vertex normals, Laplacian, geodesic distance, Loop subdivision, and watertight checks.
vhacd
V-HACD: Voxel-based Hierarchical Approximate Convex Decomposition (v0.1).
voronoi
Auto-generated module structure
voxel_grid
Axis-aligned voxel grid backed by a compact bit vector.

Structs§

ConvergenceTracker
Tracks residual progress for an iterative solver and raises Error::ConvergenceFailure when the iteration limit is exceeded.

Enums§

Error
Main error type for the geometry module.

Traits§

WithContext
Attach a context string to a Result, wrapping the error in a new General message that includes the original error’s display text.

Functions§

check_dim_match
Assert that lhs_len == rhs_len, returning Err(Error::DimensionMismatch).
check_finite
Assert that a value is finite (not NaN, not infinite).
check_finite_slice
Check all values in a slice are finite.
check_index
Assert that index < len, returning Err(Error::IndexOutOfBounds) if not.
check_len
Assert that len == expected, returning Err(Error::LengthMismatch) if not.
check_min_points
Assert that count >= required, returning Err(Error::TooFewPoints) if not.
check_non_negative
Assert that a value is non-negative, returning Err(Error::OutOfRange).
check_positive
Assert that a value is strictly positive, returning Err(Error::OutOfRange).
check_range
Assert that value lies in [min, max], returning Err(Error::OutOfRange) if it does not.
validate_heightfield
Validate a height-field descriptor.
validate_mesh
Validate that a triangle mesh has consistent vertex/index arrays.
validate_point_cloud
Validate a point cloud: non-empty, all coordinates finite.
validate_ray_dir
Validate that a ray direction is non-zero and finite.

Type Aliases§

Result
Result type alias for geometry operations.