Ejemplo n.º 1
0
    def get_all_grouped(self):
        # create x-raster
        for rib in self.ribs:
            rib.rotate(90, radians=False)

        panels = self.panels
        ribs = Layout.stack_row(self.ribs, self.config.patterns_align_dist_x)
        dribs = Layout.stack_row(self.dribs.values(),
                                 self.config.patterns_align_dist_x)
        straps = Layout.stack_row(self.straps.values(),
                                  self.config.patterns_align_dist_x)

        panels_grouped = panels.copy().group_materials()
        ribs_grouped = ribs.group_materials()
        dribs_grouped = dribs.group_materials()
        straps_grouped = straps.group_materials()

        panels_border = panels.draw_border(append=False)
        ribs_border = ribs.draw_border(append=False)
        dribs_border = dribs.draw_border(append=False)
        straps_border = straps.draw_border(append=False)

        for material_name, layout in panels_grouped.items():
            layout.parts.append(panels_border.copy())
            layout.add_text("panels_" + material_name)

        for material_name, layout in ribs_grouped.items():
            layout.parts.append(ribs_border.copy())
            layout.add_text("ribs_" + material_name)

        for material_name, layout in dribs_grouped.items():
            layout.parts.append(dribs_border.copy())
            layout.add_text("dribs_" + material_name)

        for material_name, layout in straps_grouped.items():
            layout.parts.append(straps_border.copy())
            layout.add_text("straps_" + material_name)

        panels.add_text("panels_all")

        all_layouts = [panels]
        all_layouts += panels_grouped.values()
        all_layouts += ribs_grouped.values()
        all_layouts += dribs_grouped.values()
        all_layouts += straps_grouped.values()

        return Layout.stack_column(all_layouts, 0.01, center_x=False)
Ejemplo n.º 2
0
    def get_panels(self):
        self.panels.clear()
        panels_upper = []
        panels_lower = []
        panels = []

        for cell in self.glider_3d.cells:
            pm = self._get_cellplotmaker(cell)
            lower = pm.get_panels_lower()
            upper = pm.get_panels_upper()
            panels_lower.append(lower)
            panels_upper.append(upper)
            panels.append([])

        if self.config.layout_seperate_panels:
            layout_lower = Layout.stack_row(panels_lower,
                                            self.config.patterns_align_dist_x)
            layout_lower.rotate(180, radians=False)
            layout_upper = Layout.stack_row(panels_upper,
                                            self.config.patterns_align_dist_x)

            self.panels = Layout.stack_row([layout_lower, layout_upper],
                                           2 *
                                           self.config.patterns_align_dist_x,
                                           draw_grid=True)

        else:
            height = 0

            for cell in self.glider_3d.cells:
                lower = self._get_cellplotmaker(cell).get_panels_lower()
                #lower.rotate(180, radians=False)
                upper = self._get_cellplotmaker(cell).get_panels_upper()
                height = max(height, lower.height)
                panels_lower.append(lower)
                panels_upper.append(upper)
                print("jodolo")

            height += self.config.patterns_align_dist_y

            self.panels = Layout.stack_grid([panels_upper, panels_lower],
                                            self.config.patterns_align_dist_x,
                                            self.config.patterns_align_dist_y)

        return self.panels