Skip to content

Commit

Permalink
Add convenience methods for Winding
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Nov 28, 2023
1 parent c275a87 commit 70b39de
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions crates/fj-math/src/triangle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,18 @@ pub enum Winding {
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 70b39de

Please sign in to comment.