Coil: clippy
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01AS5Tn3xieewUSg3uxrMVdL
This commit is contained in:
1 parent
9df954cd94
commit
218d19d753
2 files changed
+2
-1
No files matched your search
@@ -250,6 +250,7 @@ fn helix_path(features: &[Value], f: &Value) -> Option<([f64; 3], f64, f64, f64,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Least-squares circle through the points' (x, y): x² + y² + D x + E y + F = 0 (Kåsa).
|
/// Least-squares circle through the points' (x, y): x² + y² + D x + E y + F = 0 (Kåsa).
|
||||||
|
#[allow(clippy::needless_range_loop)]
|
||||||
fn circle_fit(pts: &[[f64; 3]]) -> Option<(f64, f64)> {
|
fn circle_fit(pts: &[[f64; 3]]) -> Option<(f64, f64)> {
|
||||||
let mut m = [[0.0f64; 4]; 3];
|
let mut m = [[0.0f64; 4]; 3];
|
||||||
for p in pts {
|
for p in pts {
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ mod tests {
|
|||||||
fn coil_volume_is_section_times_helix_length() {
|
fn coil_volume_is_section_times_helix_length() {
|
||||||
// A 2 mm circle in a plane through the Z axis, 20 mm out, 3 turns, pitch 8: a screw
|
// A 2 mm circle in a plane through the Z axis, 20 mm out, 3 turns, pitch 8: a screw
|
||||||
// motion of an axial section sweeps π r² · 2πR · turns (Fusion's spline helix: 4738.1).
|
// motion of an axial section sweeps π r² · 2πR · turns (Fusion's spline helix: 4738.1).
|
||||||
let pl = Plane::named("XZ").unwrap_or_else(|| Plane { origin: Vec3::ZERO, x: Vec3::X, y: Vec3::Z });
|
let pl = Plane { origin: Vec3::ZERO, x: Vec3::X, y: Vec3::Z };
|
||||||
let region = Region2 { outer: Loop2::circle(Vec2::new(20.0, 0.0), 2.0), holes: vec![] };
|
let region = Region2 { outer: Loop2::circle(Vec2::new(20.0, 0.0), 2.0), holes: vec![] };
|
||||||
let b = sweep_helix(&pl, ®ion, Vec3::ZERO, Vec3::Z, 8.0, 3.0).unwrap();
|
let b = sweep_helix(&pl, ®ion, Vec3::ZERO, Vec3::Z, 8.0, 3.0).unwrap();
|
||||||
let v = crate::measure(&b).unwrap().volume;
|
let v = crate::measure(&b).unwrap().volume;
|
||||||
|
|||||||
Reference in new issue
Block a user