From cacdef802f38371550490878a9874be72ed4a829 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Mon, 19 Jun 2023 10:19:51 +0200 Subject: [PATCH] Make explicit, that arc AABB is not supported --- .../src/algorithms/bounding_volume/edge.rs | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/crates/fj-core/src/algorithms/bounding_volume/edge.rs b/crates/fj-core/src/algorithms/bounding_volume/edge.rs index 54d044ff8..ba6d56a09 100644 --- a/crates/fj-core/src/algorithms/bounding_volume/edge.rs +++ b/crates/fj-core/src/algorithms/bounding_volume/edge.rs @@ -1,13 +1,23 @@ use fj_math::Aabb; -use crate::objects::HalfEdge; +use crate::{geometry::curve::Curve, objects::HalfEdge}; impl super::BoundingVolume<2> for HalfEdge { fn aabb(&self) -> Option> { - let points = self.boundary().map(|point_curve| { - self.curve().point_from_path_coords(point_curve) - }); + match self.curve() { + Curve::Circle(_) => { + // I don't currently have an example model to test this with. + // This should change soon, and then this will panic and can be + // addressed. + todo!("Computing AABB of arc is not supported yet") + } + Curve::Line(_) => { + let points = self.boundary().map(|point_curve| { + self.curve().point_from_path_coords(point_curve) + }); - Some(Aabb::<2>::from_points(points)) + Some(Aabb::<2>::from_points(points)) + } + } } }