From 0df27dee0d5189d9986e6c93553521aa86f51c52 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Mon, 29 Jul 2024 19:17:11 +0200 Subject: [PATCH] Make sure triangulation returns valid triangles This check is currently redundant with what the `Triangle` constructor already does. The constructor will soon get simplified though, and then the new check will be necessary. --- crates/fj-core/src/algorithms/triangulate/delaunay.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/fj-core/src/algorithms/triangulate/delaunay.rs b/crates/fj-core/src/algorithms/triangulate/delaunay.rs index 8a90a2cf6..05cf8cc81 100644 --- a/crates/fj-core/src/algorithms/triangulate/delaunay.rs +++ b/crates/fj-core/src/algorithms/triangulate/delaunay.rs @@ -53,6 +53,10 @@ pub fn triangulate( v2.point_surface, ]) .expect("invalid triangle"); + assert!( + triangle.is_valid(), + "Expecting triangles created by triangulation to be valid.", + ); let required_winding = match coord_handedness { Handedness::LeftHanded => Winding::Cw,