Пример #1
0
 public Pnt[] getContourForSite(Pnt sitex) {
   HashSet<Pnt> done = new HashSet<Pnt>(initialTriangle);
   for (Triangle triangle : dt)
     for (Pnt site : triangle) {
       if (done.contains(site)) continue;
       done.add(site);
       List<Triangle> list = dt.surroundingTriangles(site, triangle);
       Pnt[] vertices = new Pnt[list.size()];
       int i = 0;
       for (Triangle tri : list) vertices[i++] = tri.getCircumcenter();
       // draw(vertices, withFill ? getColor(site) :
       // null);
       if (site == sitex) return vertices;
     }
   return null;
 }
Пример #2
0
 public Pnt add(Vec2 location) {
   Pnt site = new Pnt((float) location.x, (float) location.y);
   dt.delaunayPlace(site);
   return site;
 }