def createShapes(file): wall_shapes = IfcUtils.getWallShapesFromIfc(file) # wall_shapes = IfcUtils.getSlabShapesFromIfc("IFCFiles/projet.ifc") wShapes = [] for wall, shape in wall_shapes: wShapes.append(shape) slab_shapes = IfcUtils.getSlabShapesFromIfc(file) sShapes = [] for wall, shape in slab_shapes: sShapes.append(shape) return wShapes, sShapes
QtCore.qrand() % 256, QtCore.qrand() % 256), polygon)) self.update() def paintEvent(self, e): qp = QtGui.QPainter(self) # qp.scale(30,30) for c in self.cells: c.drawPolygone(qp) from Ifc import IfcUtils if __name__ == '__main__': wall_shapes = IfcUtils.getWallShapesFromIfc("IFCFiles/projet.ifc") # wall_shapes = IfcUtils.getSlabShapesFromIfc("IFCFiles/projet.ifc") shapes = [] for wall, shape in wall_shapes: shapes.append(shape) polygons = ShapeToPoly.getShapesBasePolygons(shapes) lx = min([ pnt.x() for pnt in [pt for polygon in polygons for pt in polygon.points] ]) ly = min([ pnt.y() for pnt in [pt for polygon in polygons for pt in polygon.points] ])
# import sys # from DrawUtils import QtGui, Window from Geometry import ShapeToPoly from Ifc import IfcUtils as iu from Structures.Wall import Wall wall_shapes = iu.getWallShapesFromIfc("../IFCFiles/Immeuble2.ifc") shapes = [] walls = [] for wall, shape in wall_shapes: shapes.append(shape) walls.append(Wall(shape)) # for wall in walls: # for polygon in wall.getPolygons(): # for pnt in polygon.points: # print("point is: (%.2f, %.2f) " % (pnt.x, pnt.y)) # polygons = [polygon for wall in walls for polygon in wall.getPolygons()] polygons = [wall.getBasePolygon() for wall in walls] # polygons = iu.getWallsShapesBasePolygons(shapes) lx = min( [pnt.x for pnt in [pt for polygon in polygons for pt in polygon.points]]) ly = min( [pnt.y for pnt in [pt for polygon in polygons for pt in polygon.points]]) # # for polygon in polygons: # polygon.move(-lx,-ly) print("polygon is: ")