From bea80db4460870e02227f794db6a9ca4665c0b31 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 13 Aug 2024 18:52:07 +0200 Subject: [PATCH] Add `SurfaceGeom::origin` --- crates/fj-core/src/geometry/surface.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/fj-core/src/geometry/surface.rs b/crates/fj-core/src/geometry/surface.rs index 6d00e29f1..c1aa94c44 100644 --- a/crates/fj-core/src/geometry/surface.rs +++ b/crates/fj-core/src/geometry/surface.rs @@ -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