diff --git a/crates/fj-kernel/src/algorithms/transform/edge.rs b/crates/fj-kernel/src/algorithms/transform/edge.rs index 4ff8324a3e..713b0bf10f 100644 --- a/crates/fj-kernel/src/algorithms/transform/edge.rs +++ b/crates/fj-kernel/src/algorithms/transform/edge.rs @@ -2,7 +2,7 @@ use fj_math::Transform; use crate::{ objects::{GlobalEdge, HalfEdge}, - partial::{HasPartial, PartialGlobalEdge}, + partial::{HasPartial, PartialGlobalEdge, PartialHalfEdge}, stores::Stores, }; @@ -45,6 +45,43 @@ impl TransformObject for GlobalEdge { } } +impl TransformObject for PartialHalfEdge { + fn transform(self, transform: &Transform, stores: &Stores) -> Self { + let curve = self + .curve + .clone() + .map(|curve| curve.transform(transform, stores)); + let vertices = self.vertices.clone().map(|vertices| { + vertices.map(|vertex| { + let vertex = vertex.into_partial().transform(transform, stores); + let vertex = match &curve { + Some(curve) => vertex.with_curve(curve.clone()), + None => vertex, + }; + vertex.into() + }) + }); + let global_form = self.global_form.map(|global_form| { + let global_form = + global_form.into_partial().transform(transform, stores); + + let curve = curve.as_ref().and_then(|curve| curve.global_form()); + let global_form = match curve { + Some(curve) => global_form.with_curve(curve), + None => global_form, + }; + + global_form.into() + }); + + Self { + curve, + vertices, + global_form, + } + } +} + impl TransformObject for PartialGlobalEdge { fn transform(self, transform: &Transform, stores: &Stores) -> Self { let curve =