Skip to content

Commit

Permalink
Add Curve constructors for surface axes
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Jun 13, 2022
1 parent 4df44b3 commit 993415d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions crates/fj-kernel/src/geometry/curves.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,24 @@ impl<const D: usize> Curve<D> {
}
}

impl Curve<2> {
/// Construct a `Curve` that represents the u-axis
pub fn u_axis() -> Self {
Self::Line(Line {
origin: Point::origin(),
direction: Vector::unit_u(),
})
}

/// Construct a `Curve` that represents the v-axis
pub fn v_axis() -> Self {
Self::Line(Line {
origin: Point::origin(),
direction: Vector::unit_v(),
})
}
}

impl Curve<3> {
/// Construct a `Curve` that represents the x-axis
pub fn x_axis() -> Self {
Expand Down

0 comments on commit 993415d

Please sign in to comment.