truck-modeling 0.6.0

integrated modeling algorithms by geometry and topology
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Modeling a unit cube by three sweeps.
//!
//! Generated json file can be visualized by `simple-shape-viewer`, an example of `truck-rendimpl`.

use truck_modeling::*;

fn main() {
    let v = builder::vertex(Point3::new(-0.5, -0.5, -0.5));
    let e = builder::tsweep(&v, Vector3::unit_x());
    let f = builder::tsweep(&e, Vector3::unit_y());
    let cube = builder::tsweep(&f, Vector3::unit_z());
    let json = serde_json::to_vec_pretty(&cube).unwrap();
    std::fs::write("cube.json", json).unwrap();
}