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.write_stl(
"f-rep-shape.stl",
&Region3::new(-2.0, 2.0, -2.0, 2.0, -2.0, 2.0),
// Subdivisions
10.0,
)?;
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.See
Tree::save()
/load()
.
Structs§
- Bitmap representing occupancy in a slice of a
Tree
. - Flat triangle mesh.
- 2D bounding region.
- 3D bounding region.
- Tree of operations.
- 2D point/vector/normal.
- 3D point/vector/normal.
- Triangle mesh.
- Set of variables to parameterize a
Tree
.
Enums§
- A list specifying general categories of errors.
Traits§
- Trait to aid with using arbitrary 2D point types on a
Contour
. - Trait to aid with using arbitrary 3D point types on a
TriangleMesh
.
Type Aliases§
- Series of 2D or 3D points forming a polygonal chain.
- A specialized
Result
type forlibfive
operations. - An alias for
Tree
. - A collection of
Tree
s.