From bbfd1a5e5063a2416c6d594d67bb774f3b80dde7 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Fri, 14 Jul 2023 10:25:19 +0200 Subject: [PATCH] Implement `TransformObject` for `Curve` --- .../fj-core/src/algorithms/transform/curve.rs | 19 +++++++++++++++++++ .../fj-core/src/algorithms/transform/mod.rs | 1 + 2 files changed, 20 insertions(+) create mode 100644 crates/fj-core/src/algorithms/transform/curve.rs diff --git a/crates/fj-core/src/algorithms/transform/curve.rs b/crates/fj-core/src/algorithms/transform/curve.rs new file mode 100644 index 000000000..d7209c7a9 --- /dev/null +++ b/crates/fj-core/src/algorithms/transform/curve.rs @@ -0,0 +1,19 @@ +use fj_math::Transform; + +use crate::{objects::Curve, services::Services}; + +use super::{TransformCache, TransformObject}; + +impl TransformObject for Curve { + fn transform_with_cache( + self, + _: &Transform, + _: &mut Services, + _: &mut TransformCache, + ) -> Self { + // There's nothing to actually transform here, as `Curve` holds no data. + // We still need this implementation though, as a new `Curve` object + // must be created to represent the new and transformed curve. + Self::new() + } +} diff --git a/crates/fj-core/src/algorithms/transform/mod.rs b/crates/fj-core/src/algorithms/transform/mod.rs index da46c29ef..b13bc49d8 100644 --- a/crates/fj-core/src/algorithms/transform/mod.rs +++ b/crates/fj-core/src/algorithms/transform/mod.rs @@ -1,5 +1,6 @@ //! API for transforming objects +mod curve; mod cycle; mod edge; mod face;