Skip to content

Commit

Permalink
Don't duplicate surface when transforming Face
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Oct 5, 2022
1 parent fab5da3 commit 332394b
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions crates/fj-kernel/src/algorithms/transform/face.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,28 @@ use fj_math::Transform;

use crate::{
objects::{Face, Faces},
partial::HasPartial,
stores::Stores,
};

use super::TransformObject;

impl TransformObject for Face {
fn transform(self, transform: &Transform, stores: &Stores) -> Self {
let exterior = self.exterior().clone().transform(transform, stores);
let interiors = self
.interiors()
.map(|cycle| cycle.clone().transform(transform, stores));
let surface = self.surface().clone().transform(transform, stores);
let exterior = self
.exterior()
.to_partial()
.transform(transform, stores)
.with_surface(surface.clone())
.build(stores);
let interiors = self.interiors().map(|cycle| {
cycle
.to_partial()
.transform(transform, stores)
.with_surface(surface.clone())
.build(stores)
});

let color = self.color();

Expand Down

0 comments on commit 332394b

Please sign in to comment.