Skip to content

Commit

Permalink
Implement TransformObject for PartialCycle
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Oct 5, 2022
1 parent 5ec0558 commit fab5da3
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion crates/fj-kernel/src/algorithms/transform/cycle.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use fj_math::Transform;

use crate::{objects::Cycle, stores::Stores};
use crate::{objects::Cycle, partial::PartialCycle, stores::Stores};

use super::TransformObject;

Expand All @@ -14,3 +14,22 @@ impl TransformObject for Cycle {
Self::new(surface, half_edges)
}
}

impl TransformObject for PartialCycle {
fn transform(self, transform: &Transform, stores: &Stores) -> Self {
let surface = self
.surface
.clone()
.map(|surface| surface.transform(transform, stores));
let half_edges = self
.half_edges
.into_iter()
.map(|edge| edge.transform(transform, stores))
.collect();

Self {
surface,
half_edges,
}
}
}

0 comments on commit fab5da3

Please sign in to comment.