def placeBed(space: aecSpace, rotation: float = 0, bedBath = 0):
    origin = space.origin_floor
    center = space.center_floor
    if bedBath == 1: 
        placeBath(space, rotation)
        space.boundary = shaper.makeBox(space.origin_floor, 4130, 2750)
        space.rotate(rotation, center)
    mesh = space.mesh_graphic
    model.add_triangle_mesh(mesh.vertices, mesh.normals, mesh.indices, colorGreen)
    
    point = aecPoint(origin.x + 1500, origin.y + 1)
    bed = aecSpace()
    bed.boundary = shaper.makeBox(point, 1500, 2000)
    bed.height = 600
    bed.rotate(rotation, center)
    mesh = bed.mesh_graphic
    model.add_triangle_mesh(mesh.vertices, mesh.normals, mesh.indices, colorWhite)    
    
    point = aecPoint(origin.x + 1600, origin.y + 20)
    pillows = aecSpace()
    pillows.boundary = shaper.makeBox(point, 1300, 400)
    pillows.height = 150
    pillows.level = origin.z + 600
    pillows.rotate(rotation, center)    
    mesh = pillows.mesh_graphic
    model.add_triangle_mesh(mesh.vertices, mesh.normals, mesh.indices, colorWhite)
Ejemplo n.º 2
0
 def makeT(self,
           origin=aecPoint(),
           xSize: float = 1,
           ySize: float = 1,
           xWidth=None,
           yDepth=None) -> bool:
     """
     Constructs a T-shaped boundary within the box defined by point and xy deltas.
     xWidth and yDepth are percentages of overall x-axis and y-axis distances that
     determine the width of the vertical and horizonatl bars, respectively.
     Returns True on success.
     Returns False on failure.
     """
     try:
         if not xWidth: xWidth = xSize * 0.5
         if not yDepth: yDepth = ySize * 0.5
         if xWidth >= xSize: return None
         if yDepth >= ySize: return None
         oPnt = aecPoint(origin.x, origin.y + (ySize - yDepth))
         arm1 = self.makeBox(oPnt, xSize, yDepth)
         oPnt = aecPoint(origin.x + ((xSize * 0.5) - (xWidth * 0.5)),
                         origin.y)
         arm2 = self.makeBox(oPnt, xWidth, ySize)
         return self.__add([arm1, arm2])
     except Exception:
         traceback.print_exc()
         return False
Ejemplo n.º 3
0
 def makePolygon(self,
                 origin: aecPoint = aecPoint(),
                 radius=1,
                 sides=3) -> List[aecPoint]:
     """
     Returns a series of anticlockwise points representing a regular polygon boundary centered
     on the delivered origin point with the first vertex at the maximum y-coordinate.
     Returns None failure.
     """
     try:
         radius = abs(radius)
         if radius == 0: return False
         sides = int(abs(sides))
         if sides < 3: sides = 3
         angle = pi * 0.5
         incAngle = (pi * 2) / sides
         points = []
         count = 0
         while count < sides:
             x = origin.x + (radius * cos(angle))
             y = origin.y + (radius * sin(angle))
             points.append(aecPoint(x, y))
             angle += incAngle
             count += 1
         return points
     except Exception:
         traceback.print_exc()
         return None
def placeBathFixtures(space: aecSpace):
    origin = space.origin_floor
    point = aecPoint(origin.x + 1, origin.y + 3129)
    tub = aecSpace()
    tub.boundary = shaper.makeBox(point, 2000, 1000)
    tub.height = 450
    tub.level = origin.z
    tub.color = aecColor.white
    point = aecPoint(origin.x + 1, origin.y + 150)
    tank = aecSpace()
    tank.boundary = shaper.makeBox(point, 200, 600)
    tank.height = 330
    tank.level = origin.z + 400
    tank.color = aecColor.white
    point = aecPoint(point.x + 400, point.y + 300)
    bowl = aecSpace()
    bowl.boundary = shaper.makeCylinder(point, 270)
    bowl.height = 410
    bowl.level = origin.z
    bowl.color = aecColor.white
    point = aecPoint(origin.x + 1, origin.y + 1000)
    vanity = aecSpace()
    vanity.boundary = shaper.makeBox(point, 480, 1500)
    vanity.height = 780
    vanity.level = origin.z
    vanity.color = aecColor.white
    mirror = aecSpace()
    mirror.boundary = shaper.makeBox(point, 10, 1500)
    mirror.height = 1500
    mirror.level = point.z + 1000
    mirror.color = aecColor.white
    return [tub, tank, bowl, vanity, mirror]
def placeBath(space: aecSpace):
    origin = space.origin_floor
    point = aecPoint(origin.x + 1, origin.y + 2750)
    bath = aecSpace()
    bath.boundary = shaper.makeBox(point, 2750, 1380)
    bath.height = 2749
    bath.level = origin.z
    bath.color = aecColor.blue
    bath.color.alpha = 125
    point = aecPoint(point.x, point.y + 390)
    tank = aecSpace()
    tank.boundary = shaper.makeBox(point, 200, 600)
    tank.height = 330
    tank.level = origin.z + 400
    tank.color = aecColor.white
    point = aecPoint(point.x + 400, point.y + 300)
    bowl = aecSpace()
    bowl.boundary = shaper.makeCylinder(point, 270)
    bowl.height = 410
    bowl.level = origin.z
    bowl.color = aecColor.white
    point = aecPoint(origin.x + 2270, origin.y + 2750)
    vanity = aecSpace()
    vanity.boundary = shaper.makeBox(point, 480, 1380)
    vanity.height = 780
    vanity.level = origin.z
    vanity.color = aecColor.white
    return [bath, tank, bowl, vanity]
Ejemplo n.º 6
0
 def makeT(self,
           origin=aecPoint(),
           xSize: float = 1,
           ySize: float = 1,
           xWidth=None,
           yDepth=None) -> List[aecPoint]:
     """
     Returns a series of anticlockwise points representing a T-shaped boundary
     within the box defined by the origin point and xSize and ySize.
     xWidth and yDepth determine the widths of the vertical and horizontal bars, respectively.
     Returns None on failure.
     """
     try:
         if not xWidth: xWidth = xSize * 0.5
         if not yDepth: yDepth = ySize * 0.5
         if xWidth >= xSize: return None
         if yDepth >= ySize: return None
         oPnt = aecPoint(origin.x, origin.y + (ySize - yDepth))
         arm1 = self.makeBox(oPnt, xSize, yDepth)
         oPnt = aecPoint(origin.x + ((xSize * 0.5) - (xWidth * 0.5)),
                         origin.y)
         arm2 = self.makeBox(oPnt, xWidth, ySize)
         return self.__add([arm1, arm2])
     except Exception:
         traceback.print_exc()
         return None
def placeBuilding():
    spacer = aecSpacer()  
    shaper = aecShaper()      
    site = aecSpace()
    sitePoints = siteBoundary["coordinates"]
    sitePoints = [aecPoint(pnt[0], pnt[1], 0) for pnt in sitePoints]
    site.boundary = sitePoints
    site.color = aecColor.green
    site.height = 0.1
    site.level = -0.1
    spaces = [site]
    building = buildings[0]
    xWidth = building['diameter'][random.randint(0, 1)]
    yDepth = xWidth * 1.618
    space = aecSpace()
    space.boundary = shaper.makeCross(origin = aecPoint(0, 0, 0), 
                                      xSize = xWidth, 
                                      ySize = yDepth)
    space.rotate(random.uniform(0, 270))
    orientation = [
                       aecGeometry.NW,
                       aecGeometry.NNW,
                       aecGeometry.NW,
                       aecGeometry.N,
                       aecGeometry.NNE,
                       aecGeometry.NE,
                  ]
    if spacer.placeOnLine(space, site, orientation):
        space.height = building['height']
        space.level= building['level']
        space.color = building['color']
        spaces += [space]
        space2 = spacer.stackToArea(space, building['area'])
        spaces += space2
    return spaces
Ejemplo n.º 8
0
 def makeCross(self,
               origin: aecPoint = aecPoint(0, 0, 0),
               xSize: float = 1,
               ySize: float = 1,
               xWidth=None,
               yDepth=None,
               xAxis: float = 0.5,
               yAxis: float = 0.5) -> List[aecPoint]:
     """
     Returns a series of anticlockwise points representing a cross-shaped boundary 
     within the box defined by the origin point and xSize and ySize.
     xWidth and yDepth define the widths of the two arms.
     xAxis and yAxis are percentages of overall x-axis and y-axis distances determining
     the centerline of each cross arm.
     Returns None on failure.
     """
     try:
         if not xWidth: xWidth = xSize * 0.5
         if not yDepth: yDepth = ySize * 0.5
         xPnt = aecPoint(origin.x + ((yAxis * xSize) - (xWidth * 0.5)),
                         origin.y)
         yPnt = aecPoint(origin.x,
                         origin.y + ((xAxis * ySize) - (yDepth * 0.5)))
         armX = self.makeBox(xPnt, xWidth, ySize)
         armY = self.makeBox(yPnt, xSize, yDepth)
         return self.__add([armX, armY])
     except Exception:
         traceback.print_exc()
         return None
Ejemplo n.º 9
0
 def makeU(self,
           origin=aecPoint(),
           xSize: float = 1,
           ySize: float = 1,
           xWidth1=None,
           xWidth2=None,
           yDepth=None) -> List[aecPoint]:
     """
     Returns a series of anticlockwise points representing a U-shaped boundary
     within the box defined by the origin point and xSize and ySize.
     xWidth and yDepth determine the widths of the vertical and horizontal bars, respectively.
     Returns None on failure.
     """
     try:
         if not xWidth1: xWidth1 = xSize * 0.3
         if not xWidth2: xWidth2 = xSize * 0.3
         if not yDepth: yDepth = ySize * 0.3
         if xWidth1 >= xSize * 0.5: return None
         if xWidth2 >= xSize * 0.5: return None
         if yDepth >= ySize: return None
         pointsL = self.makeL(origin, xSize, ySize, xWidth1, yDepth)
         xPoint = aecPoint(origin.x + (xSize - xWidth2), origin.y)
         pointsU = self.makeBox(xPoint, xWidth2, ySize)
         return self.__add([pointsL, pointsU])
     except Exception:
         traceback.print_exc()
         return None
Ejemplo n.º 10
0
 def makeU(self,
           origin=aecPoint(),
           xSize: float = 1,
           ySize: float = 1,
           xWidth1=None,
           xWidth2=None,
           yDepth=None):
     """
     Constructs a U-shaped boundary within the box defined by point and xy deltas.
     xWidth1, xWidth2, and yDepth are percentages of overall x-axis and y-axis distances
     that determine the width of each vertical and cross bar, respectively.
     Returns True on success.
     Returns False on failure.
     """
     try:
         if not xWidth1: xWidth1 = xSize * 0.3
         if not xWidth2: xWidth2 = xSize * 0.3
         if not yDepth: yDepth = ySize * 0.3
         if xWidth1 >= xSize * 0.5: return None
         if xWidth2 >= xSize * 0.5: return None
         if yDepth >= ySize: return None
         pointsL = self.makeL(origin, xSize, ySize, xWidth1, yDepth)
         xPoint = aecPoint(origin.x + (xSize - xWidth2), origin.y)
         pointsU = self.makeBox(xPoint, xWidth2, ySize)
         return self.__add([pointsL, pointsU])
     except Exception:
         traceback.print_exc()
         return False
Ejemplo n.º 11
0
 def makePolygon(self,
                 origin: aecPoint = aecPoint(),
                 radius=1,
                 sides=3) -> bool:
     """
     Constructs the boundary as a regular polygon centered on the delivered
     origin point with the first vertex at the maximum y-coordinate.
     Returns True on success.
     Returns False on failure.
     """
     try:
         radius = abs(radius)
         if radius == 0: return False
         sides = int(abs(sides))
         if sides < 3: sides = 3
         angle = pi * 0.5
         incAngle = (pi * 2) / sides
         points = []
         count = 0
         while count < sides:
             x = origin.x + (radius * cos(angle))
             y = origin.y + (radius * sin(angle))
             points.append(aecPoint(x, y))
             angle += incAngle
             count += 1
         return points
     except Exception:
         traceback.print_exc()
         return False
Ejemplo n.º 12
0
 def makeH(self,
           origin: aecPoint = aecPoint(),
           xSize: float = 1,
           ySize: float = 1,
           xWidth1=None,
           xWidth2=None,
           yDepth=None) -> List[aecPoint]:
     """
     Returns a series of anticlockwise points representing an H-shaped boundary
     within the box defined by the origin point and xSize and ySize.
     xWidth1, xWidth2, and yDepth determine the widths of the vertical and 
     horizontal bars, respectively.
     
     the width of each vertical and cross bar, respectively.
     Returns None on failure.
     """
     try:
         if not xWidth1: xWidth1 = xSize * 0.3
         if not xWidth2: xWidth2 = xSize * 0.3
         if not yDepth: yDepth = ySize * 0.3
         if xWidth1 >= xSize * 0.5: return None
         if xWidth2 >= xSize * 0.5: return None
         if yDepth >= ySize: return None
         arm1 = self.makeBox(origin, xWidth1, ySize)
         oPnt = aecPoint(origin.x + (xSize - xWidth2), origin.y)
         arm2 = self.makeBox(oPnt, xWidth2, ySize)
         oPnt = aecPoint(origin.x,
                         origin.y + ((ySize * 0.5) - (yDepth * 0.5)))
         arm3 = self.makeBox(oPnt, xSize, yDepth)
         return self.__add([arm1, arm2, arm3])
     except Exception:
         traceback.print_exc()
         return None
Ejemplo n.º 13
0
 def makeH(self,
           origin: aecPoint = aecPoint(),
           xSize: float = 1,
           ySize: float = 1,
           xWidth1=None,
           xWidth2=None,
           yDepth=None) -> bool:
     """
     Constructs an H-shaped boundary within the box defined by point and xy deltas.
     xWidth1, xWidth2, and yDepth are percentages of overall x-axis and y-axis distances that
     determine the width of each vertical and cross bar, respectively.
     Returns True on success.
     Returns False on failure.
     """
     try:
         if not xWidth1: xWidth1 = xSize * 0.3
         if not xWidth2: xWidth2 = xSize * 0.3
         if not yDepth: yDepth = ySize * 0.3
         if xWidth1 >= xSize * 0.5: return None
         if xWidth2 >= xSize * 0.5: return None
         if yDepth >= ySize: return None
         arm1 = self.makeBox(origin, xWidth1, ySize)
         oPnt = aecPoint(origin.x + (xSize - xWidth2), origin.y)
         arm2 = self.makeBox(oPnt, xWidth2, ySize)
         oPnt = aecPoint(origin.x,
                         origin.y + ((ySize * 0.5) - (yDepth * 0.5)))
         arm3 = self.makeBox(oPnt, xSize, yDepth)
         return self.__add([arm1, arm2, arm3])
     except Exception:
         traceback.print_exc()
         return False
def placeFurniture(space: aecSpace, rotation: float = 0):
    origin = space.origin_floor
    mesh = space.mesh_graphic
    model.add_triangle_mesh(mesh.vertices, mesh.normals, mesh.indices, colorAqua)
    
    point = aecPoint(origin.x + 1032.5, origin.y)
    couchSeat = aecSpace()
    couchSeat.boundary = shaper.makeBox(point, 2000, 800)
    couchSeat.height = 370
    couchSeat.rotate(rotation, space.center_floor)    
    mesh = couchSeat.mesh_graphic
    model.add_triangle_mesh(mesh.vertices, mesh.normals, mesh.indices, colorWhite)

    couchBack = aecSpace()
    couchBack.boundary = shaper.makeBox(point, 2000, 200)
    couchBack.height = 330
    couchBack.level = origin.z + 380
    couchBack.rotate(rotation, space.center_floor)    
    mesh = couchBack.mesh_graphic
    model.add_triangle_mesh(mesh.vertices, mesh.normals, mesh.indices, colorWhite)        
    
    point = aecPoint(point.x + 300, point.y + 1200)
    table = aecSpace()
    table.boundary = shaper.makeBox(point, 1400, 600)
    table.height = 370
    table.rotate(rotation, space.center_floor)    
    mesh = table.mesh_graphic
    model.add_triangle_mesh(mesh.vertices, mesh.normals, mesh.indices, colorWhite)
Ejemplo n.º 15
0
 def randomFloor(point):
     try:
         floor = aecSpace()
         shaper = aecShaper()
         floorSizeX = uniform(60, 100)
         floorSizeY = uniform(60, 100)
         floorHeight = uniform(10, 20)
         floorType = randint(1, 11)
         width = uniform(33, 45)
         depth = uniform(33, 45)
         xOffset = uniform(10, 90)
         yOffset = uniform(10, 90)
         if floorType == 1:
             floor.boundary = shaper.makeBox(point, floorSizeX, floorSizeY)
             floor.rotate(uniform(0, 360))
             x = 0
             boundaries = uniform(1, 5)
             tempFloor = aecSpace()
             while x < boundaries:
                 tempFloor.boundary = shaper.makeBox(origin=point,
                                                     xSize=uniform(65, 100),
                                                     ySize=uniform(65, 100))
                 tempFloor.rotate(uniform(0, 360))
                 floor.add(tempFloor.points_floor)
                 x += 1
         if floorType == 2:
             floor.boundary = shaper.makeCylinder(
                 aecPoint(point.x + (floorSizeX * 0.5),
                          point.y + (floorSizeY * 0.5)), (floorSizeX * 0.5))
         if floorType > 2 and floorType < 9:
             floor.boundary = shaper.makePolygon(
                 aecPoint(point.x + (floorSizeX * 0.5),
                          point.y + (floorSizeY * 0.5)), (floorSizeX * 0.5),
                 floorType)
         if floorType == 9:
             floor.boundary = shaper.makeCross(point,
                                               xSize=floorSizeX,
                                               ySize=floorSizeY,
                                               xAxis=xOffset,
                                               yAxis=yOffset)
         if floorType == 10:
             floor.boundary = shaper.makeH(point,
                                           xSize=floorSizeX,
                                           ySize=floorSizeY,
                                           xWidth1=width,
                                           xWidth2=depth,
                                           yDepth=depth)
         if floorType == 11:
             floor.boundary = shaper.makeU(point,
                                           xSize=floorSizeX,
                                           ySize=floorSizeY,
                                           xWidth1=width,
                                           xWidth2=depth,
                                           yDepth=depth)
         floor.rotate(uniform(0, 360))
         floor.height = floorHeight
         return floor
     except:
         return False
Ejemplo n.º 16
0
def makeShelfDouble(rotation: float, color: int, moveBy: List[float]):
    components = aecSpaceGroup();
    base = aecSpace();
    length = 200
    base.boundary = shaper.makeBox(aecPoint(), 100, length)
    base.height = 25
    divider = aecSpace();
    divider.boundary = shaper.makeBox(aecPoint(), 4, length - 10)
    divider.height = 125
    divider.moveTo(fromPnt = aecPoint(), toPnt = aecPoint(48, 5, 25))
    lowShelfFront = aecSpace();
    lowShelfFront.boundary = shaper.makeBox(aecPoint(), 43, length - 10)
    lowShelfFront.height = 2                     
    lowShelfFront.moveTo(fromPnt = aecPoint(), toPnt = aecPoint(52, 5, 65))
    lowShelfBack = spacer.copy(lowShelfFront)
    lowShelfBack.mirror([aecPoint(50, 0), aecPoint(50, 500)])
    highShelfFront = spacer.copy(lowShelfFront, z = 40)
    highShelfBack = spacer.copy(lowShelfBack, z = 40)
    components.add([base, divider, lowShelfFront, lowShelfBack, highShelfFront, highShelfBack])
    components.moveBy(moveBy[0], moveBy[1])
    components.rotate(uniform(0, rotation), base.center_floor)
    color = getColor(color)
    for component in components.spaces:
        mesh = component.mesh_graphic
        model.add_triangle_mesh(mesh.vertices, mesh.normals, mesh.indices, color)    
Ejemplo n.º 17
0
def placeBed(space):
    origin = space.origin_floor
    point = aecPoint(origin.x + 1500, origin.y + 1)
    bed = aecSpace()
    bed.boundary = shaper.makeBox(point, 1500, 2000)
    bed.height = 600
    bed.color = aecColor.white
    point = aecPoint(origin.x + 1600, origin.y + 20)
    pillows = aecSpace()
    pillows.boundary = shaper.makeBox(point, 1300, 400)
    pillows.height = 150
    pillows.level = origin.z + 600
    pillows.color = aecColor.white
    return [bed, pillows]
Ejemplo n.º 18
0
def makeDuct(start: aecPoint, end: aecPoint, width: float,
             height: float) -> aecSpace:
    shaper = aecShaper()
    duct = aecSpace()
    length = sqrt(((end.x - start.x)**2) + ((end.y - start.y)**2))
    duct.boundary = shaper.makeBox(aecPoint(0, 0, 0),
                                   xSize=length,
                                   ySize=width)
    midOrigin = aecPoint(0, (width * 0.5), 0)
    duct.moveTo(fromPnt=midOrigin, toPnt=start)
    angle = rad2deg(arctan2(end.y - start.y, end.x - start.x))
    duct.rotate(angle, start)
    duct.moveBy(z=(height * -0.5))
    duct.height = height
    return duct
def placeBathFixtures(space: aecSpace, rotation: float = 0):
    origin = space.origin_floor 
    mesh = space.mesh_graphic
    model.add_triangle_mesh(mesh.vertices, mesh.normals, mesh.indices, colorBlue)    
      
    point = aecPoint(origin.x + 1, origin.y + 3129)
    tub = aecSpace()
    tub.boundary = shaper.makeBox(point, 2000, 1000)
    tub.height = 450
    tub.level = origin.z
    tub.rotate(rotation, space.center_floor)
    mesh = tub.mesh_graphic
    model.add_triangle_mesh(mesh.vertices, mesh.normals, mesh.indices, colorWhite)   
    
    point = aecPoint(origin.x + 1, origin.y + 150)
    tank = aecSpace()
    tank.boundary = shaper.makeBox(point, 200, 600)
    tank.height = 330
    tank.level = origin.z + 400
    tank.rotate(rotation, space.center_floor)
    mesh = tank.mesh_graphic
    model.add_triangle_mesh(mesh.vertices, mesh.normals, mesh.indices, colorWhite)    
        
    point = aecPoint(point.x + 400, point.y + 300)
    bowl = aecSpace()
    bowl.boundary = shaper.makeCylinder(point, 270)
    bowl.height = 410
    bowl.level = origin.z
    bowl.rotate(rotation, space.center_floor)    
    mesh = bowl.mesh_graphic
    model.add_triangle_mesh(mesh.vertices, mesh.normals, mesh.indices, colorWhite)    
    
    point = aecPoint(origin.x + 1, origin.y + 1000)
    vanity = aecSpace()
    vanity.boundary = shaper.makeBox(point, 480, 1500) 
    vanity.height = 780
    vanity.level = origin.z
    vanity.rotate(rotation, space.center_floor)
    mesh = vanity.mesh_graphic
    model.add_triangle_mesh(mesh.vertices, mesh.normals, mesh.indices, colorWhite)       
    
    mirror = aecSpace()
    mirror.boundary = shaper.makeBox(point, 10, 1500)
    mirror.height = 1500
    mirror.level = point.z + 1000
    mirror.rotate(rotation, space.center_floor)    
    mesh = mirror.mesh_graphic
    model.add_triangle_mesh(mesh.vertices, mesh.normals, mesh.indices, colorWhite) 
Ejemplo n.º 20
0
 def makeEquatorial(self,
                    floor: aecSpace,
                    marginWest: float = 0.0,
                    marginEast: float = 0.0,
                    rotate: float = 0.0) -> bool:
     """
     Sets the corridor to an vertically centered box shape within
     the specified margin of the delivered floor's bounding box.
     Returns True on success.
     Returns False on Failure.
     """
     try:
         if self.width >= floor.size_y: raise ValueError
         self.space.height = floor.height - 0.25
         self.space.level = floor.level
         floorBox = floor.points_box
         xPnt = floorBox.SW.x + marginWest
         yPnt = self.__geometry.getMidpoint(
             floorBox.SW, floorBox.NW).y - (self.__width * 0.5)
         origin = aecPoint(xPnt, yPnt)
         xSize = abs((floorBox.SE.x - marginEast) - xPnt)
         points = self.__shaper.makeBox(origin=origin,
                                        xSize=xSize,
                                        ySize=self.width)
         if not points: raise Exception
         self.space.boundary = points
         self.space.rotate(rotate)
         return self.space.fitWithin(floor.points_floor)
     except ValueError:
         print(self.__dimensionError)
         return False
     except Exception:
         traceback.print_exc()
         return False
Ejemplo n.º 21
0
 def stackTower():
     spacer = aecSpacer()
     levels = randint(5, 70)
     floor = randomFloor(aecPoint(0, 0, 0))
     if not floor: return
     height = floor.height
     floors = [floor] + spacer.stack(floor, levels - 1)
     if uniform(1, 3) == 1:
         plinth = aecSpace()
         plinthLevels = randint(1, 3)
         plinthHeight = height * plinthLevels
         plinth.wrap(floor.points_floor)
         plinth.height = plinthHeight
         pScale = uniform(1, 2)
         plinth.scale(pScale, pScale, 1)
         floors = floors[plinthLevels:]
         floors = [plinth] + floors
     colors = [aecColor.blue, aecColor.green]
     tower = aecSpaceGroup()
     tower.spaces = floors
     tower.setColor(colors[randint(0, 1)])
     tower.rotate(uniform(0, 360))
     if levels >= 10:
         index = 10
         while index < levels:
             tower.scale(0.8, 0.8, 1, index=index)
             index += 1
     if levels >= 30:
         index = 30
         while index < levels:
             tower.scale(0.8, 0.8, 1, index=index)
             index += 1
     return tower.spaces
Ejemplo n.º 22
0
def placeCloset(space):
    origin = space.origin_floor
    point = aecPoint(origin.x + 1, origin.y + 1)
    closet = aecSpace()
    closet.boundary = shaper.makeBox(point, 700, 2750)
    closet.height = 2749
    closet.color = aecColor.orange
    return [closet]
Ejemplo n.º 23
0
 def makeBox(self,
             origin: aecPoint = aecPoint(),
             xSize: float = 1.0,
             ySize: float = 1.0) -> bool:
     """
     Creates a rectangular boundary from two diagonal points.
     """
     try:
         return [
             aecPoint(origin.x, origin.y),
             aecPoint(origin.x + xSize, origin.y),
             aecPoint(origin.x + xSize, origin.y + ySize),
             aecPoint(origin.x, origin.y + ySize)
         ]
     except Exception:
         traceback.print_exc()
         return False
Ejemplo n.º 24
0
def makeSpaceTower(stories: int = 5, mostRooms: int = 4):
    x = 0
    y = 0
    z = 0
    rows = 1
    columns = 1
    spaces = []
    vector = [0, 0, 0]
    xOffset = 100000
    yOffset = 90000
    zOffset = 3500
    
    while y < rows:
        while x < columns:
            rotate = 0
            while z < stories:
                spcGroup = aecSpaceGroup()
                offset = 0            
                if z == 0: 
                    southRooms = 0
                    zOffset = 10000
                else:
                    zOffset = 3500
                    southRooms = randint(1, 2)
                shell = makeFloor(offset = offset,
                                  rotation = rotate,
                                  roomsSouth = southRooms, 
                                  roomsEast = randint(1, mostRooms), 
                                  roomsNorth = 1, 
                                  roomsWest= randint(1, mostRooms),
                                  roomsNorthSize = randint(8000, 15000),
                                  roomsSouthSize = randint(8000, 15000))
                spcGroup.add([shell.corridor.space])
                spcGroup.add(shell.rooms.spaces)                  
                spcGroup.moveBy(vector[0], vector[1], vector[2])
                vector[2] += zOffset
                spaces += spcGroup.spaces               
                z += 1        
            z = 0
            x += 1
            vector[2] = 0
            vector[0] += xOffset      
        x = 0
        vector[0] = 0
        vector[2] = 0
        vector[1] += yOffset
        y += 1
        xCoord = 10000
        yCoord = 70000
        point = aecPoint(xCoord, yCoord, 0)
        core = aecSpace()
        shaper = aecShaper()
        core.boundary = shaper.makeBox(point, 10000, 10000)
        core.height = ((stories - 1) * 3500) + 15000
        core.color = aecColor.granite
        core.name = 'Shaft'
        spaces += [core]
        return spaces
def placeCloset(space: aecSpace, rotation: float = 0):
    origin = space.origin_floor
    point = aecPoint(origin.x + 1, origin.y + 1)
    closet = aecSpace()
    closet.boundary = shaper.makeBox(point, 700, 2750)
    closet.height = 2749
    closet.rotate(rotation, space.center_floor)
    mesh = closet.mesh_graphic
    model.add_triangle_mesh(mesh.vertices, mesh.normals, mesh.indices, colorYellow)
Ejemplo n.º 26
0
def placeFurniture(space):
    origin = space.origin_floor
    point = aecPoint(origin.x + 1032.5, origin.y)
    couchSeat = aecSpace()
    couchSeat.boundary = shaper.makeBox(point, 2000, 800)
    couchSeat.height = 370
    couchSeat.color = aecColor.white
    couchBack = aecSpace()
    couchBack.boundary = shaper.makeBox(point, 2000, 200)
    couchBack.height = 330
    couchBack.level = origin.z + 380
    couchBack.color = aecColor.white
    point = aecPoint(point.x + 300, point.y + 1200)
    table = aecSpace()
    table.boundary = shaper.makeBox(point, 1400, 600)
    table.height = 370
    table.color = aecColor.white
    return [couchSeat, couchBack, table]
Ejemplo n.º 27
0
 def makeCore(point, xWidth, yDepth, zHeight):
     xCoord = (point.x - 5) + (xWidth * 0.5)
     yCoord = (point.y + (yDepth * (randint(0, 9) * 0.1)))
     point = aecPoint(xCoord, yCoord, point.z)
     core = aecSpace()
     core.boundary = shaper.makeBox(point, 10, 20)
     core.height = zHeight
     core.color = aecColor.gray
     return core
Ejemplo n.º 28
0
def makeSite():
    site = aecSpace()
    site.points_floor = [
        aecPoint(coord[0], coord[1]) for coord in siteBoundary["coordinates"]
    ]
    site.color = aecColor.green
    site.level = -20
    site.height = 20
    return site
Ejemplo n.º 29
0
def makeRackCross(rotation: float, moveBy: List[float]):
    components = aecSpaceGroup();
    base = aecSpace();
    base.boundary = shaper.makeCylinder(aecPoint(), radius = 40)
    base.height = 5
    support = aecSpace()
    support.boundary = shaper.makeCylinder(aecPoint(), radius = 5)
    support.height = 157
    support.moveBy(0, 0, 5)
    top = aecSpace();
    top.boundary = shaper.makeCross(aecPoint(-50, -50), 100, 100, xWidth = 10 , yDepth = 10)
    top.height = 4
    top.moveBy(0, 0, 162)
    components.add([base, support, top])
    components.moveBy(moveBy[0], moveBy[1], moveBy[2])
    components.rotate(uniform(0, rotation), base.center_floor)
    for component in components.spaces:
        mesh = component.mesh_graphic
        model.add_triangle_mesh(mesh.vertices, mesh.normals, mesh.indices, colorSilver)
Ejemplo n.º 30
0
 def makeBox(self,
             origin: aecPoint = aecPoint(),
             xSize: float = 1.0,
             ySize: float = 1.0) -> List[aecPoint]:
     """
     Returns a series of anticlockwise points representing
     a rectangular boundary derived from two diagonal points.
     Returns None on failure.
     """
     try:
         return [
             aecPoint(origin.x, origin.y),
             aecPoint(origin.x + xSize, origin.y),
             aecPoint(origin.x + xSize, origin.y + ySize),
             aecPoint(origin.x, origin.y + ySize)
         ]
     except Exception:
         traceback.print_exc()
         return None