Skip to content

Commit

Permalink
Add conversion for CurveApproxSegment
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Oct 5, 2023
1 parent 2d63624 commit 61a7a38
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 104 deletions.
32 changes: 16 additions & 16 deletions crates/fj-core/src/algorithms/approx/curve/approx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,41 +84,41 @@ mod tests {
#[test]
fn reverse() {
let mut approx = CurveApprox::from([
CurveApproxSegment {
boundary: [[0.1], [0.4]].into(),
points: vec![
CurveApproxSegment::from((
[[0.1], [0.4]].into(),
[
ApproxPoint::new([0.1], [0.1, 0.1, 0.1]),
ApproxPoint::new([0.4], [0.4, 0.4, 0.4]),
],
},
CurveApproxSegment {
boundary: [[0.6], [0.9]].into(),
points: vec![
)),
CurveApproxSegment::from((
[[0.6], [0.9]].into(),
[
ApproxPoint::new([0.6], [0.6, 0.6, 0.6]),
ApproxPoint::new([0.9], [0.9, 0.9, 0.9]),
],
},
)),
]);

approx.reverse();

assert_eq!(
approx,
CurveApprox::from([
CurveApproxSegment {
boundary: [[0.9], [0.6]].into(),
points: vec![
CurveApproxSegment::from((
[[0.9], [0.6]].into(),
[
ApproxPoint::new([0.9], [0.9, 0.9, 0.9]),
ApproxPoint::new([0.6], [0.6, 0.6, 0.6]),
],
},
CurveApproxSegment {
boundary: [[0.4], [0.1]].into(),
points: vec![
)),
CurveApproxSegment::from((
[[0.4], [0.1]].into(),
[
ApproxPoint::new([0.4], [0.4, 0.4, 0.4]),
ApproxPoint::new([0.1], [0.1, 0.1, 0.1]),
],
}
)),
])
)
}
Expand Down
Loading

0 comments on commit 61a7a38

Please sign in to comment.