fn points_for_ring(i: i32, model: &Model) -> Line2 {
  let Model {
    max_radius,
    min_radius,
    padding,
    n_rings,
    ..
  } = *model;
  let inner_radius = map_range(i, 0, n_rings, min_radius, max_radius);
  let outer_radius = map_range(i, 0, n_rings, min_radius, max_radius)
    + (max_radius - min_radius) / n_rings as f32
    - padding;
  let start_degree = i * 20;
  let end_degree = start_degree + 330;
  let inner_points = (start_degree..end_degree)
    .map(point_mapper(inner_radius, model.seed))
    .rev();
  let outer_points = (start_degree..end_degree).map(point_mapper(outer_radius, model.seed));
  inner_points.chain(outer_points).collect()
}
// generates a line suitable for a polygon defining a "ring"
generates a line suitable for a polygon defining a "ring"
generates a line suitable for a polygon defining a " ring "
fn points_for_ring(i: i32, model: &Model) -> Line2 {
  let Model {
    max_radius,
    min_radius,
    padding,
    n_rings,
    ..
  } = *model;
  let inner_radius = map_range(i, 0, n_rings, min_radius, max_radius);
  let outer_radius = map_range(i, 0, n_rings, min_radius, max_radius)
    + (max_radius - min_radius) / n_rings as f32
    - padding;
  let start_degree = i * 20;
  let end_degree = start_degree + 330;
  let inner_points = (start_degree..end_degree)
    .map(point_mapper(inner_radius, model.seed))
    .rev();
  let outer_points = (start_degree..end_degree).map(point_mapper(outer_radius, model.seed));
  inner_points.chain(outer_points).collect()
}
fn points_for_ring ( i : i32 , model : & Model ) -> Line2 { let Model { max_radius , min_radius , padding , n_rings , .. } = * model ; let inner_radius = map_range ( i , 0 , n_rings , min_radius , max_radius ) ; let outer_radius = map_range ( i , 0 , n_rings , min_radius , max_radius ) + ( max_radius - min_radius ) / n_rings as f32 - padding ; let start_degree = i * 20 ; let end_degree = start_degree + 330 ; let inner_points = ( start_degree .. end_degree ) . map ( point_mapper ( inner_radius , model . seed ) ) . rev ( ) ; let outer_points = ( start_degree .. end_degree ) . map ( point_mapper ( outer_radius , model . seed ) ) ; inner_points . chain ( outer_points ) . collect ( ) }
generates a line suitable for a polygon defining a "ring"
generates a line suitable for a polygon defining a " ring "
i
i32
model
&Model