-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1886 from hannobraun/arc-aabb
Make explicit, that arc AABB is not supported
- Loading branch information
Showing
1 changed file
with
15 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) | ||
} | ||
} | ||
} | ||
} |