## implicit3d

3d implicit geometry

### 14 releases (6 breaking)

 0.13.1 Jan 5, 2019 Dec 31, 2018 Sep 30, 2018 May 5, 2018

#16 in Data formats

174 downloads per month
Used in 1 crate

GPL-3.0 license

77KB
2K SLoC

# implicit3d

Implicit3d is a library for 3d implicit geometry.

Implicit3d offers rounded CSG, which allows for smooth and rounded looking objects.

### `lib.rs`:

`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.

# Examples

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);
``````

~2.5MB
~47K SLoC