pub fn ring(radius: usize) -> Vec<IVec2> {
  if radius == 0 { return vec![IVec2::ZERO] };
  let r = radius as i32;
  let mut pos = IVec2::new(-r, -r);
  let mut out = Vec::with_capacity(radius * 8);
  while pos.x < r { pos.x += 1; out.push(pos); };
  while pos.y < r { pos.y += 1; out.push(pos); };
  while pos.x > -r { pos.x -= 1; out.push(pos); };
  while pos.y > -r { pos.y -= 1; out.push(pos); };
  out
}
/// Creates a list of points along a square ring of a certain radius
Creates a list of points along a square ring of a certain radius
Creates a list of points along a square ring of a certain radius
pub fn ring(radius: usize) -> Vec<IVec2> {
  if radius == 0 { return vec![IVec2::ZERO] };
  let r = radius as i32;
  let mut pos = IVec2::new(-r, -r);
  let mut out = Vec::with_capacity(radius * 8);
  while pos.x < r { pos.x += 1; out.push(pos); };
  while pos.y < r { pos.y += 1; out.push(pos); };
  while pos.x > -r { pos.x -= 1; out.push(pos); };
  while pos.y > -r { pos.y -= 1; out.push(pos); };
  out
}
pub fn ring ( radius : usize ) -> Vec < IVec2 > { if radius == 0 { return vec ! [ IVec2 ZERO ] } ; let r = radius as i32 ; let mut pos = IVec2 :: new ( - r , - r ) ; let mut out = Vec :: with_capacity ( radius * 8 ) ; while pos . x < r { pos . x += 1 ; out . push ( pos ) ; } ; while pos . y < r { pos . y += 1 ; out . push ( pos ) ; } ; while pos . x > - r { pos . x -= 1 ; out . push ( pos ) ; } ; while pos . y > - r { pos . y -= 1 ; out . push ( pos ) ; } ; out }
Creates a list of points along a square ring of a certain radius
Creates a list of points along a square ring of a certain radius
radius
usize
radius
usize