SMLib (fork 68e3086) refuses a blend whose rails leave the faces they roll on with SMLIB_ERR_NO_ROOM, which the kernel reports as KernelError::TooLarge. The kernel's own pre-checks go: blend_fit's fit check and the 256-station band check of the variable fillet. The shim no longer follows tangent chains; the Fillet/Chamfer dialog already expands a pick to its chain (its Tangent Chain option) and stores every edge in the feature. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017itGh5fpMEousnZ91cYcVt
15 lines
628 B
Rust
15 lines
628 B
Rust
//! The area vector of a loop of points (Newell's method): its normal and the area it encloses.
|
|
|
|
use solidcraft_geom::Vec3;
|
|
|
|
/// The area vector of a closed polygon (Newell's method): normal to the loop, as long as the area
|
|
/// it encloses, pointing the way the loop runs round by the right-hand rule.
|
|
pub(crate) fn loop_area(points: &[Vec3]) -> Vec3 {
|
|
let mut n = Vec3::ZERO;
|
|
for (i, p) in points.iter().enumerate() {
|
|
let Some(q) = points.get((i + 1) % points.len()) else { continue };
|
|
n += Vec3::new((p.y - q.y) * (p.z + q.z), (p.z - q.z) * (p.x + q.x), (p.x - q.x) * (p.y + q.y));
|
|
}
|
|
n * 0.5
|
|
}
|