From fab5da3922b2f555d61482085fba35bba2613ea4 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Wed, 5 Oct 2022 13:44:05 +0200 Subject: [PATCH] Implement `TransformObject` for `PartialCycle` --- .../src/algorithms/transform/cycle.rs | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/crates/fj-kernel/src/algorithms/transform/cycle.rs b/crates/fj-kernel/src/algorithms/transform/cycle.rs index b33b34035..0eef3cab8 100644 --- a/crates/fj-kernel/src/algorithms/transform/cycle.rs +++ b/crates/fj-kernel/src/algorithms/transform/cycle.rs @@ -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; @@ -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, + } + } +}