Ejemplo n.º 1
0
 public String facesToString() {
   String result = "List of faces\n";
   Iterator it = this.facets.iterator();
   int cont = 0;
   while (it.hasNext()) {
     Face<X> f = (Face<X>) it.next();
     result = result + "f" + cont + " ";
     Halfedge<X> e = f.getEdge();
     while (e.getNext() != f.getEdge()) {
       result = result + vertices.indexOf(e.getVertex()) + " ";
       e = e.getNext();
     }
     result = result + vertices.indexOf(e.getVertex()) + "\n";
     cont++;
   }
   return result;
 }
Ejemplo n.º 2
0
  public void createCenterVertex(Face<X> f) {
    int degree = f.degree();
    Point_[] neighbors = new Point_[degree];

    Halfedge<X> e = f.getEdge();
    neighbors[0] = e.getVertex().getPoint();
    for (int i = 1; i < degree; i++) {
      e = e.getNext();
      neighbors[i] = e.getVertex().getPoint();
    }
    Point_ centerVertex;
    if (neighbors[0].dimension() == 2) centerVertex = new Point_2();
    else if (neighbors[0].dimension() == 3) centerVertex = new Point_3();
    else throw new Error("error point dimension");
  }