diff --git a/source/Boltfactory.py b/source/Boltfactory.py index 5c3c99f..cb73eb9 100644 --- a/source/Boltfactory.py +++ b/source/Boltfactory.py @@ -188,6 +188,14 @@ class add_mesh_bolt(Operator, AddObjectHelper): description='Diameter of the Counter Sink Head', unit='LENGTH', ) + bf_CounterSink_Head_Angle: FloatProperty( + attr='bf_CounterSink_Head_Angle', + name='Head angle', default=1.5708, + min=0.5, soft_min=2.62, + max=2.62, + description='Included Angle of the Counter Sink Head', + unit='ROTATION', + ) bf_Cap_Head_Height: FloatProperty( attr='bf_Cap_Head_Height', name='Head Height', default=3 * createMesh.GLOBAL_SCALE, @@ -369,6 +377,7 @@ class add_mesh_bolt(Operator, AddObjectHelper): col.prop(self, 'bf_Pan_Head_Dia') elif self.bf_Head_Type == 'bf_Head_CounterSink': col.prop(self, 'bf_CounterSink_Head_Dia') + col.prop(self, 'bf_CounterSink_Head_Angle') col.separator() # Shank if self.bf_Model_Type == 'bf_Model_Bolt': @@ -524,6 +533,7 @@ def BoltParameters(): "bf_Hex_Head_Height", "bf_Hex_Head_Flat_Distance", "bf_CounterSink_Head_Dia", + "bf_CounterSink_Head_Angle", "bf_Cap_Head_Height", "bf_Cap_Head_Dia", "bf_Dome_Head_Dia", diff --git a/source/createMesh.py b/source/createMesh.py index 8d0fa5c..5522461 100644 --- a/source/createMesh.py +++ b/source/createMesh.py @@ -778,7 +778,7 @@ def Create_Dome_Head(HOLE_DIA, HEAD_DIA, SHANK_DIA, HEIGHT, RAD1, RAD2, FACE_OFF return sVerts, faces, Dome_Height -def Create_CounterSink_Head(HOLE_DIA, HEAD_DIA, SHANK_DIA, HEIGHT, RAD1, DIV_COUNT): +def Create_CounterSink_Head(HOLE_DIA, HEAD_DIA, SHANK_DIA, HEAD_ANGLE, RAD1, DIV_COUNT): HOLE_RADIUS = HOLE_DIA * 0.5 HEAD_RADIUS = HEAD_DIA * 0.5 @@ -788,8 +788,9 @@ def Create_CounterSink_Head(HOLE_DIA, HEAD_DIA, SHANK_DIA, HEIGHT, RAD1, DIV_COU faces = [] Row = 0 - # HEAD_RADIUS = (HEIGHT/tan(radians(60))) + SHANK_RADIUS - HEIGHT = tan(radians(60)) * (HEAD_RADIUS - SHANK_RADIUS) + # As per ISO 10642 the angle of the head is not constant with nominal diameter. + # Between 20 and 22mm shank the head angle changes 90 to 60. + HEIGHT = tan((1.5708 - HEAD_ANGLE / 2.0)) * (HEAD_RADIUS - SHANK_RADIUS) + RAD1 FaceStart = len(verts) @@ -2418,7 +2419,7 @@ def Bolt_Mesh(props, context): elif props.bf_Head_Type == 'bf_Head_CounterSink': Head_Verts, Head_Faces, Head_Height = Create_CounterSink_Head( Bit_Dia, props.bf_CounterSink_Head_Dia / GLOBAL_SCALE, - props.bf_Shank_Dia / GLOBAL_SCALE, props.bf_CounterSink_Head_Dia / GLOBAL_SCALE, + props.bf_Shank_Dia / GLOBAL_SCALE, props.bf_CounterSink_Head_Angle, props.bf_CounterSink_Head_Dia / GLOBAL_SCALE * (0.09 / 6.31), props.bf_Div_Count ) diff --git a/source/presets/operator/mesh.bolt_add/_default.py b/source/presets/operator/mesh.bolt_add/_default.py index f0f29de..8902af0 100644 --- a/source/presets/operator/mesh.bolt_add/_default.py +++ b/source/presets/operator/mesh.bolt_add/_default.py @@ -18,6 +18,7 @@ op.bf_12_Point_Head_Height = 3.0 / 1000.0 op.bf_12_Point_Head_Flat_Distance = 3.0 / 1000.0 op.bf_12_Point_Head_Flange_Dia = 5.72 / 1000.0 op.bf_CounterSink_Head_Dia = 6.300000190734863 / 1000.0 +op.bf_CounterSink_Head_Angle = 1.5708 op.bf_Cap_Head_Height = 3.0 / 1000.0 op.bf_Cap_Head_Dia = 5.5 / 1000.0 op.bf_Dome_Head_Dia = 5.599999904632568 / 1000.0 diff --git a/source/presets/operator/mesh.bolt_add/_m3.py b/source/presets/operator/mesh.bolt_add/_m3.py index f0f29de..8902af0 100644 --- a/source/presets/operator/mesh.bolt_add/_m3.py +++ b/source/presets/operator/mesh.bolt_add/_m3.py @@ -18,6 +18,7 @@ op.bf_12_Point_Head_Height = 3.0 / 1000.0 op.bf_12_Point_Head_Flat_Distance = 3.0 / 1000.0 op.bf_12_Point_Head_Flange_Dia = 5.72 / 1000.0 op.bf_CounterSink_Head_Dia = 6.300000190734863 / 1000.0 +op.bf_CounterSink_Head_Angle = 1.5708 op.bf_Cap_Head_Height = 3.0 / 1000.0 op.bf_Cap_Head_Dia = 5.5 / 1000.0 op.bf_Dome_Head_Dia = 5.599999904632568 / 1000.0 diff --git a/source/presets/operator/mesh.bolt_add/_m4.py b/source/presets/operator/mesh.bolt_add/_m4.py index 8513f9f..aa7548b 100644 --- a/source/presets/operator/mesh.bolt_add/_m4.py +++ b/source/presets/operator/mesh.bolt_add/_m4.py @@ -18,6 +18,7 @@ op.bf_12_Point_Head_Height = 4.0 / 1000.0 op.bf_12_Point_Head_Flat_Distance = 4.0 / 1000.0 op.bf_12_Point_Head_Flange_Dia = 7.22 / 1000.0 op.bf_CounterSink_Head_Dia = 9.399999618530273 / 1000.0 +op.bf_CounterSink_Head_Angle = 1.5708 op.bf_Cap_Head_Height = 4.0 / 1000.0 op.bf_Cap_Head_Dia = 7.0 / 1000.0 op.bf_Dome_Head_Dia = 8.0 / 1000.0 diff --git a/source/presets/operator/mesh.bolt_add/_m5.py b/source/presets/operator/mesh.bolt_add/_m5.py index 1a43a52..62e3917 100644 --- a/source/presets/operator/mesh.bolt_add/_m5.py +++ b/source/presets/operator/mesh.bolt_add/_m5.py @@ -18,6 +18,7 @@ op.bf_12_Point_Head_Height = 5.0 / 1000.0 op.bf_12_Point_Head_Flat_Distance = 5.0 / 1000.0 op.bf_12_Point_Head_Flange_Dia = 8.72 / 1000.0 op.bf_CounterSink_Head_Dia = 10.399999618530273 / 1000.0 +op.bf_CounterSink_Head_Angle = 1.5708 op.bf_Cap_Head_Height = 5.0 / 1000.0 op.bf_Cap_Head_Dia = 8.5 / 1000.0 op.bf_Dome_Head_Dia = 9.5 / 1000.0 diff --git a/source/presets/operator/mesh.bolt_add/_m6.py b/source/presets/operator/mesh.bolt_add/_m6.py index 33d82d7..4587d59 100644 --- a/source/presets/operator/mesh.bolt_add/_m6.py +++ b/source/presets/operator/mesh.bolt_add/_m6.py @@ -18,6 +18,7 @@ op.bf_12_Point_Head_Height = 6.0 / 1000.0 op.bf_12_Point_Head_Flat_Distance = 6.0 / 1000.0 op.bf_12_Point_Head_Flange_Dia = 10.22 / 1000.0 op.bf_CounterSink_Head_Dia = 12.600000381469727 / 1000.0 +op.bf_CounterSink_Head_Angle = 1.5708 op.bf_Cap_Head_Height = 6.0 / 1000.0 op.bf_Cap_Head_Dia = 10.0 / 1000.0 op.bf_Dome_Head_Dia = 12.0 / 1000.0 diff --git a/source/presets/operator/mesh.bolt_add/_m8.py b/source/presets/operator/mesh.bolt_add/_m8.py index 8f7bb49..dac570c 100644 --- a/source/presets/operator/mesh.bolt_add/_m8.py +++ b/source/presets/operator/mesh.bolt_add/_m8.py @@ -18,6 +18,7 @@ op.bf_12_Point_Head_Height = 8.0 / 1000.0 op.bf_12_Point_Head_Flat_Distance = 8.0 / 1000.0 op.bf_12_Point_Head_Flange_Dia = 13.27 / 1000.0 op.bf_CounterSink_Head_Dia = 17.299999237060547 / 1000.0 +op.bf_CounterSink_Head_Angle = 1.5708 op.bf_Cap_Head_Height = 8.0 / 1000.0 op.bf_Cap_Head_Dia = 13.5 / 1000.0 op.bf_Dome_Head_Dia = 16.0 / 1000.0 diff --git a/source/presets/operator/mesh.bolt_add/m10.py b/source/presets/operator/mesh.bolt_add/m10.py index faf892a..fbe9ba7 100644 --- a/source/presets/operator/mesh.bolt_add/m10.py +++ b/source/presets/operator/mesh.bolt_add/m10.py @@ -18,6 +18,7 @@ op.bf_12_Point_Head_Height = 10.0 / 1000.0 op.bf_12_Point_Head_Flat_Distance = 10.0 / 1000.0 op.bf_12_Point_Head_Flange_Dia = 16.27 / 1000.0 op.bf_CounterSink_Head_Dia = 20.0 / 1000.0 +op.bf_CounterSink_Head_Angle = 1.5708 op.bf_Cap_Head_Height = 10.0 / 1000.0 op.bf_Cap_Head_Dia = 16.0 / 1000.0 op.bf_Dome_Head_Dia = 20.0 / 1000.0 diff --git a/source/presets/operator/mesh.bolt_add/m12.py b/source/presets/operator/mesh.bolt_add/m12.py index 8ffc693..43e6816 100644 --- a/source/presets/operator/mesh.bolt_add/m12.py +++ b/source/presets/operator/mesh.bolt_add/m12.py @@ -18,6 +18,7 @@ op.bf_12_Point_Head_Height = 12.0 / 1000.0 op.bf_12_Point_Head_Flat_Distance = 12.0 / 1000.0 op.bf_12_Point_Head_Flange_Dia = 18.27 / 1000.0 op.bf_CounterSink_Head_Dia = 22.0 / 1000.0 +op.bf_CounterSink_Head_Angle = 1.5708 op.bf_Cap_Head_Height = 12.0 / 1000.0 op.bf_Cap_Head_Dia = 18.5 / 1000.0 op.bf_Dome_Head_Dia = 24.0 / 1000.0