Skip to content

Commit

Permalink
Merge pull request #1886 from hannobraun/arc-aabb
Browse files Browse the repository at this point in the history
Make explicit, that arc AABB is not supported
  • Loading branch information
hannobraun authored Jun 19, 2023
2 parents f028442 + cacdef8 commit a914c73
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions crates/fj-core/src/algorithms/bounding_volume/edge.rs
Original file line number Diff line number Diff line change
@@ -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<Aabb<2>> {
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))
}
}
}
}

0 comments on commit a914c73

Please sign in to comment.