BREP_app 0.18.0

The BREP CAD application: an eframe (egui + wgpu) host that draws the brep-render 3D engine into an egui frame — native + wasm from one codebase.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Shared CAM setup geometry descriptors.
use serde_json::{json, Value};
use super::schema_dsl::{closed_object_all};
pub(super) fn definitions() -> Value {
    let number=json!({"type":"number"});let text=json!({"type":"string"});
    let xyz=json!({"type":"array","items":number,"minItems":3,"maxItems":3});
    let mut stocks=Vec::new();
    for (kind,mut fields) in [
        ("boundsOffset",json!({"x":number,"y":number,"top":number,"bottom":number})),
        ("box",json!({"min":xyz,"max":xyz})),("cylinder",json!({"base":xyz,"axis":xyz,"radius":number,"height":number})),
        ("fromSolid",json!({"solid":text})),("fromRest",json!({"setup":text}))
    ] {fields["kind"]=json!({"const":kind});stocks.push(closed_object_all(fields));}
    json!({"Stock":{"oneOf":stocks},"RigidTransform":closed_object_all(json!({"rotation":{"type":"array","items":xyz,"minItems":3,"maxItems":3},"translation":xyz}))})
}