Skip to content

Commit

Permalink
Reverse edge in face sweep instead of edge sweep
Browse files Browse the repository at this point in the history
From the perspective of the edge sweep operation, there is no such thing
as a negative direction. This is only relevant to the face sweep, so it
makes more sense to do it there.

And in fact, the edge sweep operation can't even decide whether it
*should* reverse. The way the decision is made right now is incorrect:
#990
  • Loading branch information
hannobraun committed Sep 8, 2022
1 parent 1030d0a commit eb780ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 0 additions & 6 deletions crates/fj-kernel/src/algorithms/sweep/edge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ impl Sweep for (Edge, Color) {
let (edge, color) = self;
let path = path.into();

let edge = if path.is_negative_direction() {
edge.reverse_including_curve()
} else {
edge
};

let surface = edge.curve().sweep(path);

// We can't use the edge we're sweeping from as the bottom edge, as that
Expand Down
5 changes: 5 additions & 0 deletions crates/fj-kernel/src/algorithms/sweep/face.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ impl Sweep for Face {

for cycle in self.all_cycles() {
for &edge in cycle.edges() {
let edge = if path.is_negative_direction() {
edge.reverse_including_curve()
} else {
edge
};
let face = (edge, self.color()).sweep(path);
faces.push(face);
}
Expand Down

0 comments on commit eb780ee

Please sign in to comment.