mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-03 18:45:55 +00:00
kernel: shell, offset, boolean and sweep notes say SMLib is the kernel
The module notes of offset_backend, smlib_boolean and smlib_sweeps no longer speak of a kernel switch or another kernel's behaviour; sweep_path's tests formatted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017itGh5fpMEousnZ91cYcVt
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
//! Shell, offset faces and thicken through SMLib, when [`crate::backend`] is SMLib (the one
|
||||
//! kernel setting, `SOLIDCRAFT_KERNEL`): the body goes to SMLib as its schema 4 record,
|
||||
//! tagged as operand 0, SMLib runs the operation, and the result comes back with SMLib's own
|
||||
//! Shell, offset faces, draft and thicken through SMLib: the body goes to SMLib as its schema 4
|
||||
//! record, tagged as operand 0, SMLib runs the operation, and the result comes back with SMLib's own
|
||||
//! history, renumbered into the body's and the result's face and edge order (as
|
||||
//! `crate::smlib_boolean` does for booleans). A result SMLib's own check refuses is an
|
||||
//! error, never a body.
|
||||
@@ -11,8 +10,7 @@
|
||||
//! lie: the copy is the operation's distance from the face, the face itself on it. So a result
|
||||
//! face farther from its tagged face than half that distance is recorded as its offset
|
||||
//! ([`FaceOrigin::Offset`]), and its edges as where its faces meet. A face SMLib makes new along
|
||||
//! a sheet's open edge (a thickened sheet's wall) is recorded as made in place of that edge, as
|
||||
//! truck's thicken records it.
|
||||
//! a sheet's open edge (a thickened sheet's wall) is recorded as made in place of that edge.
|
||||
|
||||
#![cfg(feature = "smlib")]
|
||||
|
||||
@@ -75,7 +73,7 @@ fn run(name: &str, b: &Body, op: impl FnOnce(&Brep) -> std::result::Result<Brep,
|
||||
}
|
||||
|
||||
/// [`crate::shell`] through SMLib: walls of `thickness` inside, open at the faces under the
|
||||
/// points `open` (the face of the nearest triangle, as truck's shell picks them) and the faces
|
||||
/// points `open` (the face of the nearest triangle) and the faces
|
||||
/// on the same surface joined to them: a round wall stored in pieces (a hole's two halves) opens
|
||||
/// whole. SMLib is given one point inside each, never the pick itself, which may lie on the
|
||||
/// line between two pieces.
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
//! Booleans through SMLib ([`crate::backend`] picks them): each operand's schema 4 record built
|
||||
//! in SMLib and tagged as operand 0 or 1, `SmBrep` boolean, the result exported to schema 4 and
|
||||
//! decoded as a kernel body. The result's history is SMLib's own (its tags carried through the
|
||||
//! Booleans through SMLib: each operand's schema 4 record built in SMLib and tagged as operand 0
|
||||
//! or 1, `SmBrep` boolean, the result exported to schema 4 and decoded as a kernel body. The result's history is SMLib's own (its tags carried through the
|
||||
//! operation), renumbered from SMLib's face and edge order into the operands' and the result's
|
||||
//! ([`crate::history::History`]'s contract). A result SMLib's own check or the record's geometry
|
||||
//! check refuses is an error, never a body.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//! Extrusions, revolutions, sweeps, lofts and screw sweeps through SMLib ([`crate::backend`]
|
||||
//! picks them): the profile's segments go to SMLib as 3D curves (lines, circular arcs, Béziers
|
||||
//! and conics as NURBS), SMLib sweeps them, and the result comes back through its schema 4
|
||||
//! record as a kernel body. A result SMLib's own check refuses is an error, never a body. An
|
||||
//! option SMLib has no sweep for is "not supported yet", never truck's sweep in its place.
|
||||
//! Extrusions, revolutions, sweeps, lofts and screw sweeps through SMLib: the profile's
|
||||
//! segments go to SMLib as 3D curves (lines, circular arcs, Béziers and conics as NURBS), SMLib
|
||||
//! sweeps them, and the result comes back through its schema 4 record as a kernel body. A result
|
||||
//! SMLib's own check refuses is an error, never a body. An option SMLib has no sweep for is "not
|
||||
//! supported yet".
|
||||
//!
|
||||
//! A sweep that twists, scales, keeps an orientation direction or follows guide rails, and a
|
||||
//! loft that follows guide rails, place the profile at stations by the laws the kernel's own
|
||||
|
||||
@@ -773,7 +773,14 @@ mod tests {
|
||||
assert!((m.volume - volume).abs() < 2e-3 * volume, "volume {} vs {volume}", m.volume);
|
||||
assert!((m.area - caps - lateral).abs() < 2e-3 * lateral, "lateral {} vs {lateral}", m.area - caps);
|
||||
// The end cap is the scaled circle.
|
||||
let top = b.mesh(&crate::MeshTolerance::chord(0.005)).unwrap().positions.iter().filter(|p| (p.z - h).abs() < 1e-6).map(|p| p.x.hypot(p.y)).fold(0.0, f64::max);
|
||||
let top = b
|
||||
.mesh(&crate::MeshTolerance::chord(0.005))
|
||||
.unwrap()
|
||||
.positions
|
||||
.iter()
|
||||
.filter(|p| (p.z - h).abs() < 1e-6)
|
||||
.map(|p| p.x.hypot(p.y))
|
||||
.fold(0.0, f64::max);
|
||||
assert!((top - small).abs() < 1e-3, "end radius {top}");
|
||||
// The surface sweep of the circle's curve: the frustum's lateral face alone.
|
||||
let sheet = crate::sweep_sheet_with(&Plane::XY, std::slice::from_ref(&circle(big).outer.segs), &up(h), &ctl).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user