Crate libfive[−][src]
Expand description
A high level wrapper around libfive
– a set of
tools for solid modeling based on
functional representation.
Particularly suited for parametric- and procedural modeling. An infrastructure for generative design, mass customization, and domain-specific CAD tools.
Example
let f_rep_shape = Tree::sphere(1.0.into(), TreeVec3::default()) .difference_multi(vec![ Tree::sphere(0.6.into(), TreeVec3::default()), Tree::cylinder_z( 0.6.into(), 2.0.into(), TreeVec3::new(0.0, 0.0, -1.0), ), Tree::cylinder_z( 0.6.into(), 2.0.into(), TreeVec3::new(0.0, 0.0, -1.0), ) .reflect_xz(), Tree::cylinder_z( 0.6.into(), 2.0.into(), TreeVec3::new(0.0, 0.0, -1.0), ) .reflect_yz(), ]); f_rep_shape.to_stl( "f-rep-shape.stl", &Region3::new(-2.0, 2.0, -2.0, 2.0, -2.0, 2.0), &BRepSettings::default(), )?;
The STL file generated from this code is show below.
Features
-
ahash
– On by default. UseAHashMap
for hashing when resolving variable names. Disabling this will fall back to the slowerHashMap
. -
stdlib
– On by default. Add an extensive list of higher level operations – thelibfive stdlib
.To disable either/both of the above features unset default features in
Cargo.toml
:[dependencies.libfive] default-features = false
-
packed_opcodes
– Tightly pack opcodes. This breaks compatibility with older saved f-rep files. SeeTree::save()/lood()
.
Structs
BRepSettings | Boundary representation settings passed to any of the rendering/export functions. |
Bitmap | Bitmap representing occupancy in a slice of a |
Evaluator | |
FlatTriangleMesh | Flat triangle mesh. |
Region2 | 2D bounding region. |
Region3 | 3D bounding region. |
Tree | Tree of operations. |
TreeVec2 | 2D point/vector/normal. |
TreeVec3 | 3D point/vector/normal. |
TriangleMesh | Triangle mesh. |
Variables | Set of variables to parameterize a |
Enums
BRepAlgorithm | The algorithm used for computing a
boundary representation
from a |
Error | A list specifying general categories of errors. |
Traits
Point2 | Trait to aid with using arbitrary 2D point types on a |
Point3 | Trait to aid with using arbitrary 3D point types on a |
Type Definitions
Contour | Series of 2D or 3D points forming a polygonal chain. |
Result | A specialized |
TreeFloat | An alias for |
Trees | A collection of |