Skip to content

Commit

Permalink
Add SurfaceGeom::origin
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Aug 13, 2024
1 parent dc499ab commit bea80db
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions crates/fj-core/src/geometry/surface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ pub enum SurfaceGeom {
}

impl SurfaceGeom {
/// # Access the origin of the surface
pub fn origin(&self) -> Point<3> {
let Self::Basic { u, .. } = self;
match u {
GlobalPath::Circle(circle) => circle.center(),
GlobalPath::Line(line) => line.origin(),
}
}

/// # Return the triangle at the provided point on the surface
///
/// Select a triangle of the surface's triangle mesh representation, the one
Expand Down

0 comments on commit bea80db

Please sign in to comment.