A Rust Cargo crate for finding the distance between a point and a constructive solid geometry (CSG) surface
Example usage
This example finds the distance from a point along a vector to a spherical surface.
use ;
Supported Surfaces
csg_surface_distance supports the following types of surfaces:
-
Sphere
- Defined by its center coordinates
(x, y, z)and radius. - Example:
Sphere
- Defined by its center coordinates
-
XPlane
- A plane perpendicular to the x-axis.
- Defined by the x-coordinate of the plane.
- Example:
XPlane
-
YPlane
- A plane perpendicular to the y-axis.
- Defined by the y-coordinate of the plane.
- Example:
YPlane
-
ZPlane
- A plane perpendicular to the z-axis.
- Defined by the z-coordinate of the plane.
- Example:
ZPlane
-
Plane
- A general plane defined by the equation
ax + by + cz + d = 0. - Example:
Plane
- A general plane defined by the equation
-
XAxisCylinder
- A cylinder aligned along the x-axis.
- Defined by its center coordinates
(y, z)and radius. - Example:
XAxisCylinder
-
YAxisCylinder
- A cylinder aligned along the y-axis.
- Defined by its center coordinates
(x, z)and radius. - Example:
YAxisCylinder
-
ZAxisCylinder
- A cylinder aligned along the z-axis.
- Defined by its center coordinates
(x, y)and radius. - Example:
ZAxisCylinder
-
Quadric
- A general quadric surface defined by the equation
Ax^2 + By^2 + Cz^2 + Dxy + Eyz + Fxz + Gx + Hy + Jz + K = 0. - Example:
Quadric
- A general quadric surface defined by the equation
Usage
To use the csg_surface_distance package, add it to your Cargo.toml:
[]
= "0.1.0" # Replace with the actual version