use of org.twak.utils.collections.LoopL in project chordatlas by twak.
the class GISGen method initObj.
public void initObj() {
ObjRead gObj = new ObjRead(tweed.toWorkspace(objFile));
LoopL<Point3d> fromOBJ = new LoopL<>();
Closer<Point3d> closer = new Closer<>();
for (int[] face : gObj.faces) {
Loop<Point3d> loop = fromOBJ.newLoop();
List<Point3d> points = new ArrayList<>();
for (int i = 0; i < face.length; i++) {
Point3d p = new Point3d(gObj.pts[face[i]]), n = new Point3d(gObj.pts[face[(i + 1) % face.length]]);
// !
n.y = p.y = 0;
loop.append(p);
points.add(p);
lines.add(new Line3d(p, n));
}
closer.add(points.toArray(new Point3d[points.size()]));
}
createBlocks(closer, fromOBJ);
}
Aggregations