Ejemplo n.º 1
0
    def removeUnwantedWalls(LevelSkeletons,SolutionAxes,Columns):
        for levelSkeleton in LevelSkeletons:
            newWallSkeletons1 = []
            newWallSkeletons4 = []
            print("number of level", LevelSkeletons.index(levelSkeleton))
            for wallskeleton in levelSkeleton.wallSkeletons:
                y = round(wallskeleton.poly.centroid().y, 2)
                x = round(wallskeleton.poly.centroid().x, 2)
                print("here wall ",levelSkeleton.wallSkeletons.index(wallskeleton),":",x,y)
                for axis in SolutionAxes.axes[0]:
                    # print("here axis:",axis)
                    if y==axis.coords[0][1] :
                        newWallSkeletons1.append(wallskeleton)
                        # print("added horizontal")
                for axis in SolutionAxes.axes[1]:
                    if x==axis.coords[0][0] :
                        newWallSkeletons1.append(wallskeleton)
                # if not test: levelSkeleton.wallSkeletons.remove(wallskeleton)
            for wallsklt in LevelSkeleton.removeColumnIntersections(newWallSkeletons1,Columns):
                newWallSkeletons4.append(wallsklt)

            for Column in Columns:
                pnts = Column.exterior.coords
                Pnts = []
                for i in range(len(pnts)): Pnts.append(Pnt(pnts[i][0], pnts[i][1]))
                wall = Poly(Pnts)
                wallsklt = WallSkeleton.createSkeletonFromPoly(wall)
                wallsklt.iscolumnParent = True
                newWallSkeletons4.append(wallsklt)

            NewWallSkeletons = []
            for wall in newWallSkeletons4:
                if wall not in NewWallSkeletons: NewWallSkeletons.append(wall)
            levelSkeleton.wallSkeletons = copy.deepcopy(NewWallSkeletons)


        return LevelSkeletons
Ejemplo n.º 2
0
 def Addnewpolys(polygon):
     newwallsklt = WallSkeleton.createSkeletonFromPoly(polygon)
     return newwallsklt