fn draw_segments(draw: &Draw, model: &Model) {
  let radians_per_segment = (2. * PI) / model.n_segments as f32;
  for n in 0..model.n_segments {
    let factor = n as f32 / model.n_segments as f32;
    let start_theta = n as f32 * radians_per_segment;
    let end_theta = (n + 1) as f32 * radians_per_segment;

    let n_layers = 8;
    let mut min_radius = lerp(
      model.min_radius,
      model.max_radius,
      n as f32 / (model.n_segments as f32 / 2.),
    );
    let mut max_radius = lerp(model.min_radius, model.max_radius, factor);
    let mut hue = model.hue;
    for _l in 0..n_layers {
      // this would be nice for nesting
      draw_segment(
        hue,
        model.sat,
        model.lum,
        min_radius,
        max_radius,
        start_theta,
        end_theta,
        draw,
      );
      min_radius = max_radius;
      max_radius = max_radius * 1.4;
      hue = hue * 1.34;
    }
  }
}
/// draw all segments around the circle
draw all segments around the circle
draw all segments around the circle
fn draw_segments(draw: &Draw, model: &Model) {
  let radians_per_segment = (2. * PI) / model.n_segments as f32;
  for n in 0..model.n_segments {
    let factor = n as f32 / model.n_segments as f32;
    let start_theta = n as f32 * radians_per_segment;
    let end_theta = (n + 1) as f32 * radians_per_segment;
    let n_layers = 8;
    let mut min_radius = lerp(
      model.min_radius,
      model.max_radius,
      n as f32 / (model.n_segments as f32 / 2.),
    );
    let mut max_radius = lerp(model.min_radius, model.max_radius, factor);
    let mut hue = model.hue;
    for _l in 0..n_layers {
      // this would be nice for nesting
      draw_segment(
        hue,
        model.sat,
        model.lum,
        min_radius,
        max_radius,
        start_theta,
        end_theta,
        draw,
      );
      min_radius = max_radius;
      max_radius = max_radius * 1.4;
      hue = hue * 1.34;
    }
  }
}
fn draw_segments ( draw : & Draw , model : & Model ) { let radians_per_segment = ( 2. * PI ) / model . n_segments as f32 ; for n in 0 .. model . n_segments { let factor = n as f32 / model . n_segments as f32 ; let start_theta = n as f32 * radians_per_segment ; let end_theta = ( n + 1 ) as f32 * radians_per_segment ; let n_layers = 8 ; let mut min_radius = lerp ( model . min_radius , model . max_radius , n as f32 / ( model . n_segments as f32 / 2. ) , ) ; let mut max_radius = lerp ( model . min_radius , model . max_radius , factor ) ; let mut hue = model . hue ; for _l in 0 .. n_layers { // this would be nice for nesting draw_segment ( hue , model . sat , model . lum , min_radius , max_radius , start_theta , end_theta , draw , ) ; min_radius = max_radius ; max_radius = max_radius * 1.4 ; hue = hue * 1.34 ; } } }
draw all segments around the circle
draw all segments around the circle
draw
&Draw
model
&Model