Fix for #1: Countersink Head angle vs nominal size #12
@ -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",
|
||||
|
@ -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
|
||||
)
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user
I certainly applaud your research and initiative, but my concern is “the best thing about standards is there are so many to choose from.” Would there be a reason this couldn’t be an additional parameter in the GUI? I would love if the default value changed according to the shank diameter, but based on my own previous experimentation, I expect this may be a taller order. I expect other standards bodies will declare other counter sink angles in their own ecosystems parameterized off other cutoff values.
Yep, I hear what you are saying....
Indeed that wold be best. Having had a look this it will touch some of the same lines already touched in #10 & #11. To do a complete job the new angle should make it into the presets too.
How would I do it:
3a) Make new property appear in the GUI draw() function adding "col.prop(self, 'bf_CounterSink_Head_Angle')"
I understand GIT can manage this, but can I....
Less scary to wait until those other changes are on main. Then I can "rebase main" to avoid conflicts.
@linux_dr Did yo find this documentation page?: https://docs.blender.org/api/current/bpy.props.html