Hemesh : voronoi example

voronoi example

//requires hemesh 1.2.3 import wblut.hemesh.*; import wblut.hemesh.modifiers.*; import wblut.hemesh.creators.*; import wblut.geom.*; float[][] points; int numpoints; HE_Mesh container; HE_Mesh[] cells; int numcells; WB_Plane P1,P2; void setup() { size(800,800,P3D); //create a sphere HEC_Geodesic geo=new HEC_Geodesic(this); geo.setRadius(300).setLevel(2); container=new HE_Mesh(geo); //slice off most of both hemispheres P1=new WB_Plane(new WB_Point(0,0,-10), new WB_Vector(0,0,1)); P2=new WB_Plane(new WB_Point(0,0,10), new WB_Vector(0,0,-1)); HEM_Slice s=new HEM_Slice().setPlane(P1); container.modify(s); s=new HEM_Slice().setPlane(P2); container.modify(s); //generate points numpoints=50; points=new float[numpoints][3]; for(int i=0;i

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>