/** * Calculates height of point where it intersect with the plane. * * @param point * the 2d point * @param plane * the surface plane * @return the height of point where it intersect with the plane */ private double calcHeight(Point2d point, Plane3d plane) { double x = point.x; double z = -point.y; return plane.calcYOfPlane(x, z); }
/** * Calculate height of point in border. * * @param point * @param mLine * @param planeTop * @param planeBottom * @return */ private double calcHeight(Point2d point, Plane3d plane) { double x = point.x; double z = -point.y; return plane.calcYOfPlane(x, z); }
/** * Calculates height of point in wall. * * @param point * the point * @param planeTop * the top plane * @return the height of point */ private static double calcHeight(Point2d point, Plane3d planeTop) { double x = point.x; double z = -point.y; return planeTop.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); } }
/** * 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 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); } }
return planeTop.calcYOfPlane(x, z); return planeMiddleTop.calcYOfPlane(x, z); return planeMiddleBottom.calcYOfPlane(x, z); return planeBottom.calcYOfPlane(x, z);
return planeLeft.calcYOfPlane(x, z); } else if (!rightTopLine.inFront(point)) { return planeRight.calcYOfPlane(x, z); } else { return planeTop.calcYOfPlane(x, z); return planeLeft.calcYOfPlane(x, z); } else if (!rightBottomLine.inFront(point)) { return planeRight.calcYOfPlane(x, z); } else { return planeBottom.calcYOfPlane(x, z);
/** * 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); }
return planeLeft.calcYOfPlane(x, z); return planeMiddleLeft.calcYOfPlane(x, z); } else if (rtLine.inFront(point) && rbLine.inFront(point)) { if (rLine.inFront(point)) { return planeRight.calcYOfPlane(x, z); return planeMiddleRight.calcYOfPlane(x, z); return planeTop.calcYOfPlane(x, z); return planeMiddleTop.calcYOfPlane(x, z); return planeMiddleBottom.calcYOfPlane(x, z); return planeBottom.calcYOfPlane(x, z);
return planeTop.calcYOfPlane(x, z); return planeLeft.calcYOfPlane(x, z); return planeRight.calcYOfPlane(x, z); return planeButtom.calcYOfPlane(x, z);
@Override public RoofHookPoint[] getRoofHookPoints(int pNumber, DormerRow dormerRow, int dormerRowNum) { Vector2d v = new Vector2d(this.v1); v.scale(1d / (pNumber + 1d)); Point2d p = new Point2d(this.p1); RoofHookPoint[] ret = new RoofHookPoint[pNumber]; for (int i = 0; i < pNumber; i++) { p.add(v); double y = this.plane.calcYOfPlane(p.x, -p.y); double z = limitZToPolygon(p.y); Point3d pp = new Point3d(p.x, y, -z); RoofHookPoint hook = new RoofHookPoint(pp, Math.toRadians(0), this.b * 2d / 3d, Math.toRadians(0)); ret[i] = hook; } return ret; }
double h = plane2.calcYOfPlane(point2d.x, -point2d.y);
double y = this.plane.calcYOfPlane(p.x, -z);
/** * @param pMeshRoof * @param pPlane * @param pTextureVector * @param pTextureData * @param textureOffsetU * @param textureOffsetV * @param normalIndex * @param face * @param point2d */ private static void addPointToTriangleFace(MeshFactory pMeshRoof, Plane3d pPlane, Vector3d pTextureVector, TextureData pTextureData, double textureOffsetU, double textureOffsetV, int normalIndex, FaceFactory face, Point2d point2d) { double h = pPlane.calcYOfPlane(point2d.x, -point2d.y); Point3d point3d = new Point3d(point2d.x, h, -point2d.y); int vi = pMeshRoof.addVertex(point3d); // Point3d point3d = pMeshRoof.vertices.get(vi); face.addVertIndex(vi); face.addNormalIndex(normalIndex); TextCoord calcUV = TextCordFactory.calcFlatSurfaceUV(point3d, pPlane.getNormal(), pTextureVector, pPlane.getPoint(), pTextureData, textureOffsetU, textureOffsetV); int tci = pMeshRoof.addTextCoord(calcUV); face.addCoordIndex(tci); }
final LinePoints2d rightTopLine = new LinePoints2d(rightCenter, rightTop); double leftHeight = planeBottom.calcYOfPlane(leftBottom.x, -leftBottom.y); if (l1 < 0.5 * recHeight) { leftHeight = planeTop.calcYOfPlane(leftTop.x, -leftTop.y); double rightHeight = planeBottom.calcYOfPlane(rightBottom.x, -rightBottom.y); if (l1 < 0.5 * recHeight) { rightHeight = planeTop.calcYOfPlane(rightTop.x, -rightTop.y);