Skip to content

Commit

Permalink
Inline redundant method
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Sep 12, 2024
1 parent 0002785 commit 78854f6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
5 changes: 4 additions & 1 deletion crates/fj-core/src/geometry/curve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ impl<const D: usize> CurveGeom2<D> for Line<D> {
// geometry trait. Eventually, `CurveGeom2` is expected to replace `Path`.
impl<const D: usize> CurveGeom2<D> for Path<D> {
fn origin(&self) -> Point<D> {
self.origin()
match self {
Self::Circle(circle) => circle.origin(),
Self::Line(line) => line.origin(),
}
}
}
10 changes: 0 additions & 10 deletions crates/fj-core/src/geometry/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
use fj_math::{Circle, Line, Point, Scalar, Transform, Vector};

use super::CurveGeom2;

/// A path through surface (2D) or global (3D) space
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)]
pub enum Path<const D: usize> {
Expand Down Expand Up @@ -106,14 +104,6 @@ impl<const D: usize> Path<D> {
Self::Line(Line::from_points_with_line_coords(points))
}

/// Access the origin of the path's coordinate system
pub fn origin(&self) -> Point<D> {
match self {
Self::Circle(circle) => circle.origin(),
Self::Line(line) => line.origin(),
}
}

/// Convert a point on the path into surface coordinates
pub fn point_from_path_coords(
&self,
Expand Down
2 changes: 1 addition & 1 deletion crates/fj-core/src/geometry/surface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use fj_math::{Point, Scalar, Transform, Triangle, Vector};

use crate::algorithms::approx::{PathApproxParams, Tolerance};

use super::Path;
use super::{CurveGeom2, Path};

/// The geometry that defines a surface
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)]
Expand Down

0 comments on commit 78854f6

Please sign in to comment.