Skip to content

Commit

Permalink
Sides of sweep are now also flipped if needed
Browse files Browse the repository at this point in the history
Signed-off-by: gabsi26 <[email protected]>
  • Loading branch information
gabsi26 authored and hannobraun committed May 24, 2022
1 parent 96e4d53 commit b9384ab
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions crates/fj-kernel/src/algorithms/sweep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,22 @@ pub fn sweep_shape(
let top_edge =
source_to_top.edges().get(&edge_source).unwrap().clone();

let surface =
let surface = if path.dot(&Vector::from([0., 0., 1.]))
>= fj_math::Scalar::from_f64(0.)
{
target.insert(Surface::SweptCurve(SweptCurve {
curve: bottom_edge.get().curve(),
path,
}))?;
}))?
} else {
target.insert(
Surface::SweptCurve(SweptCurve {
curve: bottom_edge.get().curve(),
path,
})
.reverse(), ////////////////////////////////////
)?
};

let cycle = target.merge(Cycle::new(vec![
bottom_edge,
Expand Down

0 comments on commit b9384ab

Please sign in to comment.