def element_data_creator(dims,
                          lay,
                          global_c,
                          layer_c,
                          z,
                          len_dir,
                          w_dir,
                          grid_pos,
                          loc="centre",
                          sup=False):
     myElement = Element.from_dimensions(dims[2], dims[0], dims[1])
     myElement.layer = lay
     myElement.global_count = global_c
     myElement.no_in_layer = layer_c
     myElement.z_drop = z
     myElement.length_direction = len_dir
     myElement.width_direction = w_dir
     myElement.grid_position = grid_pos
     myElement.location = loc
     myElement.width = dims[0]
     myElement.height = dims[1]
     myElement.length = dims[2]
     myElement.supporter = sup
     myElement.glue_givers = []
     myElement.glue_receivers = []
     myElement.glue_surfaces = []
     myElement.glue_paths = []
     myElement.receiving_neighbours = []
     myElement.giving_neighbours = []
     self.add_element(myElement)
 def element_data_creator(dims, lay, global_c, layer_c, z, len_dir, w_dir, grid_pos, vert_sup, perpendicular=False, loc="centre"):
     myElement = Element.from_dimensions(dims[2], dims[0], dims[1])
     myElement.layer = lay
     myElement.global_count = global_c
     myElement.no_in_layer = layer_c
     myElement.z_drop = z
     myElement.length_direction = len_dir
     myElement.width_direction = w_dir
     myElement.grid_position = grid_pos
     myElement.location = loc
     myElement.width = dims[0]
     myElement.height = dims[1]
     myElement.length = dims[2]
     myElement.perp = perpendicular
     myElement.sup = vert_sup
     myElement.glue_givers = []
     myElement.glue_receivers = []
     myElement.glue_surfaces = []
     myElement.glue_paths = []
     myElement.receiving_neighbours = []
     myElement.giving_neighbours = []
     self.add_element(myElement)
     if vert_sup:
         if layer_c == 0:
             myElement.grid_position -= myElement.width/2
             myElement.grid_position += (self.vertical_support_interlock - self.vertical_support_width)/2
         else:
             myElement.grid_position += myElement.width/2
             myElement.grid_position -= (self.vertical_support_interlock - self.vertical_support_width)/2
         myElement.width = self.vertical_support_interlock + self.vertical_support_width
Exemple #3
0
        def element_data_creator(dims,
                                 lay,
                                 global_c,
                                 layer_c,
                                 z,
                                 len_dir,
                                 w_dir,
                                 grid_pos,
                                 vert_support,
                                 perpendicular=False,
                                 loc="centre"):
            myElement = Element.from_dimensions(dims[2], dims[0], dims[1])
            myElement.layer = lay
            myElement.global_count = global_c
            myElement.no_in_layer = layer_c
            myElement.z_drop = z
            myElement.length_direction = len_dir
            myElement.width_direction = w_dir
            myElement.grid_position = grid_pos
            myElement.location = loc
            myElement.width = dims[0]
            myElement.height = dims[1]
            myElement.length = dims[2]
            myElement.perp = perpendicular
            myElement.vert_sup = vert_support
            myElement.glue_givers = []
            myElement.glue_receivers = []
            myElement.glue_surfaces = []
            myElement.glue_paths = []
            myElement.receiving_neighbours = []
            myElement.giving_neighbours = []
            self.add_element(myElement)

            # very wide pieces that both carry vertical load and connect to the other boards
            if myElement.vert_sup and not myElement.perp:
                if layer_c == 0:
                    myElement.grid_position -= myElement.width / 2
                    myElement.grid_position += (
                        self.vertical_support_interlock -
                        self.vertical_support_width) / 2
                else:
                    myElement.grid_position += myElement.width / 2
                    myElement.grid_position -= (
                        self.vertical_support_interlock -
                        self.vertical_support_width) / 2
                myElement.width = self.vertical_support_interlock + self.vertical_support_width
                myElement.length += self.vertical_support_width * 2

            # not so wide pieces that only carry vertical load
            elif myElement.perp:
                myElement.length -= self.vertical_support_interlock * 2
                myElement.width = self.vertical_support_width
DATA = os.path.abspath(os.path.join(HERE, "..", "data"))
ASSEMBLY_PATH = os.path.abspath(os.path.join(HERE, "..", "src"))
sys.path.append(ASSEMBLY_PATH)
PATH_TO = os.path.join(
    DATA,
    os.path.splitext(os.path.basename(__file__))[0] + ".json")
print(PATH_TO)

from assembly_information_model.assembly import Element, Assembly

# dimensions full brick
length = 0.240
width = 0.115
height = 0.050

brick = Element.from_dimensions(length, width, height)
halfbrick = Element.from_dimensions(length / 2, width, height)

COURSES = 25
BRICKS_PER_COURSE = 4

MORTAR_PERPENDS = 0.025

total_length = BRICKS_PER_COURSE * length + (BRICKS_PER_COURSE -
                                             1) * MORTAR_PERPENDS
gap_even = MORTAR_PERPENDS
gap_uneven = MORTAR_PERPENDS
gap_uneven = (total_length - (BRICKS_PER_COURSE *
                              (length))) / BRICKS_PER_COURSE

assembly = Assembly()  # initialize an empty assembly class