Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make small cleanups in sweep code #2195

Merged
merged 3 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions crates/fj-core/src/operations/sweep/face.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use super::{SweepCache, SweepRegion};
///
/// [module documentation]: super
pub trait SweepFace {
/// # Sweep the [`Face`]
/// # Sweep the [`Face`] into a [`Shell`]
fn sweep_face(
&self,
path: impl Into<Vector<3>>,
Expand Down Expand Up @@ -51,12 +51,12 @@ impl SweepFace for Handle<Face> {
let bottom_face = self.clone();
faces.push(bottom_face.clone());

let side_faces = bottom_face
let other_faces = bottom_face
.region()
.sweep_region(bottom_face.surface(), path, cache, core)
.all_faces()
.map(|side_face| side_face.insert(&mut core.services));
faces.extend(side_faces);
faces.extend(other_faces);

Shell::new(faces)
}
Expand Down
30 changes: 15 additions & 15 deletions crates/fj-core/src/operations/sweep/region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,21 @@ impl SweepRegion for Region {
core,
);

let mut top_interiors = Vec::new();

for bottom_cycle in self.interiors() {
let top_cycle = sweep_cycle(
bottom_cycle,
surface,
self.color(),
&mut faces,
path,
cache,
core,
);

top_interiors.push(top_cycle);
}
let top_interiors = self
.interiors()
.iter()
.map(|bottom_cycle| {
sweep_cycle(
bottom_cycle,
surface,
self.color(),
&mut faces,
path,
cache,
core,
)
})
.collect::<Vec<_>>();

let top_face = {
let top_surface = surface
Expand Down