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; }
public LineData clone() { LineData ldnew = new LineData(); for (int i = 0; i < size(); i++) { ldnew.addIndex(getIndex(i)); } return ldnew; }
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; }