Skip to content

Commit

Permalink
Merge pull request #2113 from hannobraun/winding
Browse files Browse the repository at this point in the history
Add convenience methods for `Winding`
  • Loading branch information
hannobraun authored Nov 28, 2023
2 parents da350a6 + 70b39de commit 3cc3760
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions crates/fj-math/src/triangle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,23 @@ pub struct NotATriangle<const D: usize> {
pub enum Winding {
/// Counter-clockwise
Ccw,

/// Clockwise
Cw,
}

impl Winding {
/// Indicate whether the winding is counter-clockwise
pub fn is_ccw(&self) -> bool {
matches!(self, Self::Ccw)
}

/// Indicate whether the winding is clockwise
pub fn is_cw(&self) -> bool {
matches!(self, Self::Cw)
}
}

#[cfg(test)]
mod tests {
use crate::{Point, Vector};
Expand Down

0 comments on commit 3cc3760

Please sign in to comment.