/** * Calc height of point in border. * * @param point * @param lines * @param planes * @return */ private double calcHeight(Point2d point, LinePoints2d[] lines, Plane3d[] planes) { double x = point.x; double z = -point.y; for (int i = 0; i < lines.length; i++) { LinePoints2d line_mi = lines[i]; LinePoints2d line = lines[(i + 1) % lines.length]; if (line_mi.inFront(point) && !line.inFront(point)) { return planes[i].calcYOfPlane(x, z); } } log.warn("this should not happen"); return 0; // planes[planes.length-1].calcYOfPlane(x, z); }
double z = -point.y; if (lt.inFront(point)) { if (rt.inFront(point)) { return planeTop.calcYOfPlane(x, z); if (lb.inFront(point)) { return planeLeft.calcYOfPlane(x, z); if (rb.inFront(point)) { if (!rt.inFront(point)) { return planeRight.calcYOfPlane(x, z); if (!lb.inFront(point)) { return planeButtom.calcYOfPlane(x, z);
double z = -point.y; if (lbLine.inFront(point) && ltLine.inFront(point)) { if (lLine.inFront(point)) { return planeLeft.calcYOfPlane(x, z); } else if (rtLine.inFront(point) && rbLine.inFront(point)) { if (rLine.inFront(point)) { return planeRight.calcYOfPlane(x, z); } else if (mLine.inFront(point)) { if (tLine.inFront(point)) { return planeTop.calcYOfPlane(x, z); if (bLine.inFront(point)) { return planeMiddleBottom.calcYOfPlane(x, z);
/** * Calculates height of wall point under roof. * * @param point * the point * @param rLine * the right split line * @param lLine * the left split line * @param planeLeft * the left plane * @param planeRight * the right plane * @param planeButtom * the bottom plane * @return height of point */ private static double calcHeight(Point2d point, LinePoints2d rLine, LinePoints2d lLine, Plane3d planeLeft, Plane3d planeRight, Plane3d planeButtom) { double x = point.x; double z = -point.y; if (rLine.inFront(point)) { return planeRight.calcYOfPlane(x, z); } else if (lLine.inFront(point)) { return planeLeft.calcYOfPlane(x, z); } else { return planeButtom.calcYOfPlane(x, z); } }
double z = -point.y; if (middleLine.inFront(point)) { if (leftTopLine.inFront(point)) { return planeLeft.calcYOfPlane(x, z); } else if (!rightTopLine.inFront(point)) { return planeRight.calcYOfPlane(x, z); } else { if (leftBottomLine.inFront(point)) { return planeLeft.calcYOfPlane(x, z); } else if (!rightBottomLine.inFront(point)) { return planeRight.calcYOfPlane(x, z); } else {
/** * Calculate height of point in wall. * * @param point * the point * @param mLine * the middle line * @param planeTop * the top plane * @param planeBottom * the bottom plane * @return */ private static double calcHeight(Point2d point, LinePoints2d mLine, Plane3d planeTop, Plane3d planeBottom) { double x = point.x; double z = -point.y; if (mLine.inFront(point)) { return planeTop.calcYOfPlane(x, z); } else { return planeBottom.calcYOfPlane(x, z); } } }
/** * Calculates height of point in wall. * * @param point * @param rLine * @param lLine * @param planeLeft * @param planeRight * @param planeButtom * @param planeTop * @return */ private static double calcHeight(Point2d point, LinePoints2d lLine, Plane3d planeButtom, Plane3d planeTop) { double x = point.x; double z = -point.y; if (lLine.inFront(point)) { return planeButtom.calcYOfPlane(x, z); } else { return planeTop.calcYOfPlane(x, z); } }