-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1170 from hannobraun/transform
Fix `Face` transform code creating duplicate `Surface`s
- Loading branch information
Showing
6 changed files
with
74 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,24 @@ | ||
use fj_math::Transform; | ||
|
||
use crate::{objects::Cycle, stores::Stores}; | ||
use crate::{partial::PartialCycle, stores::Stores}; | ||
|
||
use super::TransformObject; | ||
|
||
impl TransformObject for Cycle { | ||
impl TransformObject for PartialCycle { | ||
fn transform(self, transform: &Transform, stores: &Stores) -> Self { | ||
Self::new( | ||
self.surface().clone().transform(transform, stores), | ||
self.into_half_edges() | ||
.map(|edge| edge.transform(transform, stores)), | ||
) | ||
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, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters