Exemplo n.º 1
0
  public static Polygon3D buildPolygon(LineData ld, Vector points) {

    int size = ld.size();

    int[] cxr = new int[size];
    int[] cyr = new int[size];
    int[] czr = new int[size];
    Point3D[] normals = new Point3D[size];

    for (int i = 0; i < size; i++) {

      int num = ld.getIndex(i);

      Point3D p = (Point3D) points.elementAt(num);

      // real coordinates
      cxr[i] = (int) (p.x);
      cyr[i] = (int) (p.y);
      czr[i] = (int) (p.z);

      normals[i] = p.getNormal();
    }

    Polygon3D p3dr = new Polygon3D(size, cxr, cyr, czr, normals);

    return p3dr;
  }
Exemplo n.º 2
0
  public LineData clone() {

    LineData ldnew = new LineData();

    for (int i = 0; i < size(); i++) {

      ldnew.addIndex(getIndex(i));
    }

    return ldnew;
  }
Exemplo n.º 3
0
  private String decomposeLineData(LineData ld) {

    String str = "";

    for (int j = 0; j < ld.size(); j++) {

      if (j > 0) str += ",";
      str += ld.getIndex(j);
    }

    return str;
  }