40 def getpointsOfStirrup(FacePRM, l_cover, r_cover, t_cover, b_cover, bentAngle, bentFactor, diameter, rounding, facenormal):
41 """ getpointsOfStirrup(FacePRM, LeftCover, RightCover, TopCover, BottomCover, BentAngle, BentFactor, Diameter, Rounding, FaceNormal): 42 Return the coordinates points of the Stirrup in the form of array.""" 43 angle = 180 - bentAngle
46 if round(facenormal[0])
in {1,-1}:
48 y1 = FacePRM[1][1] - FacePRM[0][0] / 2 + l_cover
49 z1 = FacePRM[1][2] + FacePRM[0][1] / 2 - t_cover + tangent_part_length
50 y2 = FacePRM[1][1] - FacePRM[0][0] / 2 + l_cover
51 z2 = FacePRM[1][2] - FacePRM[0][1] / 2 + b_cover
52 y3 = FacePRM[1][1] + FacePRM[0][0] / 2 - r_cover
53 z3 = FacePRM[1][2] - FacePRM[0][1] / 2 + b_cover
54 y4 = FacePRM[1][1] + FacePRM[0][0] / 2 - r_cover
55 z4 = FacePRM[1][2] + FacePRM[0][1] / 2 - t_cover
56 y5 = FacePRM[1][1] - FacePRM[0][0] / 2 + l_cover - tangent_part_length
57 z5 = FacePRM[1][2] + FacePRM[0][1] / 2 - t_cover
58 side_length = abs(y5 - y4) - tangent_part_length
59 normal_dis = (diameter * (side_length + tangent_part_length)) / side_length
60 x2 = x1 - normal_dis / 4
61 x3 = x2 - normal_dis / 4
62 x4 = x3 - normal_dis / 4
63 x5 = x4 - normal_dis / 4
64 x0 = x1 + normal_dis / 4
65 y0 = y1 + (tangent_length + bentFactor * diameter) * math.sin(math.radians(angle))
66 z0 = z1 - (tangent_length + bentFactor * diameter) * math.cos(math.radians(angle))
67 x6 = x5 - normal_dis / 4
68 y6 = y5 + (tangent_length + bentFactor * diameter) * math.sin(math.radians(90 - angle))
69 z6 = z5 - (tangent_length + bentFactor * diameter) * math.cos(math.radians(90 - angle))
70 elif round(facenormal[1])
in {1,-1}:
71 x1 = FacePRM[1][0] - FacePRM[0][0] / 2 + l_cover
73 z1 = FacePRM[1][2] + FacePRM[0][1] / 2 - t_cover + tangent_part_length
74 x2 = FacePRM[1][0] - FacePRM[0][0] / 2 + l_cover
75 z2 = FacePRM[1][2] - FacePRM[0][1] / 2 + b_cover
76 x3 = FacePRM[1][0] + FacePRM[0][0] / 2 - r_cover
77 z3 = FacePRM[1][2] - FacePRM[0][1] / 2 + b_cover
78 x4 = FacePRM[1][0] + FacePRM[0][0] / 2 - r_cover
79 z4 = FacePRM[1][2] + FacePRM[0][1] / 2 - t_cover
80 x5 = FacePRM[1][0] - FacePRM[0][0] / 2 + l_cover - tangent_part_length
81 z5 = FacePRM[1][2] + FacePRM[0][1] / 2 - t_cover
82 side_length = abs(x5 - x4) - tangent_part_length
83 normal_dis = (diameter * (side_length + tangent_part_length)) / side_length
84 y2 = y1 - normal_dis / 4
85 y3 = y2 - normal_dis / 4
86 y4 = y3 - normal_dis / 4
87 y5 = y4 - normal_dis / 4
88 y0 = y1 + normal_dis / 4
89 x0 = x1 + (tangent_length + bentFactor * diameter) * math.sin(math.radians(angle))
90 z0 = z1 - (tangent_length + bentFactor * diameter) * math.cos(math.radians(angle))
91 x6 = x5 + (tangent_length + bentFactor * diameter) * math.sin(math.radians(90 - angle))
92 y6 = y5 - normal_dis / 4
93 z6 = z5 - (tangent_length + bentFactor * diameter) * math.cos(math.radians(90 - angle))
94 elif round(facenormal[2])
in {1,-1}:
95 x1 = FacePRM[1][0] - FacePRM[0][0] / 2 + l_cover
96 y1 = FacePRM[1][1] + FacePRM[0][1] / 2 - t_cover + tangent_part_length
98 x2 = FacePRM[1][0] - FacePRM[0][0] / 2 + l_cover
99 y2 = FacePRM[1][1] - FacePRM[0][1] / 2 + b_cover
100 x3 = FacePRM[1][0] + FacePRM[0][0] / 2 - r_cover
101 y3 = FacePRM[1][1] - FacePRM[0][1] / 2 + b_cover
102 x4 = FacePRM[1][0] + FacePRM[0][0] / 2 - r_cover
103 y4 = FacePRM[1][1] + FacePRM[0][1] / 2 - t_cover
104 x5 = FacePRM[1][0] - FacePRM[0][0] / 2 + l_cover - tangent_part_length
105 y5 = FacePRM[1][1] + FacePRM[0][1] / 2 - t_cover
106 side_length = abs(x5 - x4) - tangent_part_length
107 normal_dis = (diameter * (side_length + tangent_part_length)) / side_length
108 z2 = z1 - normal_dis / 4
109 z3 = z2 - normal_dis / 4
110 z4 = z3 - normal_dis / 4
111 z5 = z4 - normal_dis / 4
112 z0 = z1 + normal_dis / 4
113 x0 = x1 + (tangent_length + bentFactor * diameter) * math.sin(math.radians(angle))
114 y0 = y1 - (tangent_length + bentFactor * diameter) * math.cos(math.radians(angle))
115 x6 = x5 + (tangent_length + bentFactor * diameter) * math.sin(math.radians(90 - angle))
116 y6 = y5 - (tangent_length + bentFactor * diameter) * math.cos(math.radians(90 - angle))
117 z6 = z5 - normal_dis / 4
118 return [FreeCAD.Vector(x0, y0, z0), FreeCAD.Vector(x1, y1, z1),\
119 FreeCAD.Vector(x2, y2, z2), FreeCAD.Vector(x3, y3, z3),\
120 FreeCAD.Vector(x4, y4, z4), FreeCAD.Vector(x5, y5, z5),\
121 FreeCAD.Vector(x6, y6, z6)]
def extendedTangentLength(rounding, diameter, angle)
def getpointsOfStirrup(FacePRM, l_cover, r_cover, t_cover, b_cover, bentAngle, bentFactor, diameter, rounding, facenormal)
def extendedTangentPartLength(rounding, diameter, angle)