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.
This commit is contained in:
dotCooCoo
2026-11-09 04:19:38 +07:00
committed by bflatastic
parent 88626a9194
commit 61f83dc439
+1
View File
@@ -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");