Skip to content

Commit

Permalink
Inline function
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Aug 30, 2022
1 parent ec9cd29 commit 6bfb514
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions crates/fj-operations/src/difference_2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use fj_interop::{debug::DebugInfo, mesh::Color};
use fj_kernel::{
algorithms::{approx::Tolerance, reverse::Reverse},
iter::ObjectIters,
objects::{Cycle, Face, Sketch},
objects::{Face, Sketch},
validation::{validate, Validated, ValidationConfig, ValidationError},
};
use fj_math::Aabb;
Expand Down Expand Up @@ -47,12 +47,10 @@ impl Shape for fj::Difference2d {
);

for cycle in face.exteriors() {
let cycle = add_cycle(cycle.clone(), false);
exteriors.push(cycle);
exteriors.push(cycle.clone());
}
for cycle in face.interiors() {
let cycle = add_cycle(cycle.clone(), true);
interiors.push(cycle);
interiors.push(cycle.clone().reverse());
}
}

Expand All @@ -64,8 +62,7 @@ impl Shape for fj::Difference2d {
);

for cycle in face.exteriors() {
let cycle = add_cycle(cycle.clone(), true);
interiors.push(cycle);
interiors.push(cycle.clone().reverse());
}
}

Expand All @@ -88,11 +85,3 @@ impl Shape for fj::Difference2d {
self.shapes()[0].bounding_volume()
}
}

fn add_cycle(cycle: Cycle, reverse: bool) -> Cycle {
if reverse {
cycle.reverse()
} else {
cycle
}
}

0 comments on commit 6bfb514

Please sign in to comment.