From 61f83dc43988d7eb919b91822c33dba011e554c8 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 8 Nov 2026 12:47:41 -0800 Subject: [PATCH] 3D export: the revolve normals test checks each wall has triangles An empty mesh passed the unit-normal, closed and outward checks without testing a wall. The test now asserts that each revolve makes triangles. --- crates/three-d/src/mesh/tests.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/three-d/src/mesh/tests.rs b/crates/three-d/src/mesh/tests.rs index 4be1f0a13..3251cbb3e 100644 --- a/crates/three-d/src/mesh/tests.rs +++ b/crates/three-d/src/mesh/tests.rs @@ -262,6 +262,7 @@ fn a_revolved_surface_has_unit_normals_facing_out_whatever_its_length_and_direct let r = p.bounds().unwrap(); let o = Revolve { offset: 10.0, edge: Edge::Left, segments: 64, ..Revolve::default() }; let m = revolve_mesh(&p, r, o).unwrap(); + assert!(!m.is_empty(), "{from} to {to}: the revolve made no triangles"); assert!(m.normals.iter().all(|n| (dot(*n, *n) - 1.0).abs() < 1e-9), "{from} to {to}: a normal is not unit length"); assert!(closed(&m), "{from} to {to}"); assert!(outward(&m), "{from} to {to}: a face turns inward");