Package rope.mesh

Class R_Voronoi

All Implemented Interfaces:
R_Constants, R_Constants_Colour

public class R_Voronoi extends BigBang
  • Constructor Details

    • R_Voronoi

      public R_Voronoi(processing.core.PApplet pa)
      Constructor
      Parameters:
      pa -
    • R_Voronoi

      public R_Voronoi(processing.core.PApplet pa, float size)
      Constructor
      Parameters:
      pa -
      size -
  • Method Details

    • size

      public int size()
      Returns:
      the num of seeds
    • update

      public void update()
      Is use to update the list of coordonate for areas and triangles the refresh happen when a point is added or remove.
    • add_seed

      public void add_seed(float x, float y, int arg)
      Add new seed to populate the voronoi diagram
      Parameters:
      x - coordinate
      y - coordinate
      arg - as int information, like color for example
    • add_seed

      public void add_seed(float x, float y)
    • add_seed

      public void add_seed(vec2 seed, int arg)
    • add_seed

      public void add_seed(vec2 seed)
    • add_seeds

      public void add_seeds(vec3... seeds)
      it's important to figure the z information will be casted to int. see public void add_seed(float x, float y, int arg)
      Parameters:
      seeds - is vec3 the first and second argument of the vec3 (x,y) is for coordinate, and z is for information, you must figure this value shoulb be cast to int
    • get_seed

      public vec3 get_seed(int index)
    • get_seeds

      public List<vec3> get_seeds()
    • remove_seed

      public void remove_seed(int index)
    • get_polygon

      public R_Shape get_polygon(int index)
    • get_polygons

      public List<R_Shape> get_polygons()
      Returns:
      the list voronoi polygon, the area is discribe by cloud of vec2 points
    • get_area

      @Deprecated public R_Shape get_area(int index)
      Deprecated.
      instead use get_polygon(int index)
      Parameters:
      index -
      Returns:
    • get_areas

      @Deprecated public List<R_Shape> get_areas()
      Deprecated.
      instead use get_polygons()
      Returns:
    • get_triangle

      public R_Shape get_triangle(int index)
    • get_triangles

      public List<R_Shape> get_triangles()
      Returns:
    • update

      public void update(boolean refresh_is)
      Parameters:
      refresh_is - is an other condition to refresh the list.