use of org.twak.viewTrace.facades.GreebleSkel.QuadF in project chordatlas by twak.
the class GreebleGrid method createDormerWindow.
protected void createDormerWindow(QuadF l, MeshBuilder window, MeshBuilder glass, float sillDepth, float sillHeight, float corniceHeight, double panelWidth, double panelHeight) {
Vector3d along = new Vector3d(l.corners[3]);
along.sub(l.corners[0]);
along.normalize();
Vector3d up = new Vector3d(0, 1, 0);
Vector3d out = new Vector3d();
out.cross(along, up);
out.scale(1 / out.length());
Line3d lout;
{
Point3d away = new Point3d(l.corners[0]);
away.add(out);
lout = new Line3d(new Point3d(l.corners[0]), away);
}
Vector3d loc = new Vector3d(l.found[0]);
if (lout.findPPram(l.found[0]) < lout.findPPram(l.found[1])) {
// outwards going wall...
loc = new Vector3d(up);
loc.scale(-l.original.height);
loc.add(l.found[1]);
}
{
Vector3d avoidRoof = new Vector3d(out);
avoidRoof.scale(0.09);
;
loc.add(avoidRoof);
}
Point3d deepest = Arrays.stream(l.found).map(p -> new Pair<Point3d, Double>(p, lout.findPPram(p))).max((a, b) -> b.second().compareTo(a.second())).get().first();
double depth = lout.closestPointOn(deepest, false).distance(lout.closestPointOn(new Point3d(loc), false));
// MUtils.max(
// Math.abs (l.corners[0].distance( l.found[0] )),
// Math.abs (l.corners[1].distance( l.found[1] )),
// Math.abs (l.corners[2].distance( l.found[2] )),
// Math.abs (l.corners[3].distance( l.found[3] ))
// ) ;
WindowGen.createWindow(window, glass, new Window(Jme3z.to(loc), Jme3z.to(along), Jme3z.to(up), l.original.width, l.original.height, depth, panelWidth, panelHeight));
// Vector3f u = Jme3z.to(up), o = Jme3z.to( out );
// if (sillDepth > 0)
// window.addCube( Jme3z.to ( ptt[0] ).add( u.mult( -sillHeight + 0.01f ) ).add( o.mult( -sillDepth) ),
// Jme3z.to(out), Jme3z.to(along), Jme3z.to(up),
// (float)depth + sillDepth, (float)winPanel.width,(float) sillHeight );
//
// if (corniceHeight > 0)
// moulding( to3d, new DRectangle(winPanel.x, winPanel.getMaxY(), winPanel.width, corniceHeight), wall );
}
Aggregations