public static PolygonList2d wallToOuterPolygon(Wall wall) { return wallPartsToPolygon(wall.getWallParts()); }
public static PolygonWithHolesList2d buildingPartToPolygonWithHoles(BuildingPart bp) { PolygonList2d outerPolygon = wallToOuterPolygon(bp.getWall()); List<PolygonList2d> innerList = new ArrayList<PolygonList2d>(); if (bp.getInlineWalls() != null) { for (Wall innerWall : bp.getInlineWalls()) { PolygonList2d innerPolygon = wallToOuterPolygon(innerWall); innerList.add(innerPolygon); } } return new PolygonWithHolesList2d(outerPolygon, innerList); }
private static void buildFloor(BuildingPart bp, BuildingModel buildingModel, ModelFactory mf, BuildingElementsTextureManager tm, TextureData roofTextureData, Color facadeColor, double minHeight) { Color floorColor = takeFloorColor(buildingModel, bp, tm); TextureData floorTD = takeFloorTextureData(buildingModel, bp, tm, floorColor != null); String tex0Key = floorTD.getTex0(); Material mat = MaterialFactory.createTextureColorMaterial(tex0Key, floorColor); MeshFactory mesh = mf.addMesh("FloorPart"); mesh.hasTexture = true; mesh.materialID = mf.cacheMaterial(mat); PolygonWithHolesList2d buildingPolygon = BuildingUtil.buildingPartToPolygonWithHoles(bp); MeshFactoryUtil.addPolygonWithHolesInYRevert(buildingPolygon, minHeight, mesh, roofTextureData, 0, 0, new Vector3d(1, 0, 0)); }
PolygonWithHolesList2d buildingPolygon = BuildingUtil.buildingPartToPolygonWithHoles(buildingPart);
PolygonWithHolesList2d polygon = BuildingUtil.buildingPartToPolygonWithHoles(bp);
private static boolean isWallCounterClockwise(Wall wall) { PolygonList2d wallToPolygon = BuildingUtil.wallToOuterPolygon(wall); if (0.0f < Triangulate.area(wallToPolygon.getPoints())) { return true; } return false; }