Skip to content

Commit

Permalink
Add Edge::transform
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Feb 10, 2022
1 parent bbb1799 commit 0b4ea9a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/kernel/topology/edges.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl Edges {
pub fn transform(mut self, transform: &Isometry<f64>) -> Self {
for cycle in &mut self.cycles {
for edge in &mut cycle.edges {
edge.curve = edge.curve.clone().transform(transform);
*edge = edge.clone().transform(transform);
}
}

Expand Down Expand Up @@ -150,4 +150,11 @@ impl Edge {
pub fn reverse(&mut self) {
self.reverse = !self.reverse;
}

/// Transform the edge
#[must_use]
pub fn transform(mut self, transform: &Isometry<f64>) -> Self {
self.curve = self.curve.transform(transform);
self
}
}

0 comments on commit 0b4ea9a

Please sign in to comment.