protected RoofTypeOutput build(List<Point2d> borderList, Double height, Double angle, RoofMaterials roofTextureData) { MeshFactory meshDome = createRoofMesh(roofTextureData); TextureData roofTexture = roofTextureData.getRoof().getTextureData(); PolygonList2d borderPolygon = new PolygonList2d(borderList); // build circle Circle circle = CircleInsidePolygon.iterativeNonConvex(borderPolygon, 0.01); int pIcross = 5; buildRotaryShape(meshDome, borderList, circle.getPoint(), height, pIcross, roofTexture); RoofTypeOutput rto = new RoofTypeOutput(); rto.setHeight(height); rto.setMesh(Arrays.asList(meshDome)); rto.setRoofHooksSpaces(null); rto.setRectangle(RoofTypeUtil.findRectangle(borderList, 0)); return rto; }
protected RoofTypeOutput build(List<Point2d> borderList, Double height, Double angle, RoofMaterials roofTextureData) { MeshFactory meshDome = createRoofMesh(roofTextureData); MeshFactory meshRoof = createRoofMesh(roofTextureData); TextureData roofTexture = roofTextureData.getRoof().getTextureData(); PolygonList2d borderPolygon = new PolygonList2d(borderList); buildFlatRoof(borderPolygon, meshRoof, roofTexture); // build circle Circle circle = CircleInsidePolygon.iterativeNonConvex(borderPolygon, 0.01); circle.setRadius(Math.min(height, circle.getRadius())); int pIcross = 5; int pIsection = 9; buildRotaryShape(meshDome, circle, pIcross, pIsection, true); RoofTypeOutput rto = new RoofTypeOutput(); rto.setHeight(circle.getRadius()); rto.setMesh(Arrays.asList(meshDome, meshRoof)); rto.setRoofHooksSpaces(null); rto.setRectangle(RoofTypeUtil.findRectangle(borderList, 0)); return rto; }
@Override public RoofTypeOutput buildRoof(Point2d pStartPoint, PolygonWithHolesList2d buildingPolygon, DormerRoofModel pRoof, double height, RoofMaterials roofTextureData) { List<Point2d> pPolygon = buildingPolygon.getOuter().getPoints(); SimpleMatrix transformLocal = TransformationMatrix2d.tranA(-pStartPoint.x, -pStartPoint.y); pPolygon = TransformationMatrix2d.transformList(pPolygon, transformLocal); // rectangleContur = // TransformationMatrix2d.transformArray(rectangleContur, // transformLocal); PolygonList2d borderPolygon = new PolygonList2d(pPolygon); Circle circle = CircleInsidePolygon.iterativeNonConvex(borderPolygon, 0.01); int isection = getIsection(pRoof.getRoofTypeParameter()); boolean soft = isSoft(pRoof.getRoofTypeParameter()); Bend[] bends = getBends(pRoof.getMeasurements(), circle); RoofTypeOutput rto = build(pPolygon, circle.getPoint(), bends, isection, soft, roofTextureData); SimpleMatrix transformGlobal = TransformationMatrix3d.tranA(pStartPoint.x, height - rto.getHeight(), -pStartPoint.y); rto.setTransformationMatrix(transformGlobal); return rto; }