From 35a689cfd7ced8be4d899091498ffda3a0e2eda6 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Fri, 11 Oct 2024 19:29:49 +0200 Subject: [PATCH] Prepare for follow-on change --- .../src/algorithms/bounding_volume/face.rs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/crates/fj-core/src/algorithms/bounding_volume/face.rs b/crates/fj-core/src/algorithms/bounding_volume/face.rs index dc8d54dd4..c13b3b224 100644 --- a/crates/fj-core/src/algorithms/bounding_volume/face.rs +++ b/crates/fj-core/src/algorithms/bounding_volume/face.rs @@ -12,6 +12,14 @@ use crate::{ impl super::BoundingVolume<3> for &Face { fn aabb(self, geometry: &Geometry) -> Option> { + // A bounding volume must include the body it bounds, but does not need + // to match it precisely. So it's okay, if it's a bit larger. + // + // Let's just choose a reasonable tolerance value here, then make sure + // we enlarge the AABB accordingly, to make sure it fits. + let tolerance = Tolerance::from_scalar(0.001) + .expect("Tolerance provided is larger than zero"); + (self.region().exterior().deref(), self.surface()) .aabb(geometry) .map(|aabb2| { @@ -33,15 +41,6 @@ impl super::BoundingVolume<3> for &Face { aabb_bottom.merged(&aabb_top) } Path::Line(_) => { - // A bounding volume must include the body it bounds, - // but does not need to match it precisely. So it's - // okay, if it's a bit larger. - // - // Let's just choose a reasonable tolerance value here, - // then make sure we enlarge the AABB accordingly, to - // make sure it fits. - let tolerance = Tolerance::from_scalar(0.001) - .expect("Tolerance provided is larger than zero"); let offset = Vector::from([tolerance.inner(); 3]); Aabb {