use of org.twak.tweed.gen.BlockGen in project chordatlas by twak.
the class FacadeTool method facadeSelected.
public void facadeSelected(LoopL<Point3d> list, BlockGen block) {
// if (block == null) {
// JOptionPane.showMessageDialog( null, "generate mesh for block first" );
// return;
// }
// Polygonz.findBounds( polies, min, max );
double[] minMax = Loopz.minMax(list);
Loopz.expand(minMax, 30);
Map<Point2d, Pano> panos = new HashMap<>();
for (Gen gen : tweed.frame.gens(PanoGen.class)) for (Pano pg : ((PanoGen) gen).getPanos()) {
Point2d pt = new Point2d(pg.location.x, pg.location.z);
if (pt.x > minMax[0] && pt.x < minMax[1] && pt.y > minMax[4] && pt.y < minMax[5])
panos.put(pt, pg);
}
List<Point3d> objPoints = null;
if (block != null) {
objPoints = new ObjRead(block.getCroppedFile()).points();
}
FacadeFinder ff = new FacadeFinder(Loopz.toXZLoop(list), panos, objPoints, block, tweed.frame.getGenOf(PlanesGen.class));
Point2d cen = Loopz.average(Loopz.to2dLoop(list, 1, null));
renderFacades(block == null ? null : block.gNode, cen.x + "_" + cen.y, ff);
}
Aggregations