Skip to content

Commit

Permalink
Remove the fine-tuning on the 'y compare' routine and just always avo…
Browse files Browse the repository at this point in the history
…id re-using edges

(This leaves the tests passing but can result in unused edges in the right circumstances)
  • Loading branch information
Logicalshift committed Feb 26, 2023
1 parent 0dac775 commit 0d3bf12
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/bezier/path/graph_path/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -936,13 +936,16 @@ impl<Point: Coordinate+Coordinate2D, Label: Copy> GraphPath<Point, Label> {

// Check the 'already used' list only if there are no alternative edges from this point
let avoid_already_used = if following_connections.len() > 1 {
true
/*
// Use the 'used' array to exclude edges unless it would exclude all edges
// TODO: only do this if no loop is found that does not re-use edges (this is slightly too eager to re-use an edge)
following_connections.iter()
.any(|(_following_point_idx, following_edge)| {
visited_edges[following_edge.start_idx]&(1<<following_edge.edge_idx) == 0
&& used_edges[following_edge.start_idx]&(1<<following_edge.edge_idx) == 0
})
*/
} else {
false
};
Expand Down Expand Up @@ -1072,7 +1075,7 @@ impl<Point: Coordinate+Coordinate2D, Label: Copy> GraphPath<Point, Label> {
let y_a = self.points[*point_a].position.y();
let y_b = self.points[*point_b].position.y();

y_b.partial_cmp(&y_a).unwrap_or(Ordering::Equal)
y_a.partial_cmp(&y_b).unwrap_or(Ordering::Equal)
} else if x_a < x_b {
Ordering::Less
} else {
Expand Down

0 comments on commit 0d3bf12

Please sign in to comment.