Skip to content

Commit

Permalink
Merge pull request #991 from hannobraun/sweep
Browse files Browse the repository at this point in the history
Make `Sweep::sweep` easier to call
  • Loading branch information
hannobraun authored Aug 24, 2022
2 parents fa0e5d7 + 5a0b6c0 commit dd413cb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
5 changes: 3 additions & 2 deletions crates/fj-kernel/src/algorithms/sweep/edge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ impl Sweep for Edge {
fn sweep(
self,
path: impl Into<Path>,
tolerance: crate::algorithms::Tolerance,
color: fj_interop::mesh::Color,
tolerance: impl Into<Tolerance>,
color: Color,
) -> Self::Swept {
let path = path.into();
let tolerance = tolerance.into();

if let Some(vertices) = self.vertices().get() {
let face = create_non_continuous_side_face(
Expand Down
9 changes: 6 additions & 3 deletions crates/fj-kernel/src/algorithms/sweep/face.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use fj_interop::mesh::Color;

use crate::{
algorithms::{reverse_face, TransformObject},
algorithms::{reverse_face, Tolerance, TransformObject},
objects::{Face, Shell},
};

Expand All @@ -11,10 +13,11 @@ impl Sweep for Face {
fn sweep(
self,
path: impl Into<Path>,
tolerance: crate::algorithms::Tolerance,
color: fj_interop::mesh::Color,
tolerance: impl Into<Tolerance>,
color: Color,
) -> Self::Swept {
let path = path.into();
let tolerance = tolerance.into();

let mut faces = Vec::new();

Expand Down
2 changes: 1 addition & 1 deletion crates/fj-kernel/src/algorithms/sweep/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub trait Sweep {
fn sweep(
self,
path: impl Into<Path>,
tolerance: Tolerance,
tolerance: impl Into<Tolerance>,
color: Color,
) -> Self::Swept;
}
Expand Down
3 changes: 2 additions & 1 deletion crates/fj-kernel/src/algorithms/sweep/sketch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ impl Sweep for Sketch {
fn sweep(
self,
path: impl Into<Path>,
tolerance: Tolerance,
tolerance: impl Into<Tolerance>,
color: Color,
) -> Self::Swept {
let path = path.into();
let tolerance = tolerance.into();

let mut shells = Vec::new();
for face in self.into_faces() {
Expand Down

0 comments on commit dd413cb

Please sign in to comment.