Skip to content

armgit / forma

Public Imported from GitHub
0

A 1.2 MB pure-Rust rewrite of headless Blender built for AI agents — 3D B-rep modeling engine, CLI, and MCP server

fix(print): resolve Rust 1.100 Clippy lints in dfm

wrong-nebula47729c2e231e
diff --git a/crates/forma-print/src/dfm.rs b/crates/forma-print/src/dfm.rs
index ee2e81e..ea6667b 100644
--- a/crates/forma-print/src/dfm.rs
+++ b/crates/forma-print/src/dfm.rs
@@ -419,7 +419,7 @@ pub fn audit_mesh(
let pad = 1e-4;
let ez_zmax = ez
.z_max_mm
- .map_or((inv.bbox_max[2] + dz + 1.0).max(bz + 1.0), |z| z)
+ .unwrap_or((inv.bbox_max[2] + dz + 1.0).max(bz + 1.0))
- pad;
let ez_box = Aabb {
min: Vec3::new(ez.x_min_mm + pad, ez.y_min_mm + pad, ez.z_min_mm + pad),
@@ -2007,7 +2007,7 @@ pub fn audit_scene(
name_i, peval.bed_area
),
count: part_bed_faces.len().max(1),
- affected_faces: part_bed_faces.clone(),
+ affected_faces: part_bed_faces,
location_mm: Some([peval.com.x, peval.com.y, peval.z_min]),
measured_value: Some(peval.bed_area),
threshold_value: Some(4.0),
@@ -2024,7 +2024,7 @@ pub fn audit_scene(
name_i, peval.bed_area
),
count: 1,
- affected_faces: part_bed_faces.clone(),
+ affected_faces: part_bed_faces,
location_mm: Some([peval.com.x, peval.com.y, peval.z_min]),
measured_value: Some(peval.bed_area),
threshold_value: Some(100.0),
@@ -2211,10 +2211,7 @@ fn tri_overlaps_aabb(v0: Vec3, v1: Vec3, v2: Vec3, bb: &Aabb) -> bool {
let n = edges[0].cross(edges[1]);
let rn = h.x * n.x.abs() + h.y * n.y.abs() + h.z * n.z.abs();
- if n.dot(p0).abs() > rn {
- return false;
- }
- true
+ n.dot(p0).abs() <= rn
}
fn edge_is_downward_supported_by_face(
@@ -3168,10 +3165,7 @@ fn is_blunt_razor_boundary_edge(
}
}
}
- if edge_len < 2.0 * min_wall && is_acute_3_sided_needle(&nearby_normals, 10.0f64.to_radians().sin()) {
- return true;
- }
- false
+ edge_len < 2.0 * min_wall && is_acute_3_sided_needle(&nearby_normals, 10.0f64.to_radians().sin())
}
struct BoundaryVertexStub {