def mergeWalls(wallSkeleton1, wallSkeleton2): #select random space from both walls voiles1 = wallSkeleton1.getVoilesBetween() voiles2 = wallSkeleton2.getVoilesBetween() resVoiles = mergeVoiles(voiles1, voiles2) resWall = WallSkeleton(wallSkeleton1.poly.copy()) for voile in resVoiles: resWall.attachVoile(voile) return resWall
def crossWalls(wallSkeleton1, wallSkeleton2, crossPoint=0.5): print "cross Point: " + str(crossPoint) #select random space from both walls voiles1 = wallSkeleton1.getVoilesBetween(0, crossPoint) voiles2 = wallSkeleton2.getVoilesBetween(crossPoint, 1) resVoiles = mergeVoiles(voiles1, voiles2) resWall1 = WallSkeleton(wallSkeleton1.poly.copy()) for voile in resVoiles: resWall1.attachVoile(voile) voiles1 = wallSkeleton2.getVoilesBetween(0, crossPoint) voiles2 = wallSkeleton1.getVoilesBetween(crossPoint, 1) resVoiles = mergeVoiles(voiles1, voiles2) resWall2 = WallSkeleton(wallSkeleton1.poly.copy()) for voile in resVoiles: resWall2.attachVoile(voile) return resWall1, resWall2