-
-
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 #1941 from hannobraun/boundary
Use dedicated struct to represent boundaries on curves
- Loading branch information
Showing
16 changed files
with
90 additions
and
88 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
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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use fj_math::Point; | ||
|
||
/// A boundary on a curve | ||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)] | ||
pub struct BoundaryOnCurve { | ||
/// The raw representation of the boundary | ||
pub inner: [Point<1>; 2], | ||
} | ||
|
||
impl BoundaryOnCurve { | ||
/// Reverse the direction of the boundary | ||
pub fn reverse(self) -> Self { | ||
let [a, b] = self.inner; | ||
Self { inner: [b, a] } | ||
} | ||
} | ||
|
||
impl<T> From<[T; 2]> for BoundaryOnCurve | ||
where | ||
T: Into<Point<1>>, | ||
{ | ||
fn from(boundary: [T; 2]) -> Self { | ||
let inner = boundary.map(Into::into); | ||
Self { inner } | ||
} | ||
} |
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,9 +1,11 @@ | ||
//! Types that are tied to objects, but aren't objects themselves | ||
mod boundary; | ||
mod path; | ||
mod surface; | ||
|
||
pub use self::{ | ||
boundary::BoundaryOnCurve, | ||
path::{GlobalPath, SurfacePath}, | ||
surface::SurfaceGeometry, | ||
}; |
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
Oops, something went wrong.