fn draw_contour(draw: &Draw, model: &Model, _n: usize, contour: Vec<Deque2>) {
  let color = hsla(0.00, 0.00, 0.1, 0.05);
  let stroke = hsla(0.00, 0.00, 0.1, 0.70);
  for line in contour {
    if model.closed {
      // if the line is not closed (think a contour along a valley through a map),
      // then drawing it is f***ing hard, and we're just gonna skip it
      if is_somewhat_near(&line[0], line.back().unwrap()) {
        draw
          .polygon()
          .color(color)
          .stroke_weight(1.0)
          .stroke(stroke)
          .points(line);
        // Not sure why, but this crashes the program!
        // .points(smooth_by(10, &oversample(5, &line.into())));
      }
    } else {
      draw.polyline().color(stroke).weight(1.0).points(line);
    }
  }
}
// Draw all the lines for the contour.
// In contours1 and contours2, the `contour` vector contained a ton of 2-point segments.
// In this implementation, it contains full "connected" contours. However, any given
// contour can still have multiple non-contiguous segments, even if they are all closed.
// Hence, we still have a Vec<Line2>, but each Line2 has a very different meaning.
// In retrospect, I probably should have given the contour_segments a specific data type
// in contour1 and contour2, but y'know you live and learn
Draw all the lines for the contour.
In contours1 and contours2, the `contour` vector contained a ton of 2-point segments.
In this implementation, it contains full "connected" contours. However, any given
contour can still have multiple non-contiguous segments, even if they are all closed.
Hence, we still have a Vec, but each Line2 has a very different meaning.
In retrospect, I probably should have given the contour_segments a specific data type
in contour1 and contour2, but y'know you live and learn
Draw all the lines for the contour . In contours1 and contours2 the ` contour ` vector contained a ton of 2 - point segments . In this implementation it contains full " connected " contours . However any given contour can still have multiple non - contiguous segments even if they are all closed . Hence we still have a Vec but each Line2 has a very different meaning . In retrospect I probably should have given the contour_segments a specific data type in contour1 and contour2 but y ' know you live and learn
fn draw_contour(draw: &Draw, model: &Model, _n: usize, contour: Vec<Deque2>) {
  let color = hsla(0.00, 0.00, 0.1, 0.05);
  let stroke = hsla(0.00, 0.00, 0.1, 0.70);
  for line in contour {
    if model.closed {
      // if the line is not closed (think a contour along a valley through a map),
      // then drawing it is f***ing hard, and we're just gonna skip it
      if is_somewhat_near(&line[0], line.back().unwrap()) {
        draw
          .polygon()
          .color(color)
          .stroke_weight(1.0)
          .stroke(stroke)
          .points(line);
        // Not sure why, but this crashes the program!
        // .points(smooth_by(10, &oversample(5, &line.into())));
      }
    } else {
      draw.polyline().color(stroke).weight(1.0).points(line);
    }
  }
}
fn draw_contour ( draw : & Draw , model : & Model , _n : usize , contour : Vec < Deque2 > ) { let color = hsla ( 0.00 , 0.00 , 0.1 , 0.05 ) ; let stroke = hsla ( 0.00 , 0.00 , 0.1 , 0.70 ) ; for line in contour { if model . closed { // if the line is not closed (think a contour along a valley through a map), // then drawing it is f***ing hard, and we're just gonna skip it if is_somewhat_near ( & line [ 0 ] , line . back ( ) . unwrap ( ) ) { draw . polygon ( ) . color ( color ) . stroke_weight ( 1.0 ) . stroke ( stroke ) . points ( line ) ; // Not sure why, but this crashes the program! // .points(smooth_by(10, &oversample(5, &line.into()))); } } else { draw . polyline ( ) . color ( stroke ) . weight ( 1.0 ) . points ( line ) ; } } }
Draw all the lines for the contour.
Draw all the lines for the contour .
draw
&Draw
model
&Model
_n
usize
contour
Vec<Deque2>