diff --git a/src/kernel/approximation.rs b/src/kernel/approximation.rs index 26482bb13..7cb2938b3 100644 --- a/src/kernel/approximation.rs +++ b/src/kernel/approximation.rs @@ -33,10 +33,6 @@ impl Approximation { let mut points = Vec::new(); edge.curve.approx(tolerance, &mut points); - if edge.reverse { - points.reverse() - } - // Insert the exact vertices of this edge into the approximation. This // means we don't rely on the curve approximation to deliver accurate // representations of these vertices, which they might not be able to @@ -265,20 +261,6 @@ mod tests { segments: vec![Segment::from([b, c]), Segment::from([c, b])], } ); - - let mut edge_reversed = Edge::new(curve.clone(), Some([v2, v1])); - edge_reversed.reverse(); - assert_eq!( - Approximation::for_edge(&edge_reversed, tolerance), - Approximation { - points: vec![d, c, b, a], - segments: vec![ - Segment::from([d, c]), - Segment::from([c, b]), - Segment::from([b, a]), - ], - } - ); } #[test] diff --git a/src/kernel/shapes/difference_2d.rs b/src/kernel/shapes/difference_2d.rs index f6b2195ee..2b8db4dcf 100644 --- a/src/kernel/shapes/difference_2d.rs +++ b/src/kernel/shapes/difference_2d.rs @@ -75,7 +75,7 @@ impl Shape for fj::Difference2d { let mut a = self.a.edges(); let mut b = self.b.edges(); - let (a, mut b) = if a.cycles.len() == 1 && b.cycles.len() == 1 { + let (a, b) = if a.cycles.len() == 1 && b.cycles.len() == 1 { (a.cycles.pop().unwrap(), b.cycles.pop().unwrap()) } else { // See issue: @@ -86,10 +86,6 @@ impl Shape for fj::Difference2d { ); }; - for edge in &mut b.edges { - edge.reverse(); - } - Edges { cycles: vec![a, b] } } diff --git a/src/kernel/topology/edges.rs b/src/kernel/topology/edges.rs index 47e10da4a..298009c58 100644 --- a/src/kernel/topology/edges.rs +++ b/src/kernel/topology/edges.rs @@ -64,13 +64,6 @@ pub struct Edge { /// If there are no such vertices, that means the edge is connected to /// itself (like a full circle, for example). pub vertices: Option<[Vertex<1>; 2]>, - - /// Indicates whether the curve's direction is reversed - /// - /// Once this struct keeps track of the vertices that bound the edge, this - /// field can probably be made redundant. The order of the bounding points - /// will simply define the direction of the curve. - pub reverse: bool, } impl Edge { @@ -86,11 +79,7 @@ impl Edge { let vertices = vertices .map(|vertices| vertices.map(|vertex| vertex.to_1d(&curve))); - Self { - curve, - vertices, - reverse: false, - } + Self { curve, vertices } } /// Create a circle @@ -101,15 +90,9 @@ impl Edge { radius: Vector::from([radius, 0.]), }), vertices: None, - reverse: false, } } - /// Reverse the edge - pub fn reverse(&mut self) { - self.reverse = !self.reverse; - } - /// Create a transformed edge /// /// This method constructs new instances of [`Vertex`], by calling