14 releases (6 breaking)

0.13.1 Jan 5, 2019
0.12.1 Dec 31, 2018
0.11.0 Sep 30, 2018
0.9.1 May 5, 2018

#16 in Data formats

Download history 32/week @ 2018-11-12 9/week @ 2018-11-19 50/week @ 2018-11-26 27/week @ 2018-12-03 25/week @ 2018-12-10 39/week @ 2018-12-17 90/week @ 2018-12-24 64/week @ 2018-12-31 27/week @ 2019-01-07 19/week @ 2019-01-14 1/week @ 2019-01-21 3/week @ 2019-01-28 1/week @ 2019-02-04 4/week @ 2019-02-11 15/week @ 2019-02-18

174 downloads per month
Used in 1 crate

GPL-3.0 license

77KB
2K SLoC

implicit3d

Build Status Codecov Cargo License: GPL-3.0 Downloads

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

Dependencies

~2.5MB
~47K SLoC