mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-11 02:19:56 -06:00
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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user