implicit3d is a crate for creating
3d implicit functions.
Implicit functions evaluate to a scalar value for each point the 3d space.
They can be used to described object surfaces. If the function evaluates to negative values
the point is in the object, if the function evaluates positve this is outside the object.
If the function evaluates to zero the point is on the object surface.
This library allows to create implicit functions for 3d primitives (sphere, cylinder, cone,
box). Those primitives can be combined using
CSG and transformed.
Create a Sphere:
let sphere = implicit3d::Sphere::new(1.0);
Create a rounded Cube (as rounded intersection of 6 planes):
use std::fs::OpenOptions; let px = Box::new(implicit3d::PlaneX::new(1.0)); let pnx = Box::new(implicit3d::PlaneNegX::new(1.0)); let py = Box::new(implicit3d::PlaneY::new(1.0)); let pny = Box::new(implicit3d::PlaneNegY::new(1.0)); let pz = Box::new(implicit3d::PlaneZ::new(1.0)); let pnz = Box::new(implicit3d::PlaneNegZ::new(1.0)); let cube = implicit3d::Intersection::from_vec(vec![px, pnx, py, pny, pz, pnz], 0.2);
AffineTransformer is a primitive that takes an object as input and allows to modify it using
Usually it is used indirectly through
Bender create an implicit function that represents a bended version of it's input. The object will be bend around the Z-Axis. E.g. bending a cylinder along the X-Axis (and translated away from the Z-Axis) will result in a Torus.
3D Bounding Box - defined by two diagonally opposing points.
A cone along the Z-Axis
A cylinder along the Z-Axis
Mesh generates an implicit function from a 3d object mesh. Warning! This primitive is currently horribly inefficient. That is, for each point it iterates over all faces and finds the closest. This implementation desperately needs some performance improvements, e.g. kd-tree support or similar.
An arbitrary (not axis aligned) plane.
This struct configures evaluation of rounded edges between object. The edge is evaluated in a different more computationally expensive way.
A sphere. Simple.
Twister will twist an object by rotating it along the Z-Axis.
Union create an implict function as the union of its inputs.
Object is the basic trait for any 3d implicit function.
Trait to allow cloning of
A negative YZ-Plane.
A negative XZ-Plane
A negative XZ-Plane