Clippy: assign operators in the path sweep, isocurve grid and centre of mass

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AS5Tn3xieewUSg3uxrMVdL
This commit is contained in:
bherbruckandClaude Opus 5.5 committed 2026-10-08 09:42:34 +00:00
1 parent dea1f46266
commit 4126ae5a75
3 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -363,12 +363,12 @@ pub fn iso_grid(m: &Mesh, f: u32, p: Vec3, count: usize) -> Vec<Vec<Vec3>> {
for dir in ["u", "v"] {
// The family's cutting direction, from the curve through p.
let Some(first) = iso_curve(m, f, p, dir).into_iter().next() else { continue };
let pts: Vec<Vec3> = first.iter().copied().collect();
let pts: Vec<Vec3> = first.to_vec();
// Normal of the plane that curve lies in.
let Some(c) = pts.first().copied() else { continue };
let mut n = Vec3::ZERO;
for w in pts.windows(2) {
n = n + (w[0] - c).cross(w[1] - c);
n += (w[0] - c).cross(w[1] - c);
}
let cut_n = match n.normalized() {
Some(n) => n,
+1 -1
View File
@@ -313,7 +313,7 @@ fn center_of_mass(s: &mut Session, p: &Value) -> Result<Value> {
continue;
}
vol += m.volume;
moment = moment + m.centroid * m.volume;
moment += m.centroid * m.volume;
out.push(json!({"body": b.name, "center": [m.centroid.x, m.centroid.y, m.centroid.z], "volume": m.volume}));
}
if out.is_empty() {
+1 -1
View File
@@ -117,7 +117,7 @@ fn stations(pts: &[Vec3], tangents: &[Vec3], mitre: &[Option<(Vec3, f64)>]) -> R
let mut m = [col(Vec3::X), col(Vec3::Y), col(Vec3::Z)];
if let Some(Some((b, s))) = mitre.get(i) {
for c in &mut m {
*c = *c + *b * ((s - 1.0) * c.dot(*b));
*c += *b * ((s - 1.0) * c.dot(*b));
}
}
out.push(Station { at: *pts.get(i).ok_or_else(|| KernelError::Invalid("sweep path".into()))?, m });