Kernel: pole-free six-patch spheres; vendored truck-shapeops with robust meshing and nearest-parameter loop projection (sphere and box booleans work); least-squares sphere classification
Oracle: 25/29 (14 and 15 now match Fusion). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AS5Tn3xieewUSg3uxrMVdL
This commit is contained in:
1 parent
7ef3426cb3
commit
043a542e29
34 files changed
+6228
-43
No files matched your search
@@ -0,0 +1,30 @@
|
||||
//! A punched cube generated by shape operator `AND`.
|
||||
|
||||
use truck_modeling::*;
|
||||
|
||||
fn main() {
|
||||
let v = builder::vertex(Point3::origin());
|
||||
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 v = builder::vertex(Point3::new(0.5, 0.25, -0.5));
|
||||
let w = builder::rsweep(&v, Point3::new(0.5, 0.5, 0.0), Vector3::unit_z(), Rad(7.0));
|
||||
let f = builder::try_attach_plane(&[w]).unwrap();
|
||||
let mut cylinder = builder::tsweep(&f, Vector3::unit_z() * 2.0);
|
||||
cylinder.not();
|
||||
let and = truck_shapeops::and(&cube, &cylinder, 0.05).unwrap();
|
||||
and.edge_iter().for_each(|edge| {
|
||||
let mut curve = edge.curve();
|
||||
if let Curve::IntersectionCurve(inter) = &curve {
|
||||
if matches! { inter.leader(), Leader::Polyline(_) } {
|
||||
let flag = curve.to_bspline_leader(0.01, 0.1, 20);
|
||||
println!("{flag}");
|
||||
}
|
||||
}
|
||||
edge.set_curve(curve);
|
||||
});
|
||||
|
||||
let json = serde_json::to_vec_pretty(&and).unwrap();
|
||||
std::fs::write("punched-cube-shapeops.json", json).unwrap();
|
||||
}
|
||||
Reference in new issue
Block a user