diff --git a/src/kernel/shape/topology.rs b/src/kernel/shape/topology.rs index 41fb5532a..7e7c52a75 100644 --- a/src/kernel/shape/topology.rs +++ b/src/kernel/shape/topology.rs @@ -1,7 +1,5 @@ use std::collections::HashSet; -use tracing::warn; - use crate::{ debug::DebugInfo, kernel::{ @@ -64,10 +62,7 @@ impl Topology<'_> { let distance = (existing.point() - vertex.point()).magnitude(); if distance < self.min_distance { - warn!( - "Invalid vertex: {vertex:?}; \ - identical vertex at {existing:?}", - ); + return Err(ValidationError::Uniqueness); } } @@ -289,9 +284,9 @@ mod tests { // `point` is too close to the original point. `assert!` is commented, // because that only causes a warning to be logged right now. - let point = shape.geometry().add_point(Point::from([5e-6, 0., 0.])); - let _result = shape.topology().add_vertex(Vertex { point }); - // assert!(matches!(result, Err(ValidationError::Uniqueness))); + let point = shape.geometry().add_point(Point::from([5e-8, 0., 0.])); + let result = shape.topology().add_vertex(Vertex { point }); + assert!(matches!(result, Err(ValidationError::Uniqueness))); // `point` is farther than `MIN_DISTANCE` away from original point. // Should work.