From 3f2b0fd763ebb1bfaf4e23e97708a2d9c9706f66 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 28 Jun 2022 16:27:40 +0200 Subject: [PATCH 01/11] Fix function name --- crates/fj-kernel/src/algorithms/sweep.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/fj-kernel/src/algorithms/sweep.rs b/crates/fj-kernel/src/algorithms/sweep.rs index 93e343f74..e5ea6137a 100644 --- a/crates/fj-kernel/src/algorithms/sweep.rs +++ b/crates/fj-kernel/src/algorithms/sweep.rs @@ -102,8 +102,8 @@ fn create_top_face( surface = surface.transform(&translation); let mut tmp = Shape::new(); - exteriors = transform_cycle(&exteriors, &translation, &mut tmp); - interiors = transform_cycle(&interiors, &translation, &mut tmp); + exteriors = transform_cycles(&exteriors, &translation, &mut tmp); + interiors = transform_cycles(&interiors, &translation, &mut tmp); if is_sweep_along_negative_direction { surface = surface.reverse(); @@ -149,7 +149,7 @@ fn reverse_local_coordinates_in_cycle(cycles: &CyclesInFace) -> CyclesInFace { CyclesInFace::new(cycles) } -fn transform_cycle( +fn transform_cycles( cycles: &CyclesInFace, transform: &Transform, target: &mut Shape, From 12891e33e8facc3aa0a27cc31fa02ae5f88c80f2 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 28 Jun 2022 16:28:55 +0200 Subject: [PATCH 02/11] Move `transform_cycles` to `transform` module --- crates/fj-kernel/src/algorithms/sweep.rs | 80 +------------------ crates/fj-kernel/src/algorithms/transform.rs | 82 +++++++++++++++++++- 2 files changed, 81 insertions(+), 81 deletions(-) diff --git a/crates/fj-kernel/src/algorithms/sweep.rs b/crates/fj-kernel/src/algorithms/sweep.rs index e5ea6137a..abc706c74 100644 --- a/crates/fj-kernel/src/algorithms/sweep.rs +++ b/crates/fj-kernel/src/algorithms/sweep.rs @@ -8,7 +8,7 @@ use crate::{ shape::{LocalForm, Shape}, }; -use super::{CycleApprox, Tolerance}; +use super::{transform::transform_cycles, CycleApprox, Tolerance}; /// Create a solid by sweeping a sketch pub fn sweep( @@ -149,84 +149,6 @@ fn reverse_local_coordinates_in_cycle(cycles: &CyclesInFace) -> CyclesInFace { CyclesInFace::new(cycles) } -fn transform_cycles( - cycles: &CyclesInFace, - transform: &Transform, - target: &mut Shape, -) -> CyclesInFace { - let cycles = cycles.as_local_form().map(|cycle| { - let edges_local = cycle - .local() - .edges - .iter() - .map(|edge| { - let curve_local = *edge.local().curve.local(); - let curve_canonical = target - .merge(edge.canonical().get().curve().transform(transform)); - - let vertices = edge.canonical().get().vertices.map(|vertex| { - let point = vertex.canonical().get().point; - let point = transform.transform_point(&point); - - let local = *vertex.local(); - let canonical = target.merge(Vertex { point }); - - LocalForm::new(local, canonical) - }); - - let edge_local = Edge { - curve: LocalForm::new(curve_local, curve_canonical.clone()), - vertices: vertices.clone(), - }; - let edge_canonical = target.merge(Edge { - curve: LocalForm::canonical_only(curve_canonical), - vertices, - }); - - LocalForm::new(edge_local, edge_canonical) - }) - .collect(); - let edges_canonical = cycle - .canonical() - .get() - .edges - .iter() - .map(|edge| { - let edge = edge.canonical().get(); - - let curve = { - let curve = edge.curve().transform(transform); - - let curve = target.merge(curve); - LocalForm::canonical_only(curve) - }; - let vertices = edge.vertices.map(|vertex| { - let point = vertex.canonical().get().point; - let point = transform.transform_point(&point); - - let local = *vertex.local(); - let canonical = target.merge(Vertex { point }); - - LocalForm::new(local, canonical) - }); - - let edge = target.merge(Edge { curve, vertices }); - LocalForm::canonical_only(edge) - }) - .collect(); - - let cycle_local = Cycle { edges: edges_local }; - - let cycle_canonical = target.merge(Cycle { - edges: edges_canonical, - }); - - LocalForm::new(cycle_local, cycle_canonical) - }); - - CyclesInFace::new(cycles) -} - fn create_non_continuous_side_face( path: Vector<3>, is_sweep_along_negative_direction: bool, diff --git a/crates/fj-kernel/src/algorithms/transform.rs b/crates/fj-kernel/src/algorithms/transform.rs index 3da41920b..c1a280aa4 100644 --- a/crates/fj-kernel/src/algorithms/transform.rs +++ b/crates/fj-kernel/src/algorithms/transform.rs @@ -1,8 +1,8 @@ use fj_math::Transform; use crate::{ - objects::{Curve, Face, Surface, Vertex}, - shape::Shape, + objects::{Curve, Cycle, CyclesInFace, Edge, Face, Surface, Vertex}, + shape::{LocalForm, Shape}, }; /// Transform the geometry of the shape @@ -28,3 +28,81 @@ pub fn transform_shape(shape: &mut Shape, transform: &Transform) { } }); } + +pub fn transform_cycles( + cycles: &CyclesInFace, + transform: &Transform, + target: &mut Shape, +) -> CyclesInFace { + let cycles = cycles.as_local_form().map(|cycle| { + let edges_local = cycle + .local() + .edges + .iter() + .map(|edge| { + let curve_local = *edge.local().curve.local(); + let curve_canonical = target + .merge(edge.canonical().get().curve().transform(transform)); + + let vertices = edge.canonical().get().vertices.map(|vertex| { + let point = vertex.canonical().get().point; + let point = transform.transform_point(&point); + + let local = *vertex.local(); + let canonical = target.merge(Vertex { point }); + + LocalForm::new(local, canonical) + }); + + let edge_local = Edge { + curve: LocalForm::new(curve_local, curve_canonical.clone()), + vertices: vertices.clone(), + }; + let edge_canonical = target.merge(Edge { + curve: LocalForm::canonical_only(curve_canonical), + vertices, + }); + + LocalForm::new(edge_local, edge_canonical) + }) + .collect(); + let edges_canonical = cycle + .canonical() + .get() + .edges + .iter() + .map(|edge| { + let edge = edge.canonical().get(); + + let curve = { + let curve = edge.curve().transform(transform); + + let curve = target.merge(curve); + LocalForm::canonical_only(curve) + }; + let vertices = edge.vertices.map(|vertex| { + let point = vertex.canonical().get().point; + let point = transform.transform_point(&point); + + let local = *vertex.local(); + let canonical = target.merge(Vertex { point }); + + LocalForm::new(local, canonical) + }); + + let edge = target.merge(Edge { curve, vertices }); + LocalForm::canonical_only(edge) + }) + .collect(); + + let cycle_local = Cycle { edges: edges_local }; + + let cycle_canonical = target.merge(Cycle { + edges: edges_canonical, + }); + + LocalForm::new(cycle_local, cycle_canonical) + }); + + CyclesInFace::new(cycles) +} From a22cfab213c7af9084c3b3b3b1ef199cfe0c1ac3 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 28 Jun 2022 16:32:13 +0200 Subject: [PATCH 03/11] Remove redundant function argument --- crates/fj-kernel/src/algorithms/sweep.rs | 4 ++-- crates/fj-kernel/src/algorithms/transform.rs | 17 +++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/crates/fj-kernel/src/algorithms/sweep.rs b/crates/fj-kernel/src/algorithms/sweep.rs index abc706c74..d079070d8 100644 --- a/crates/fj-kernel/src/algorithms/sweep.rs +++ b/crates/fj-kernel/src/algorithms/sweep.rs @@ -102,8 +102,8 @@ fn create_top_face( surface = surface.transform(&translation); let mut tmp = Shape::new(); - exteriors = transform_cycles(&exteriors, &translation, &mut tmp); - interiors = transform_cycles(&interiors, &translation, &mut tmp); + exteriors = transform_cycles(&exteriors, &translation); + interiors = transform_cycles(&interiors, &translation); if is_sweep_along_negative_direction { surface = surface.reverse(); diff --git a/crates/fj-kernel/src/algorithms/transform.rs b/crates/fj-kernel/src/algorithms/transform.rs index c1a280aa4..6a0b3c413 100644 --- a/crates/fj-kernel/src/algorithms/transform.rs +++ b/crates/fj-kernel/src/algorithms/transform.rs @@ -32,8 +32,9 @@ pub fn transform_shape(shape: &mut Shape, transform: &Transform) { pub fn transform_cycles( cycles: &CyclesInFace, transform: &Transform, - target: &mut Shape, ) -> CyclesInFace { + let mut tmp = Shape::new(); + let cycles = cycles.as_local_form().map(|cycle| { let edges_local = cycle .local() @@ -41,7 +42,7 @@ pub fn transform_cycles( .iter() .map(|edge| { let curve_local = *edge.local().curve.local(); - let curve_canonical = target + let curve_canonical = tmp .merge(edge.canonical().get().curve().transform(transform)); let vertices = edge.canonical().get().vertices.map(|vertex| { @@ -49,7 +50,7 @@ pub fn transform_cycles( let point = transform.transform_point(&point); let local = *vertex.local(); - let canonical = target.merge(Vertex { point }); + let canonical = tmp.merge(Vertex { point }); LocalForm::new(local, canonical) }); @@ -58,7 +59,7 @@ pub fn transform_cycles( curve: LocalForm::new(curve_local, curve_canonical.clone()), vertices: vertices.clone(), }; - let edge_canonical = target.merge(Edge { + let edge_canonical = tmp.merge(Edge { curve: LocalForm::canonical_only(curve_canonical), vertices, }); @@ -77,7 +78,7 @@ pub fn transform_cycles( let curve = { let curve = edge.curve().transform(transform); - let curve = target.merge(curve); + let curve = tmp.merge(curve); LocalForm::canonical_only(curve) }; let vertices = edge.vertices.map(|vertex| { @@ -85,19 +86,19 @@ pub fn transform_cycles( let point = transform.transform_point(&point); let local = *vertex.local(); - let canonical = target.merge(Vertex { point }); + let canonical = tmp.merge(Vertex { point }); LocalForm::new(local, canonical) }); - let edge = target.merge(Edge { curve, vertices }); + let edge = tmp.merge(Edge { curve, vertices }); LocalForm::canonical_only(edge) }) .collect(); let cycle_local = Cycle { edges: edges_local }; - let cycle_canonical = target.merge(Cycle { + let cycle_canonical = tmp.merge(Cycle { edges: edges_canonical, }); From 5066a999858a8805b4649150a9f6262c5bb05990 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 28 Jun 2022 16:32:37 +0200 Subject: [PATCH 04/11] Refactor --- crates/fj-kernel/src/algorithms/sweep.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/fj-kernel/src/algorithms/sweep.rs b/crates/fj-kernel/src/algorithms/sweep.rs index d079070d8..0ee491af3 100644 --- a/crates/fj-kernel/src/algorithms/sweep.rs +++ b/crates/fj-kernel/src/algorithms/sweep.rs @@ -101,7 +101,6 @@ fn create_top_face( surface = surface.transform(&translation); - let mut tmp = Shape::new(); exteriors = transform_cycles(&exteriors, &translation); interiors = transform_cycles(&interiors, &translation); @@ -112,6 +111,7 @@ fn create_top_face( interiors = reverse_local_coordinates_in_cycle(&interiors); }; + let mut tmp = Shape::new(); let surface = tmp.insert(surface); let face = Face::new( From 4e8543f7ecb8027eabc75e415075aaaa40d7441a Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 28 Jun 2022 16:35:57 +0200 Subject: [PATCH 05/11] Return `Vec` from `transform_shape` --- crates/fj-kernel/src/algorithms/transform.rs | 56 +++++++++++++------- crates/fj-operations/src/transform.rs | 11 ++-- 2 files changed, 46 insertions(+), 21 deletions(-) diff --git a/crates/fj-kernel/src/algorithms/transform.rs b/crates/fj-kernel/src/algorithms/transform.rs index 6a0b3c413..9ff6bb5d4 100644 --- a/crates/fj-kernel/src/algorithms/transform.rs +++ b/crates/fj-kernel/src/algorithms/transform.rs @@ -1,7 +1,8 @@ use fj_math::Transform; use crate::{ - objects::{Curve, Cycle, CyclesInFace, Edge, Face, Surface, Vertex}, + iter::ObjectIters, + objects::{Cycle, CyclesInFace, Edge, Face, FaceBRep, Vertex}, shape::{LocalForm, Shape}, }; @@ -9,24 +10,43 @@ use crate::{ /// /// Since the topological types refer to geometry, and don't contain any /// geometry themselves, this transforms the whole shape. -pub fn transform_shape(shape: &mut Shape, transform: &Transform) { - shape - .update() - .update_all(|vertex: &mut Vertex| { - vertex.point = transform.transform_point(&vertex.point) - }) - .update_all(|curve: &mut Curve<3>| *curve = curve.transform(transform)) - .update_all(|surface: &mut Surface| { - *surface = surface.transform(transform) - }) - .update_all(|mut face: &mut Face| { - use std::ops::DerefMut as _; - if let Face::Triangles(triangles) = face.deref_mut() { - for (triangle, _) in triangles { - *triangle = transform.transform_triangle(triangle); - } +pub fn transform_shape(shape: &Shape, transform: &Transform) -> Vec { + let mut target = Vec::new(); + + for face in shape.face_iter() { + let face = match face { + Face::Face(face) => { + let mut tmp = Shape::new(); + let surface = face.surface.get().transform(transform); + let surface = tmp.insert(surface); + + let exteriors = transform_cycles(&face.exteriors, transform); + let interiors = transform_cycles(&face.interiors, transform); + + let color = face.color; + + Face::Face(FaceBRep { + surface, + exteriors, + interiors, + color, + }) } - }); + Face::Triangles(triangles) => { + let mut target = Vec::new(); + + for (triangle, color) in triangles { + let triangle = transform.transform_triangle(&triangle); + target.push((triangle, color)); + } + + Face::Triangles(target) + } + }; + target.push(face); + } + + target } pub fn transform_cycles( diff --git a/crates/fj-operations/src/transform.rs b/crates/fj-operations/src/transform.rs index bfd1a207c..5af06abd0 100644 --- a/crates/fj-operations/src/transform.rs +++ b/crates/fj-operations/src/transform.rs @@ -16,12 +16,17 @@ impl ToShape for fj::Transform { debug_info: &mut DebugInfo, ) -> Result, ValidationError> { let shape = self.shape.to_shape(config, tolerance, debug_info)?; - let mut shape = shape.into_inner(); + let shape = shape.into_inner(); let transform = transform(self); + let faces = transform_shape(&shape, &transform); - transform_shape(&mut shape, &transform); - let shape = validate(shape, config)?; + let mut target = Shape::new(); + for face in faces { + target.merge(face); + } + + let shape = validate(target, config)?; Ok(shape) } From 50c6c648361ac15116fff02c1420f87eaf8843ac Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 28 Jun 2022 16:36:42 +0200 Subject: [PATCH 06/11] Make function name more explicit --- crates/fj-operations/src/transform.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/fj-operations/src/transform.rs b/crates/fj-operations/src/transform.rs index 5af06abd0..447088109 100644 --- a/crates/fj-operations/src/transform.rs +++ b/crates/fj-operations/src/transform.rs @@ -18,7 +18,7 @@ impl ToShape for fj::Transform { let shape = self.shape.to_shape(config, tolerance, debug_info)?; let shape = shape.into_inner(); - let transform = transform(self); + let transform = make_transform(self); let faces = transform_shape(&shape, &transform); let mut target = Shape::new(); @@ -32,11 +32,11 @@ impl ToShape for fj::Transform { } fn bounding_volume(&self) -> Aabb<3> { - transform(self).transform_aabb(&self.shape.bounding_volume()) + make_transform(self).transform_aabb(&self.shape.bounding_volume()) } } -fn transform(transform: &fj::Transform) -> Transform { +fn make_transform(transform: &fj::Transform) -> Transform { let axis = Vector::from(transform.axis).normalize(); Transform::translation(transform.offset) * Transform::rotation(axis * transform.angle.rad()) From 503cbe18ae694bea3e6b0e84b98fb52bc489d34f Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 28 Jun 2022 16:37:52 +0200 Subject: [PATCH 07/11] Refactor --- crates/fj-operations/src/transform.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/fj-operations/src/transform.rs b/crates/fj-operations/src/transform.rs index 447088109..8b52eb5a8 100644 --- a/crates/fj-operations/src/transform.rs +++ b/crates/fj-operations/src/transform.rs @@ -18,8 +18,7 @@ impl ToShape for fj::Transform { let shape = self.shape.to_shape(config, tolerance, debug_info)?; let shape = shape.into_inner(); - let transform = make_transform(self); - let faces = transform_shape(&shape, &transform); + let faces = transform_shape(&shape, &make_transform(self)); let mut target = Shape::new(); for face in faces { From f546bab9215cdb69ba35a170396db0be5b386a45 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 28 Jun 2022 16:38:08 +0200 Subject: [PATCH 08/11] Simplify function name --- crates/fj-kernel/src/algorithms/mod.rs | 2 +- crates/fj-kernel/src/algorithms/transform.rs | 2 +- crates/fj-operations/src/transform.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/fj-kernel/src/algorithms/mod.rs b/crates/fj-kernel/src/algorithms/mod.rs index 559f22709..01928fca2 100644 --- a/crates/fj-kernel/src/algorithms/mod.rs +++ b/crates/fj-kernel/src/algorithms/mod.rs @@ -13,6 +13,6 @@ pub mod intersection; pub use self::{ approx::{CycleApprox, FaceApprox, InvalidTolerance, Tolerance}, sweep::sweep, - transform::transform_shape, + transform::transform, triangulation::triangulate, }; diff --git a/crates/fj-kernel/src/algorithms/transform.rs b/crates/fj-kernel/src/algorithms/transform.rs index 9ff6bb5d4..7c7be11bc 100644 --- a/crates/fj-kernel/src/algorithms/transform.rs +++ b/crates/fj-kernel/src/algorithms/transform.rs @@ -10,7 +10,7 @@ use crate::{ /// /// Since the topological types refer to geometry, and don't contain any /// geometry themselves, this transforms the whole shape. -pub fn transform_shape(shape: &Shape, transform: &Transform) -> Vec { +pub fn transform(shape: &Shape, transform: &Transform) -> Vec { let mut target = Vec::new(); for face in shape.face_iter() { diff --git a/crates/fj-operations/src/transform.rs b/crates/fj-operations/src/transform.rs index 8b52eb5a8..b44acb58b 100644 --- a/crates/fj-operations/src/transform.rs +++ b/crates/fj-operations/src/transform.rs @@ -1,6 +1,6 @@ use fj_interop::debug::DebugInfo; use fj_kernel::{ - algorithms::{transform_shape, Tolerance}, + algorithms::{transform, Tolerance}, shape::Shape, validation::{validate, Validated, ValidationConfig, ValidationError}, }; @@ -18,7 +18,7 @@ impl ToShape for fj::Transform { let shape = self.shape.to_shape(config, tolerance, debug_info)?; let shape = shape.into_inner(); - let faces = transform_shape(&shape, &make_transform(self)); + let faces = transform(&shape, &make_transform(self)); let mut target = Shape::new(); for face in faces { From 9aa8efaa3696e49a88cb7abfbe1931fe6a6f7bca Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 28 Jun 2022 16:39:31 +0200 Subject: [PATCH 09/11] Simplify doc comment --- crates/fj-kernel/src/algorithms/transform.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/crates/fj-kernel/src/algorithms/transform.rs b/crates/fj-kernel/src/algorithms/transform.rs index 7c7be11bc..4d48ba39a 100644 --- a/crates/fj-kernel/src/algorithms/transform.rs +++ b/crates/fj-kernel/src/algorithms/transform.rs @@ -6,10 +6,7 @@ use crate::{ shape::{LocalForm, Shape}, }; -/// Transform the geometry of the shape -/// -/// Since the topological types refer to geometry, and don't contain any -/// geometry themselves, this transforms the whole shape. +/// Transform a shape pub fn transform(shape: &Shape, transform: &Transform) -> Vec { let mut target = Vec::new(); From 34a34e52b58e6f566be45a1174b1c6f6c157394f Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 28 Jun 2022 16:42:27 +0200 Subject: [PATCH 10/11] Accept `Vec` in `transform` --- crates/fj-kernel/src/algorithms/transform.rs | 7 +++---- crates/fj-operations/src/transform.rs | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/fj-kernel/src/algorithms/transform.rs b/crates/fj-kernel/src/algorithms/transform.rs index 4d48ba39a..31e08dd27 100644 --- a/crates/fj-kernel/src/algorithms/transform.rs +++ b/crates/fj-kernel/src/algorithms/transform.rs @@ -1,16 +1,15 @@ use fj_math::Transform; use crate::{ - iter::ObjectIters, objects::{Cycle, CyclesInFace, Edge, Face, FaceBRep, Vertex}, shape::{LocalForm, Shape}, }; /// Transform a shape -pub fn transform(shape: &Shape, transform: &Transform) -> Vec { +pub fn transform(shape: &[Face], transform: &Transform) -> Vec { let mut target = Vec::new(); - for face in shape.face_iter() { + for face in shape { let face = match face { Face::Face(face) => { let mut tmp = Shape::new(); @@ -32,7 +31,7 @@ pub fn transform(shape: &Shape, transform: &Transform) -> Vec { Face::Triangles(triangles) => { let mut target = Vec::new(); - for (triangle, color) in triangles { + for &(triangle, color) in triangles { let triangle = transform.transform_triangle(&triangle); target.push((triangle, color)); } diff --git a/crates/fj-operations/src/transform.rs b/crates/fj-operations/src/transform.rs index b44acb58b..39eb98380 100644 --- a/crates/fj-operations/src/transform.rs +++ b/crates/fj-operations/src/transform.rs @@ -1,6 +1,7 @@ use fj_interop::debug::DebugInfo; use fj_kernel::{ algorithms::{transform, Tolerance}, + iter::ObjectIters, shape::Shape, validation::{validate, Validated, ValidationConfig, ValidationError}, }; @@ -18,6 +19,7 @@ impl ToShape for fj::Transform { let shape = self.shape.to_shape(config, tolerance, debug_info)?; let shape = shape.into_inner(); + let shape = shape.face_iter().collect::>(); let faces = transform(&shape, &make_transform(self)); let mut target = Shape::new(); From 5e29f603548e76f4c8773b978eb8bb136e6b4928 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 28 Jun 2022 16:42:53 +0200 Subject: [PATCH 11/11] Update variable name --- crates/fj-kernel/src/algorithms/transform.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/fj-kernel/src/algorithms/transform.rs b/crates/fj-kernel/src/algorithms/transform.rs index 31e08dd27..bd148a9ae 100644 --- a/crates/fj-kernel/src/algorithms/transform.rs +++ b/crates/fj-kernel/src/algorithms/transform.rs @@ -6,10 +6,10 @@ use crate::{ }; /// Transform a shape -pub fn transform(shape: &[Face], transform: &Transform) -> Vec { +pub fn transform(faces: &[Face], transform: &Transform) -> Vec { let mut target = Vec::new(); - for face in shape { + for face in faces { let face = match face { Face::Face(face) => { let mut tmp = Shape::new();