def __transform_base_polygon__(self, path, polyline3D_contur):
        """
        Transforms the base polygon3D

        Args:
            path:               only the first segment is needed
            polyline3D_contur:  will be transformed to placed perpendicular on the first segment of the path

        Returns:
            transformed polyline3D_contur

        """

        pnt1 = path.GetPoint(0)
        pnt2 = path.GetPoint(1)

        diff_x = pnt2.X - pnt1.X
        diff_y = pnt2.Y - pnt1.Y
        diff_z = pnt2.Z - pnt1.Z

        tmp_plane = AllplanGeo.Plane3D(
            AllplanGeo.Point3D(0, 0, 0),
            AllplanGeo.Vector3D(diff_x, diff_y, diff_z))

        matrix = AllplanGeo.Matrix3D()
        matrix = tmp_plane.GetTransformationMatrix()
        result = AllplanGeo.Transform(polyline3D_contur, matrix)
        matrix2 = AllplanGeo.Matrix3D()
        matrix2.SetTranslation(AllplanGeo.Vector3D(pnt1.X, pnt1.Y, pnt1.Z))
        result = AllplanGeo.Transform(result, matrix2)
        return result
Exemple #2
0
    def create_stirrup(self):

        stirrup_list = []
        point_f_1 = AllplanGeo.Point3D(self.SlotLength, 0, 0)
        point_t_1 = AllplanGeo.Point3D(self.CutPosition, 0, 0)

        #构模
        shape_stirrup = self.shape_stirrup()  #箍筋
        stirrup_list.append(
            LinearBarBuilder.create_linear_bar_placement_from_to_by_dist(
                0, shape_stirrup, point_f_1, point_t_1, self.HeadCover,
                self.EndCover, self.StirDistance, 3))

        #判断间距添加箍筋
        if self.cut_pos_1 - self.last_pos_1 > self.StirDistance / 2 \
        and self.cut_pos_1 - self.last_pos_1 < self.StirDistance + self.StirDiameter:
            point_cnt_1 = AllplanGeo.Point3D(
                self.last_pos_1 + self.StirDistance / 2, 0, 0)
            point_cnt_2 = AllplanGeo.Point3D(self.cut_pos_1, 0, 0)
            vec = AllplanGeo.Vector3D(
                AllplanGeo.Point3D(0, 0, 0),
                AllplanGeo.Point3D(self.StirDistance / 2, 0, 0))
            s_shape = AllplanReinf.BendingShape(shape_stirrup)
            s_shape.Move(
                AllplanGeo.Vector3D(AllplanGeo.Point3D(self.cut_pos_1, 0, 0)))
            stirrup_list.append(
                AllplanReinf.BarPlacement(0, 1, vec, point_cnt_1, point_cnt_2,
                                          s_shape))

        point_f_2 = AllplanGeo.Point3D(self.CutPosition + self.CutLength, 0, 0)
        point_t_2 = AllplanGeo.Point3D(self.Length - self.SlotLength, 0, 0)

        stirrup_list.append(
            LinearBarBuilder.create_linear_bar_placement_from_to_by_dist(
                1, shape_stirrup, point_t_2, point_f_2, self.HeadCover,
                self.EndCover, self.StirDistance, 3))



        if self.cut_pos_2 - self.last_pos_2 > self.StirDistance / 2 \
        and self.cut_pos_2 - self.last_pos_2 < self.StirDistance + self.StirDiameter:
            point_cnt_3 = AllplanGeo.Point3D(self.CutPosition + self.CutLength,
                                             0, 0)
            point_cnt_4 = AllplanGeo.Point3D(self.Length - self.SlotLength, 0,
                                             0)
            vec = AllplanGeo.Vector3D(
                AllplanGeo.Point3D(0, 0, 0),
                AllplanGeo.Point3D(self.StirDistance / 2, 0, 0))
            s_shape = AllplanReinf.BendingShape(shape_stirrup)
            s_shape.Move(
                AllplanGeo.Vector3D(
                    AllplanGeo.Point3D(
                        self.CutPosition + self.CutLength + self.EndCover, 0,
                        0)))
            stirrup_list.append(
                AllplanReinf.BarPlacement(0, 1, vec, point_cnt_3, point_cnt_4,
                                          s_shape))

        return stirrup_list
Exemple #3
0
    def create_stirrup(self):

        stirrup_list = []

        #构模
        shape_stirrup = self.shape_stirrup(self.StirrupType)

        point_f_1 = AllplanGeo.Point3D(0, 0, 0)
        point_t_1 = AllplanGeo.Point3D(self.StirDenseRegionLength, 0, 0)
        stirrup_list.append(
            LinearBarBuilder.create_linear_bar_placement_from_to_by_dist(
                0, shape_stirrup, point_f_1, point_t_1, self.StirBothEndLength,
                0, self.StirDenseRegionDistance, 3))

        point_f_2 = AllplanGeo.Point3D(
            self.Length - self.StirDenseRegionLength, 0, 0)
        point_t_2 = AllplanGeo.Point3D(self.Length, 0, 0)
        stirrup_list.append(
            LinearBarBuilder.create_linear_bar_placement_from_to_by_dist(
                0, shape_stirrup, point_f_2, point_t_2, 0,
                self.StirBothEndLength, self.StirDenseRegionDistance, 2))

        point_f = AllplanGeo.Point3D(self.StirDenseRegionLength, 0, 0)
        point_t = AllplanGeo.Point3D(self.Length - self.StirDenseRegionLength,
                                     0, 0)
        stirrup_list.append(
            LinearBarBuilder.create_linear_bar_placement_from_to_by_dist(
                0, shape_stirrup, point_f, point_t,
                self.StirDenseRegionDistance / 2,
                self.StirDenseRegionDistance / 2,
                self.StirrupSparseRegionDistance, 3))

        if steel_modify(self.Length - 2 * self.StirDenseRegionLength,
                        self.StirDiameter, self.StirrupSparseRegionDistance,
                        self.StirDenseRegionDistance / 2,
                        self.StirDenseRegionDistance / 2):
            point_cnt_1 = AllplanGeo.Point3D(self.StirDenseRegionLength, 0, 0)
            point_cnt_2 = AllplanGeo.Point3D(self.Length, 0, 0)
            vec = AllplanGeo.Vector3D(
                AllplanGeo.Point3D(0, 0, 0),
                AllplanGeo.Point3D(self.StirrupSparseRegionDistance / 2, 0, 0))
            s_shape = AllplanReinf.BendingShape(shape_stirrup)
            s_shape.Move(
                AllplanGeo.Vector3D(
                    AllplanGeo.Point3D(
                        self.Length - self.StirDenseRegionLength, 0, 0)))
            stirrup_list.append(
                AllplanReinf.BarPlacement(0, 1, vec, point_cnt_1, point_cnt_2,
                                          s_shape))

        return stirrup_list
Exemple #4
0
    def shape_stiff(self,
                    stiff_length,
                    stiff_width,
                    stiff_height,
                    rX=0,
                    rY=0,
                    rZ=0,
                    sX=0,
                    sY=0,
                    sZ=0):
        '''
        shape_stiff
        筋板构形

        Args:
            stiff_length:
            stiff_width:
            stiff_height:
            rX:
            rY:
            rZ:
            sX:
            sY:
            sZ:

        Return:
            A stiff object
            筋板对象
        '''

        args = {
            'refPoint': AllplanGeo.Point3D(rX, rY, rZ),
            'startPoint': AllplanGeo.Point3D(sX, sY, sZ),
            'vec1': AllplanGeo.Vector3D(stiff_length, 0, 0),
            'vec2': AllplanGeo.Vector3D(0, stiff_width, 0),
            'vec3': AllplanGeo.Vector3D(0, 0, stiff_height)
        }

        gen_stiff = AllplanGeo.Cuboid3D(**args)

        return gen_stiff
    def add_windows(self, build_ele, com_prop_stroke, wall_length, wall_width,
                    wall_thickness):
        p_x = build_ele.win_x.value
        p_y = 0
        p_z = build_ele.win_z.value

        void_length = build_ele.win_length.value
        void_width = build_ele.win_width.value
        void_thickness = wall_thickness

        void = AllplanGeo.Polyhedron3D.CreateCuboid(void_length,
                                                    void_thickness, void_width)
        trans_to_ref_point_2 = AllplanGeo.Matrix3D()
        trans_to_ref_point_2.Translate(AllplanGeo.Vector3D(p_x, p_y, p_z))
        void = AllplanGeo.Transform(void, trans_to_ref_point_2)

        self.model_ele_list.append(
            AllplanBasisElements.ModelElement3D(com_prop_stroke, void))

        #--------------------------------------------------------------------------------------#
        #----------------------------------Void Handle-----------------------------------------#
        #--------------------------------------------------------------------------------------#
        origin = AllplanGeo.Point3D(0, 0, 0)

        originwin = AllplanGeo.Point3D(p_x, 0, p_z)
        win_plength = AllplanGeo.Point3D(p_x + void_length, 0, p_z)
        win_pwidth = AllplanGeo.Point3D(p_x, 0, p_z + void_width)
        win_pointx = AllplanGeo.Point3D(p_x + void_length / 2, 0, p_z)
        win_pointz = AllplanGeo.Point3D(p_x, 0, p_z + void_width / 2)

        handle_winlength = HandleProperties(
            "windowsMoveLength", win_plength, originwin,
            [("win_length", HandleDirection.x_dir)], HandleDirection.x_dir,
            True)
        self.handle_list.append(handle_winlength)

        handle_winwidth = HandleProperties(
            "windowsMoveWidth", win_pwidth, originwin,
            [("win_width", HandleDirection.z_dir)], HandleDirection.z_dir,
            True)
        self.handle_list.append(handle_winwidth)

        handle_winx = HandleProperties("windowsMoveX", win_pointx, originwin,
                                       [("win_x", HandleDirection.x_dir)],
                                       HandleDirection.x_dir, False)
        self.handle_list.append(handle_winx)

        handle_winz = HandleProperties("windowsMoveZ", win_pointz, origin,
                                       [("win_z", HandleDirection.z_dir)],
                                       HandleDirection.z_dir, False)
        self.handle_list.append(handle_winz)

        return void
Exemple #6
0
    def shape_cuboid(self,
                     length,
                     width,
                     height,
                     sX=0,
                     sY=0,
                     sZ=0,
                     rX=0,
                     rY=0,
                     rZ=0):

        axis = AllplanGeo.AxisPlacement3D(
            AllplanGeo.Point3D(rX + sX, rY + sY, rZ + sZ),
            AllplanGeo.Vector3D(1, 0, 0), AllplanGeo.Vector3D(0, 0, 1))

        args = {
            'placement': axis,
            'length': length,
            'width': width,
            'height': height
        }

        shape = AllplanGeo.BRep3D.CreateCuboid(**args)
        return shape
    def add_door(self, build_ele, com_prop_stroke, wall_length, wall_width,
                 wall_thickness):
        d_x = build_ele.door_x.value
        d_y = 0
        d_z = 0

        door_length = build_ele.door_length.value
        door_width = build_ele.door_width.value
        door_thickness = wall_thickness

        door = AllplanGeo.Polyhedron3D.CreateCuboid(door_length,
                                                    door_thickness, door_width)
        trans_to_ref_point_3 = AllplanGeo.Matrix3D()
        trans_to_ref_point_3.Translate(AllplanGeo.Vector3D(d_x, d_y, d_z))
        door = AllplanGeo.Transform(door, trans_to_ref_point_3)

        self.model_ele_list.append(
            AllplanBasisElements.ModelElement3D(com_prop_stroke, door))

        #--------------------------------------------------------------------------------------#
        #----------------------------------Door Handle-----------------------------------------#
        #--------------------------------------------------------------------------------------#

        origin = AllplanGeo.Point3D(0, 0, 0)
        door_plength = AllplanGeo.Point3D(d_x + door_length, 0, 0)
        door_pwidth = AllplanGeo.Point3D(d_x, 0, door_width)
        door_pointx = AllplanGeo.Point3D(d_x, 0, 0)

        handle_doorlength = HandleProperties(
            "DoorMoveLength", door_plength, door_pointx,
            [("door_length", HandleDirection.x_dir)], HandleDirection.x_dir,
            True)
        self.handle_list.append(handle_doorlength)

        handle_doorwidth = HandleProperties(
            "DoorMoveWidth", door_pwidth, door_pointx,
            [("door_width", HandleDirection.z_dir)], HandleDirection.z_dir,
            True)
        self.handle_list.append(handle_doorwidth)
        handle_doorx = HandleProperties("doorMoveX", door_pointx, origin,
                                        [("door_x", HandleDirection.x_dir)],
                                        HandleDirection.x_dir, False)
        self.handle_list.append(handle_doorx)

        return door
Exemple #8
0
    def create_tie_steel(self):
        steel_list = []

        cover = ConcreteCoverProperties(self.StirSideCover + self.StirDiameter,
                                        self.StirSideCover + self.StirDiameter,
                                        0, 0)

        rebar_prop = {
            'diameter': self.TieBarDia,
            'bending_roller': 0,
            'steel_grade': self.TieBarGrade,
            'concrete_grade': self.ConcreteGrade,
            'bending_shape_type': AllplanReinf.BendingShapeType.LongitudinalBar
        }

        tie = Stirrup(cover, rebar_prop)

        tie_shape = tie.shape_tie_steel(self.Width + 3 * self.StirDiameter +
                                        2 * self.TieBarDia,
                                        4 * self.TieBarDia,
                                        RotationAngles(225, 0, 90),
                                        hook=self.TieBendingLength,
                                        degrees=self.TieBarAngle)

        distance = 0
        for x in range(self.WaistRows):
            point_f_1 = AllplanGeo.Point3D(
                -self.StirDiameter, -1.5 * self.StirDiameter - self.TieBarDia,
                self.WaistPosition + self.WaistBarDiameter + distance)
            point_t_1 = AllplanGeo.Point3D(
                self.StirDenseRegionLength - self.StirDiameter,
                -1.5 * self.StirDiameter - self.TieBarDia,
                self.WaistPosition + self.WaistBarDiameter + distance)

            steel_list.append(
                LinearBarBuilder.create_linear_bar_placement_from_to_by_dist(
                    0, tie_shape, point_f_1, point_t_1, self.StirBothEndLength,
                    0, self.StirDenseRegionDistance, 3))

            point_f_2 = AllplanGeo.Point3D(
                self.Length - self.StirDenseRegionLength - self.StirDiameter,
                -1.5 * self.StirDiameter - self.TieBarDia,
                self.WaistPosition + self.WaistBarDiameter + distance)
            point_t_2 = AllplanGeo.Point3D(
                self.Length - self.StirDiameter,
                -1.5 * self.StirDiameter - self.TieBarDia,
                self.WaistPosition + self.WaistBarDiameter + distance)
            steel_list.append(
                LinearBarBuilder.create_linear_bar_placement_from_to_by_dist(
                    0, tie_shape, point_f_2, point_t_2, 0,
                    self.StirBothEndLength, self.StirDenseRegionDistance, 2))

            point_f = AllplanGeo.Point3D(
                self.StirDenseRegionLength - self.StirDiameter,
                -1.5 * self.StirDiameter - self.TieBarDia,
                self.WaistPosition + self.WaistBarDiameter + distance)
            point_t = AllplanGeo.Point3D(
                self.Length - self.StirDenseRegionLength - self.StirDiameter,
                -1.5 * self.StirDiameter - self.TieBarDia,
                self.WaistPosition + self.WaistBarDiameter + distance)
            steel_list.append(
                LinearBarBuilder.create_linear_bar_placement_from_to_by_dist(
                    0, tie_shape, point_f, point_t,
                    self.StirDenseRegionDistance / 2,
                    self.StirDenseRegionDistance / 2,
                    self.StirrupSparseRegionDistance, 3))

            if steel_modify(self.Length - 2 * self.StirDenseRegionLength,
                            self.StirDiameter,
                            self.StirrupSparseRegionDistance,
                            self.StirDenseRegionDistance / 2,
                            self.StirDenseRegionDistance / 2):
                point_cnt_1 = AllplanGeo.Point3D(self.StirDenseRegionLength, 0,
                                                 0)
                point_cnt_2 = AllplanGeo.Point3D(self.Length, 0, 0)
                vec = AllplanGeo.Vector3D(
                    AllplanGeo.Point3D(0, 0, 0),
                    AllplanGeo.Point3D(self.StirrupSparseRegionDistance / 2, 0,
                                       0))
                s_shape = AllplanReinf.BendingShape(tie_shape)
                s_shape.Move(
                    AllplanGeo.Vector3D(
                        AllplanGeo.Point3D(
                            self.Length - self.StirDenseRegionLength -
                            self.StirDiameter,
                            -1.5 * self.StirDiameter - self.TieBarDia,
                            self.WaistPosition + self.WaistBarDiameter +
                            distance)))
                steel_list.append(
                    AllplanReinf.BarPlacement(0, 1, vec, point_cnt_1,
                                              point_cnt_2, s_shape))

            distance += self.WaistDistance

        return steel_list
Exemple #9
0
    def create_tie_steel(self):
        steel_list = []
        tie_shape = self.shape_tie_steel(self.Width, 4 * self.TieBarDia)

        distance = 0
        for x in range(self.WaistNum):
            point_f_x = AllplanGeo.Point3D(
                self.SlotLength + self.StirDiameter, 0,
                self.WaistPosition - 2 * self.TieBarDia + distance)
            point_t_x = AllplanGeo.Point3D(
                self.CutPosition + self.StirDiameter, 0,
                self.WaistPosition - 2 * self.TieBarDia + distance)
            steel_list.append(
                LinearBarBuilder.create_linear_bar_placement_from_to_by_dist(
                    0, tie_shape, point_f_x, point_t_x, self.HeadCover,
                    self.EndCover, self.TieBarRatio * self.StirDistance, 3))
            if self.cut_pos_1 - self.last_pos_1 > self.StirDistance / 2 \
            and self.cut_pos_1 - self.last_pos_1 < self.StirDistance + self.StirDiameter:
                point_cnt_1 = AllplanGeo.Point3D(
                    self.last_pos_1 + self.StirDistance / 2, 0, 0)
                point_cnt_2 = AllplanGeo.Point3D(self.cut_pos_1, 0, 0)
                vec = AllplanGeo.Vector3D(
                    AllplanGeo.Point3D(0, 0, 0),
                    AllplanGeo.Point3D(self.StirDistance / 2, 0, 0))
                s_shape = AllplanReinf.BendingShape(tie_shape)
                s_shape.Move(
                    AllplanGeo.Vector3D(
                        AllplanGeo.Point3D(
                            self.cut_pos_1 + self.StirDiameter, 0,
                            self.WaistPosition - 2 * self.TieBarDia +
                            distance)))
                steel_list.append(
                    AllplanReinf.BarPlacement(0, 1, vec, point_cnt_1,
                                              point_cnt_2, s_shape))

            distance += self.WaistDistance

        distance = 0
        for y in range(self.WaistNum):
            point_f_y = AllplanGeo.Point3D(
                self.CutPosition + self.CutLength + self.StirDiameter, 0,
                self.WaistPosition - 2 * self.TieBarDia + distance)
            point_t_y = AllplanGeo.Point3D(
                self.Length - self.SlotLength + self.StirDiameter, 0,
                self.WaistPosition - 2 * self.TieBarDia + distance)
            steel_list.append(
                LinearBarBuilder.create_linear_bar_placement_from_to_by_dist(
                    0, tie_shape, point_t_y, point_f_y, self.HeadCover,
                    self.EndCover, self.TieBarRatio * self.StirDistance, 3))
            if self.cut_pos_2 - self.last_pos_2 > self.StirDistance / 2 \
            and self.cut_pos_2 - self.last_pos_2 < self.StirDistance + self.StirDiameter:
                point_cnt_3 = AllplanGeo.Point3D(
                    self.CutPosition + self.CutLength, 0, 0)
                point_cnt_4 = AllplanGeo.Point3D(self.Length - self.SlotLength,
                                                 0, 0)
                vec = AllplanGeo.Vector3D(
                    AllplanGeo.Point3D(0, 0, 0),
                    AllplanGeo.Point3D(self.StirDistance / 2, 0, 0))
                s_shape = AllplanReinf.BendingShape(tie_shape)
                s_shape.Move(
                    AllplanGeo.Vector3D(
                        AllplanGeo.Point3D(
                            self.CutPosition + self.CutLength + self.EndCover +
                            self.StirDiameter, 0, self.WaistPosition -
                            2 * self.TieBarDia + distance)))
                steel_list.append(
                    AllplanReinf.BarPlacement(0, 1, vec, point_cnt_3,
                                              point_cnt_4, s_shape))

            distance += self.WaistDistance

        return steel_list
Exemple #10
0
    def create_geometry(self, build_ele):
        """
        Create the element geometries

        Args:
            build_ele:  the building element.
        """

        #----------------- Extract palette parameter values

        wall_length = build_ele.Length1_1.value
        wall_width = build_ele.Width1_1.value
        wall_thickness = build_ele.Thickness1_1.value

        void_active = build_ele.chkb_win.value
        door_active = build_ele.chkb_door.value

        join1_type_added = build_ele.join1_type_active.value
        join1_type_select = build_ele.join1_type.value

        join2_type_added = build_ele.join2_type_active.value
        join2_type_select = build_ele.join2_type.value

        #------------------------------------ Create wall------------------------------------------#

        wall = AllplanGeo.Polyhedron3D.CreateCuboid(wall_length,
                                                    wall_thickness, wall_width)
        trans_to_ref_point_1 = AllplanGeo.Matrix3D()
        trans_to_ref_point_1.Translate(AllplanGeo.Vector3D(0, 0, 0))
        wall = AllplanGeo.Transform(wall, trans_to_ref_point_1)

        #----------------------------Create Component Property--------------------------------------#
        com_prop_base_bodies = AllplanBaseElements.CommonProperties()
        com_prop_base_bodies.GetGlobalProperties()
        com_prop_base_bodies.Color = 1

        com_prop_stroke = AllplanBaseElements.CommonProperties()
        com_prop_stroke.GetGlobalProperties()
        com_prop_stroke.Stroke = 9  # dots
        com_prop_stroke.HelpConstruction = True

        self.model_ele_list.append(
            AllplanBasisElements.ModelElement3D(com_prop_stroke, wall))

        #------------------ Append Element to Wall -------------------------------------------------#
        if (void_active):
            void = self.add_windows(build_ele, com_prop_stroke, wall_length,
                                    wall_width, wall_thickness)
            err, wall = AllplanGeo.MakeSubtraction(wall, void)

        if (door_active):
            door = self.add_door(build_ele, com_prop_stroke, wall_length,
                                 wall_width, wall_thickness)
            err, wall = AllplanGeo.MakeSubtraction(wall, door)

        if (join1_type_added):
            join1 = self.add_joins_left(build_ele,
                                        com_prop_stroke,
                                        type=join1_type_select)
            err, wall = AllplanGeo.MakeSubtraction(wall, join1)

        if (join2_type_added):
            join2 = self.add_joins_right(build_ele,
                                         com_prop_stroke,
                                         type=join2_type_select)
            err, wall = AllplanGeo.MakeSubtraction(wall, join2)

        #---------------------------------------Add Wall Element----------------------------------------#
        self.model_ele_list.append(
            AllplanBasisElements.ModelElement3D(com_prop_base_bodies, wall))

        #-----------------------------------------------------------------------------------------------#
        #-----------------------------------------wall handle-------------------------------------------#
        #-----------------------------------------------------------------------------------------------#

        origin = AllplanGeo.Point3D(0, 0, 0)
        wall_plength = AllplanGeo.Point3D(wall_length, 0, 0)
        wall_pwidth = AllplanGeo.Point3D(0, 0, wall_width)
        wall_pthickness = AllplanGeo.Point3D(0, wall_thickness, 0)

        handle_walllength = HandleProperties(
            "WallMoveLength", wall_plength, origin,
            [("Length1_1", HandleDirection.x_dir)], HandleDirection.x_dir,
            True)
        self.handle_list.append(handle_walllength)

        handle_wallwidth = HandleProperties(
            "WallMoveWidth", wall_pwidth, origin,
            [("Width1_1", HandleDirection.z_dir)], HandleDirection.z_dir, True)
        self.handle_list.append(handle_wallwidth)

        handle_wallthickness = HandleProperties(
            "WallMoveThickness", wall_pthickness, origin,
            [("Thickness1_1", HandleDirection.y_dir)], HandleDirection.y_dir,
            True)
        self.handle_list.append(handle_wallthickness)
Exemple #11
0
    def create_tie_steel(self):
        steel_list = []
        tie_shape = self.shape_tie_steel(self.Width, 4 * self.TieSteelDia)

        distance = self.HoriBottomCover + self.HoriSteelDia

        lines = int((self.Height - self.HoriTopCover - self.HoriBottomCover -
                     self.HoriSteelDia) / self.HoriDistance)
        rows = int((self.Length - 2 * self.VertSideCover - self.VertSteelDia) /
                   self.VertDistance)
        if self.TieMode == 1:
            for x in range(lines + 1):

                point_f = AllplanGeo.Point3D(2 * self.VertSteelDia, 0,
                                             distance)
                point_t = AllplanGeo.Point3D(
                    self.Length + 2 * self.VertSteelDia, 0, distance)
                if x % 3 == 0:
                    steel_list.append(
                        LinearBarBuilder.
                        create_linear_bar_placement_from_to_by_dist(
                            0, tie_shape, point_f, point_t, self.VertSideCover,
                            self.VertSideCover, 3 * self.VertDistance, 3))

                distance += self.HoriDistance
            #last row
            if steel_modify(self.Height, self.HoriSteelDia, self.HoriDistance,
                            self.HoriBottomCover,
                            self.HoriTopCover) and (lines + 1) % 3 == 0:
                point_f = AllplanGeo.Point3D(
                    2 * self.VertSteelDia, 0,
                    self.Height - self.HoriTopCover + self.HoriSteelDia)
                point_t = AllplanGeo.Point3D(
                    self.Length + 2 * self.VertSteelDia, 0,
                    self.Height - self.HoriTopCover + self.HoriSteelDia)
                steel_list.append(
                    LinearBarBuilder.
                    create_linear_bar_placement_from_to_by_dist(
                        0, tie_shape, point_f, point_t, self.VertSideCover,
                        self.VertSideCover, 3 * self.VertDistance, 3))

            #last line
            if steel_modify(self.Length, self.VertSteelDia, self.VertDistance,
                            self.VertSideCover,
                            self.VertSideCover) and (rows + 1) % 3 == 0:
                l_distance = self.HoriBottomCover + self.HoriSteelDia
                for y in range(lines + 1):
                    if y % 3 == 0:
                        point_f_e = AllplanGeo.Point3D(0, 0, 0)
                        point_t_e = AllplanGeo.Point3D(self.Length, 0, 0)
                        vec = AllplanGeo.Vector3D(
                            AllplanGeo.Point3D(0, 0, 0),
                            AllplanGeo.Point3D(self.VertDistance / 2, 0, 0))
                        s_shape = AllplanReinf.BendingShape(tie_shape)
                        s_shape.Move(
                            AllplanGeo.Vector3D(
                                AllplanGeo.Point3D(
                                    self.Length - self.VertSideCover -
                                    self.VertSteelDia + 2 * self.VertSteelDia,
                                    0, l_distance)))
                        steel_list.append(
                            AllplanReinf.BarPlacement(0, 1, vec, point_f_e,
                                                      point_t_e, s_shape))
                    l_distance += self.HoriDistance
                #last line & row
                if steel_modify(self.Height, self.HoriSteelDia,
                                self.HoriDistance, self.HoriBottomCover,
                                self.HoriTopCover) and (lines + 1) % 3 == 0:
                    point_f_e = AllplanGeo.Point3D(0, 0, 0)
                    point_t_e = AllplanGeo.Point3D(self.Length, 0, 0)
                    vec = AllplanGeo.Vector3D(
                        AllplanGeo.Point3D(0, 0, 0),
                        AllplanGeo.Point3D(self.VertDistance / 2, 0, 0))
                    s_shape = AllplanReinf.BendingShape(tie_shape)
                    s_shape.Move(
                        AllplanGeo.Vector3D(
                            AllplanGeo.Point3D(
                                self.Length - self.VertSideCover -
                                self.VertSteelDia + 2 * self.VertSteelDia, 0,
                                self.Height - self.HoriTopCover +
                                self.HoriSteelDia)))
                    steel_list.append(
                        AllplanReinf.BarPlacement(0, 1, vec, point_f_e,
                                                  point_t_e, s_shape))

        elif self.TieMode == 2:
            distance = self.VertSideCover + 2 * self.VertSteelDia
            for x in range(rows + 1):

                if x % 4 == 0:
                    point_f = AllplanGeo.Point3D(distance, 0,
                                                 self.HoriSteelDia)
                    point_t = AllplanGeo.Point3D(
                        distance, 0, self.Height + self.HoriSteelDia)
                    steel_list.append(
                        LinearBarBuilder.
                        create_linear_bar_placement_from_to_by_dist(
                            0, tie_shape, point_f, point_t,
                            self.HoriBottomCover, self.HoriTopCover,
                            4 * self.HoriDistance, 3))
                if (x + 2) % 4 == 0 and x != 0:
                    point_f = AllplanGeo.Point3D(
                        distance, 0, self.HoriSteelDia + 2 * self.HoriDistance)
                    point_t = AllplanGeo.Point3D(
                        distance, 0, self.Height + self.HoriSteelDia)
                    steel_list.append(
                        LinearBarBuilder.
                        create_linear_bar_placement_from_to_by_dist(
                            0, tie_shape, point_f, point_t,
                            self.HoriBottomCover, self.HoriTopCover,
                            4 * self.HoriDistance, 3))

                distance += self.VertDistance

            if steel_modify(self.Length, self.VertSteelDia, self.VertDistance,
                            self.VertSideCover, self.VertSideCover):
                if (rows + 1) % 4 == 0:
                    point_f = AllplanGeo.Point3D(
                        self.Length - self.VertSideCover, 0, self.HoriSteelDia)
                    point_t = AllplanGeo.Point3D(
                        self.Length - self.VertSideCover, 0,
                        self.Height + self.HoriSteelDia)
                    steel_list.append(
                        LinearBarBuilder.
                        create_linear_bar_placement_from_to_by_dist(
                            0, tie_shape, point_f, point_t,
                            self.HoriBottomCover, self.HoriTopCover,
                            4 * self.HoriDistance, 3))
                if (rows + 3) % 4 == 0:
                    point_f = AllplanGeo.Point3D(
                        self.Length - self.VertSideCover, 0,
                        self.HoriSteelDia + 2 * self.HoriDistance)
                    point_t = AllplanGeo.Point3D(
                        self.Length - self.VertSideCover, 0,
                        self.Height + self.HoriSteelDia)
                    steel_list.append(
                        LinearBarBuilder.
                        create_linear_bar_placement_from_to_by_dist(
                            0, tie_shape, point_f, point_t,
                            self.HoriBottomCover, self.HoriTopCover,
                            4 * self.HoriDistance, 3))
            #last row
            if steel_modify(self.Height, self.HoriSteelDia, self.HoriDistance,
                            self.HoriBottomCover, self.HoriTopCover):
                if (lines + 1) % 4 == 0:
                    r_distance = self.VertSideCover + 2 * self.VertSteelDia

                    for z1 in range(rows + 1):
                        if z1 % 4 == 0:
                            point_f_e = AllplanGeo.Point3D(0, 0, 0)
                            point_t_e = AllplanGeo.Point3D(self.Length, 0, 0)
                            vec = AllplanGeo.Vector3D(
                                AllplanGeo.Point3D(0, 0, 0),
                                AllplanGeo.Point3D(self.HoriDistance / 2, 0,
                                                   0))
                            s_shape = AllplanReinf.BendingShape(tie_shape)
                            s_shape.Move(
                                AllplanGeo.Vector3D(
                                    AllplanGeo.Point3D(
                                        r_distance, 0,
                                        self.Height - self.HoriTopCover +
                                        self.HoriSteelDia)))
                            steel_list.append(
                                AllplanReinf.BarPlacement(
                                    0, 1, vec, point_f_e, point_t_e, s_shape))
                        r_distance += self.VertDistance
                        #last row & line
                        if steel_modify(
                                self.Length, self.VertSteelDia,
                                self.VertDistance, self.VertSideCover,
                                self.VertSideCover) and (rows + 1) % 4 == 0:
                            point_f_e = AllplanGeo.Point3D(0, 0, 0)
                            point_t_e = AllplanGeo.Point3D(self.Length, 0, 0)
                            vec = AllplanGeo.Vector3D(
                                AllplanGeo.Point3D(0, 0, 0),
                                AllplanGeo.Point3D(self.HoriDistance / 2, 0,
                                                   0))
                            s_shape = AllplanReinf.BendingShape(tie_shape)
                            s_shape.Move(
                                AllplanGeo.Vector3D(
                                    AllplanGeo.Point3D(
                                        self.Length - self.VertSideCover -
                                        self.VertSteelDia +
                                        2 * self.VertSteelDia, 0,
                                        self.Height - self.HoriTopCover +
                                        self.HoriSteelDia)))
                            steel_list.append(
                                AllplanReinf.BarPlacement(
                                    0, 1, vec, point_f_e, point_t_e, s_shape))

                #last row
                if (lines + 3) % 4 == 0:
                    r_distance = self.VertSideCover + 2 * self.VertSteelDia

                    for z2 in range(rows + 1):
                        if (z2 + 2) % 4 == 0:
                            point_f_e = AllplanGeo.Point3D(0, 0, 0)
                            point_t_e = AllplanGeo.Point3D(self.Length, 0, 0)
                            vec = AllplanGeo.Vector3D(
                                AllplanGeo.Point3D(0, 0, 0),
                                AllplanGeo.Point3D(self.HoriDistance / 2, 0,
                                                   0))
                            s_shape = AllplanReinf.BendingShape(tie_shape)
                            s_shape.Move(
                                AllplanGeo.Vector3D(
                                    AllplanGeo.Point3D(
                                        r_distance, 0,
                                        self.Height - self.HoriTopCover +
                                        self.HoriSteelDia)))
                            steel_list.append(
                                AllplanReinf.BarPlacement(
                                    0, 1, vec, point_f_e, point_t_e, s_shape))
                        r_distance += self.VertDistance
                        #last row & line
                        if steel_modify(
                                self.Length, self.VertSteelDia,
                                self.VertDistance, self.VertSideCover,
                                self.VertSideCover) and (rows + 3) % 4 == 0:
                            point_f_e = AllplanGeo.Point3D(0, 0, 0)
                            point_t_e = AllplanGeo.Point3D(self.Length, 0, 0)
                            vec = AllplanGeo.Vector3D(
                                AllplanGeo.Point3D(0, 0, 0),
                                AllplanGeo.Point3D(self.HoriDistance / 2, 0,
                                                   0))
                            s_shape = AllplanReinf.BendingShape(tie_shape)
                            s_shape.Move(
                                AllplanGeo.Vector3D(
                                    AllplanGeo.Point3D(
                                        self.Length - self.VertSideCover -
                                        self.VertSteelDia +
                                        2 * self.VertSteelDia, 0,
                                        self.Height - self.HoriTopCover +
                                        self.HoriSteelDia)))
                            steel_list.append(
                                AllplanReinf.BarPlacement(
                                    0, 1, vec, point_f_e, point_t_e, s_shape))

        return steel_list
Exemple #12
0
    def create_vertical_steel(self):
        steel_list = []

        cover = [
            self.Length_BA, self.Length_BA, self.Length_BA, self.Length_BA
        ]
        rebar_prop = {
            'diameter': self.HoriSteelDia,
            'bending_roller': 0,
            'steel_grade': self.HoriSteelGrade,
            'concrete_grade': self.ConcreteGrade,
            'bending_shape_type': AllplanReinf.BendingShapeType.LongitudinalBar
        }

        longit = LongitudinalSteel(cover, rebar_prop)
        if self.BendingAnchor:
            steel_vert_1 = longit.shape_anchor_steel(
                self.Height, self.Length_TA, self.BendPosition,
                self.BendLength, self.BendWidth, 2, False, True)
            steel_vert_2 = longit.shape_anchor_steel(
                self.Height, self.Length_TA, self.BendPosition,
                self.BendLength, self.BendWidth, 2, True, True)

        else:
            steel_vert_1 = steel_vert_2 = longit.shape_extend_steel(
                length=self.Height,
                extend=self.Length_TA,
                extend_side=2,
                vertical=True)

        point_f_1 = AllplanGeo.Point3D(0,
                                       self.HoriFrontCover + self.HoriSteelDia,
                                       0)
        point_t_1 = AllplanGeo.Point3D(self.Length,
                                       self.HoriFrontCover + self.HoriSteelDia,
                                       0)

        steel_list.append(
            LinearBarBuilder.create_linear_bar_placement_from_to_by_dist(
                0, steel_vert_1, point_f_1, point_t_1, self.VertSideCover,
                self.VertSideCover, self.VertDistance, 3))

        point_f_2 = AllplanGeo.Point3D(
            0, self.Width - self.HoriFrontCover - self.HoriSteelDia, 0)
        point_t_2 = AllplanGeo.Point3D(
            self.Length, self.Width - self.HoriFrontCover - self.HoriSteelDia,
            0)

        steel_list.append(
            LinearBarBuilder.create_linear_bar_placement_from_to_by_dist(
                0, steel_vert_2, point_f_2, point_t_2, self.VertSideCover,
                self.VertSideCover, self.VertDistance, 3))

        if steel_modify(self.Length, self.VertSteelDia, self.VertDistance,
                        self.VertSideCover, self.VertSideCover):
            point_f_3 = AllplanGeo.Point3D(0, 0, 0)
            point_t_3 = AllplanGeo.Point3D(self.Length, 0, 0)
            vec = AllplanGeo.Vector3D(
                AllplanGeo.Point3D(0, 0, 0),
                AllplanGeo.Point3D(self.VertDistance / 2, 0, 0))
            s_shape_1 = AllplanReinf.BendingShape(steel_vert_1)
            s_shape_1.Move(
                AllplanGeo.Vector3D(
                    AllplanGeo.Point3D(self.Length - self.VertSideCover,
                                       self.HoriFrontCover + self.HoriSteelDia,
                                       0)))
            s_shape_2 = AllplanReinf.BendingShape(steel_vert_2)
            s_shape_2.Move(
                AllplanGeo.Vector3D(
                    AllplanGeo.Point3D(
                        self.Length - self.VertSideCover,
                        self.Width - self.HoriFrontCover - self.HoriSteelDia,
                        0)))
            steel_list.append(
                AllplanReinf.BarPlacement(0, 1, vec, point_f_3, point_t_3,
                                          s_shape_1))
            steel_list.append(
                AllplanReinf.BarPlacement(0, 1, vec, point_f_3, point_t_3,
                                          s_shape_2))

        return steel_list
Exemple #13
0
    def create_horizontal_steel(self):
        steel_list = []

        cover = ConcreteCoverProperties.left_right(self.HoriSideCover,
                                                   self.HoriSideCover)
        rebar_prop = {
            'diameter': self.HoriSteelDia,
            'bending_roller': 0,
            'steel_grade': self.HoriSteelGrade,
            'concrete_grade': self.ConcreteGrade,
            'bending_shape_type': AllplanReinf.BendingShapeType.LongitudinalBar
        }

        longit = LongitudinalSteel(cover, rebar_prop)

        steel_hs1 = longit.shape_steel(self.Length)

        if not self.Degrees_HS2:
            steel_hs2_1 = steel_hs2_2 = longit.shape_extend_steel(
                self.Length, self.HoriExtend)
        else:
            steel_hs2_1 = longit.shape_hook_steel(self.Length,
                                                  self.DegreesHook_HS2,
                                                  hook_side=3,
                                                  left=self.LeftAnchor_HS2,
                                                  right=self.RightAnchor_HS2,
                                                  mirror=False)
            steel_hs2_2 = longit.shape_hook_steel(self.Length,
                                                  self.DegreesHook_HS2,
                                                  hook_side=3,
                                                  left=self.LeftAnchor_HS2,
                                                  right=self.RightAnchor_HS2,
                                                  mirror=True)

        point_f_1 = AllplanGeo.Point3D(0, 0, 0)
        point_t_1 = AllplanGeo.Point3D(0, 0, self.Height)

        lines = int((self.Height - self.HoriTopCover - self.HoriBottomCover -
                     self.HoriSteelDia) / self.HoriDistance)
        point_f = AllplanGeo.Point3D(0, 0, 0)
        point_t = AllplanGeo.Point3D(self.Length, self.Width, self.Height)
        vec = AllplanGeo.Vector3D(AllplanGeo.Point3D(0, 0, 0),
                                  AllplanGeo.Point3D(self.HoriDistance, 0, 0))
        distance = self.HoriBottomCover
        for x in range(lines + 1):

            if x % 3 != 0:
                s_shape_hs1_1 = AllplanReinf.BendingShape(steel_hs1)
                s_shape_hs1_1.Move(
                    AllplanGeo.Vector3D(
                        AllplanGeo.Point3D(0, self.HoriFrontCover, distance)))
                steel_list.append(
                    AllplanReinf.BarPlacement(0, 1, vec, point_f, point_t,
                                              s_shape_hs1_1))
                s_shape_hs1_2 = AllplanReinf.BendingShape(steel_hs1)
                s_shape_hs1_2.Move(
                    AllplanGeo.Vector3D(
                        AllplanGeo.Point3D(0, self.Width - self.HoriFrontCover,
                                           distance)))
                steel_list.append(
                    AllplanReinf.BarPlacement(0, 1, vec, point_f, point_t,
                                              s_shape_hs1_2))
            else:
                s_shape_hs2_1 = AllplanReinf.BendingShape(steel_hs2_1)
                s_shape_hs2_1.Move(
                    AllplanGeo.Vector3D(
                        AllplanGeo.Point3D(0, self.HoriFrontCover, distance)))
                steel_list.append(
                    AllplanReinf.BarPlacement(0, 1, vec, point_f, point_t,
                                              s_shape_hs2_1))
                s_shape_hs2_2 = AllplanReinf.BendingShape(steel_hs2_2)
                s_shape_hs2_2.Move(
                    AllplanGeo.Vector3D(
                        AllplanGeo.Point3D(0, self.Width - self.HoriFrontCover,
                                           distance)))
                steel_list.append(
                    AllplanReinf.BarPlacement(0, 1, vec, point_f, point_t,
                                              s_shape_hs2_2))
            distance += self.HoriDistance

        if steel_modify(self.Height, self.HoriSteelDia, self.HoriDistance,
                        self.HoriBottomCover, self.HoriTopCover):
            if (lines + 1) % 3 != 0:
                s_shape_hs1_1 = AllplanReinf.BendingShape(steel_hs1)
                s_shape_hs1_1.Move(
                    AllplanGeo.Vector3D(
                        AllplanGeo.Point3D(0, self.HoriFrontCover,
                                           self.Height - self.HoriTopCover)))
                steel_list.append(
                    AllplanReinf.BarPlacement(0, 1, vec, point_f, point_t,
                                              s_shape_hs1_1))
                s_shape_hs1_2 = AllplanReinf.BendingShape(steel_hs1)
                s_shape_hs1_2.Move(
                    AllplanGeo.Vector3D(
                        AllplanGeo.Point3D(0, self.Width - self.HoriFrontCover,
                                           self.Height - self.HoriTopCover)))
                steel_list.append(
                    AllplanReinf.BarPlacement(0, 1, vec, point_f, point_t,
                                              s_shape_hs1_2))
            else:
                s_shape_hs2_1 = AllplanReinf.BendingShape(steel_hs2_1)
                s_shape_hs2_1.Move(
                    AllplanGeo.Vector3D(
                        AllplanGeo.Point3D(0, self.HoriFrontCover,
                                           self.Height - self.HoriTopCover)))
                steel_list.append(
                    AllplanReinf.BarPlacement(0, 1, vec, point_f, point_t,
                                              s_shape_hs2_1))
                s_shape_hs2_2 = AllplanReinf.BendingShape(steel_hs2_2)
                s_shape_hs2_2.Move(
                    AllplanGeo.Vector3D(
                        AllplanGeo.Point3D(0, self.Width - self.HoriFrontCover,
                                           self.Height - self.HoriTopCover)))
                steel_list.append(
                    AllplanReinf.BarPlacement(0, 1, vec, point_f, point_t,
                                              s_shape_hs2_2))

        return steel_list
    def __create_model_element__(self, input_pnt):
        """
         Creates the element
         Args:
            input_pnt:   input point

         Returns:
            Elementlist
         """
        if len(self.points) < 1:
            return

        if self.b_use_input_pnt == False:
            #calc only without mouse movement, this means for create
            self.polyline_lenght = 0.0
            for index in range(1, len(self.points)):
                line_tmp = AllplanGeo.Line3D(self.points[index - 1],
                                             self.points[index])
                self.polyline_lenght += AllplanGeo.CalcLength(line_tmp)

        if len(self.points) == 1:
            if self.b_use_input_pnt == False:
                self.model_ele_list = []
                return

            line = AllplanGeo.Line3D(self.points[0], input_pnt)
            self.model_ele_list = [
                AllplanBasisElements.ModelElement3D(self.com_prop, line)
            ]
            return

        if len(self.points) >= 2:  # polyline could be created
            polygon = AllplanGeo.Polyline3D()
            for point in self.points:
                polygon += point

            if self.b_use_input_pnt == True:
                polygon += input_pnt

        if self.frist_run_transf == True:
            #prepare polygon for being a DRYWALL
            #self.cont_polyline = AllplanGeo.Polyhedron3D.CreateCuboid()

            #self.wall1_thickness
            #self.wall2_thickness
            #self.wall3_thickness
            #self.wall4_thickness
            #2
            #self.wall1_type
            #self.wall2_type
            #self.wall3_type
            #self.wall4_type
            #3
            #self.midWidth
            #self.height

            lenght = 1000
            width = 500
            base_pnt = AllplanGeo.Point3D()
            base_pnt.X -= lenght / 2
            base_pnt.Y -= width / 2

            polyline3D_contur = AllplanGeo.Polyline3D()
            polyline3D_contur += base_pnt
            polyline3D_contur += AllplanGeo.Point3D(base_pnt.X + lenght,
                                                    base_pnt.Y, base_pnt.Z)
            polyline3D_contur += AllplanGeo.Point3D(base_pnt.X + lenght,
                                                    base_pnt.Y + width,
                                                    base_pnt.Z)
            polyline3D_contur += AllplanGeo.Point3D(base_pnt.X,
                                                    base_pnt.Y + width,
                                                    base_pnt.Z)
            polyline3D_contur += base_pnt

            self.frist_run_transf = False
            self.cont_polyline = self.__transform_base_polygon__(
                polygon, polyline3D_contur)

        if not self.cont_polyline.IsValid():
            return

        print("path polygon = ", ' ', polygon)
        objlist = AllplanGeo.Polyline3DList()
        objlist.append(self.cont_polyline)

        vector = AllplanGeo.Vector3D()
        err, polyhedron = AllplanGeo.CreateSweptPolyhedron3D(
            objlist, polygon, True, True, vector)

        if not GeometryValidate.polyhedron(err):
            elems = []
            elems.append(
                AllplanBasisElements.ModelElement3D(self.com_prop, polygon))
            elems[-1].SetAttributes(
                self.create_attribute_list(self.polyline_lenght))
            self.model_ele_list = elems
            return

        elems = []
        elems.append(
            AllplanBasisElements.ModelElement3D(self.com_prop, polyhedron))
        elems[-1].SetAttributes(
            self.create_attribute_list(self.polyline_lenght))
        self.model_ele_list = elems
        return