Point2d minBound = PolygonUtil.minBound(polygon); Point2d maxBound = PolygonUtil.maxBound(polygon); if (PolygonUtil.isPointInsidePolygon(hook, polygon)) { ret.add(hook);
private boolean isComplex(PolygonWithHolesList2d buildingPolygon, DormerRoofModel roof) { if (roof.getDirection() != null) { return false; } if (roof.getOrientation() != null) { return false; } if (buildingPolygon.getInner() != null && buildingPolygon.getInner().size() > 0) { // has any holes return true; } List<Point2d> points = buildingPolygon.getOuter().getPoints(); RectanglePointVector2d orientedBBox = RectangleUtil.findRectangleContur(points); double orientedBBoxArea = orientedBBox.getHeight() * orientedBBox.getWidth(); float polygonArea = Math.abs(PolygonUtil.area(points)); return orientedBBoxArea > polygonArea * 1.2; }
double minHeight, MeshFactory mesh, TextureData textureData) { boolean isClockwisePolygon = !PolygonUtil.isClockwisePolygon(wallPoints);
if (PolygonUtil.isPointInsidePolygon(center, hole)) { if (triangleInHole || !PolygonUtil.isPointInsidePolygon(center, polygon)) {
normalBottom.normalize(); List<Point2d> outline = PolygonUtil.makeCounterClockwise(buildingPolygon.getOuter().getPoints()); PolygonList2d borderPolygon = new PolygonList2d(outline);
normalBottom.normalize(); List<Point2d> outline = PolygonUtil.makeCounterClockwise(buildingPolygon.getOuter().getPoints()); PolygonList2d borderPolygon = new PolygonList2d(outline);
/** * Make mesh of vertical wall e.g. It is wall under the roof. * * @param stripPoints * the strip points * @param minHeight * the strip minimal height * @param stripPointHeights * the strip points heights * @param mesh * the mesh * @param textureData * the texture data */ public static void makeRoofBorderMesh(List<Point2d> stripPoints, double minHeight, List<Double> stripPointHeights, MeshFactory mesh, TextureData textureData) { StripMeshFactoryUtil.verticalStripMesh(stripPoints, // new StripMeshFactoryUtil.ConstHeightProvider(minHeight),// new StripMeshFactoryUtil.ListHeightProvider(stripPointHeights), // mesh, // textureData, // true, // !PolygonUtil.isClockwisePolygon(stripPoints)); }
if (PolygonUtil.isClockwisePolygon(outlineList)) { outlineList = PolygonList2d.reverse(outlineList);
if (PolygonUtil.isClockwisePolygon(outlineList)) { outlineList = PolygonList2d.reverse(outlineList);