Fix for #1: Countersink Head angle vs nominal size #12

Open
sw-tya wants to merge 3 commits from sw-tya/add_mesh_BoltFactory:swtya_CounterSinkHead into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Showing only changes of commit 1e6c3a0064 - Show all commits

View File

@ -788,8 +788,14 @@ 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 the head angle changes.
# Note, this is not suitable for cheating a rivet - due to a different angle, see ISO 1051.
# The input arg of HEIGHT is not passed from the GUI, it must be created here:
if SHANK_DIA < 21:

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.

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....

"Would there be a reason this couldn’t"

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:

  1. Update Create_CounterSink_Head() so the not used HEIGHT becomes the HEAD_ANGLE.
  2. My new lines get scrubbed and the HEAD_ANGLE is used to make the height.
  3. Define a new property "props.bf_CounterSink_Head_Angle" in the class add_mesh_bolt.
    3a) Make new property appear in the GUI draw() function adding "col.prop(self, 'bf_CounterSink_Head_Angle')"
  4. Pass that new property via Bolt_Mesh()
  5. For each of the preset files add the required angle property.

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.

Yep, I hear what you are saying.... >> "Would there be a reason this couldn’t" 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: 1) Update Create_CounterSink_Head() so the not used HEIGHT becomes the HEAD_ANGLE. 2) My new lines get scrubbed and the HEAD_ANGLE is used to make the height. 3) Define a new property "props.bf_CounterSink_Head_Angle" in the class add_mesh_bolt. 3a) Make new property appear in the GUI draw() function adding "col.prop(self, 'bf_CounterSink_Head_Angle')" 4) Pass that new property via Bolt_Mesh() 5) For each of the preset files add the required angle property. 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.

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.

@linux_dr Did yo find this documentation page?: https://docs.blender.org/api/current/bpy.props.html

def update_func(self, context):
    print("my test function", self)
bpy.types.Scene.testprop = bpy.props.FloatProperty(update=update_func)
> 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. @linux_dr Did yo find this documentation page?: [https://docs.blender.org/api/current/bpy.props.html](https://docs.blender.org/api/current/bpy.props.html#update-example) ``` def update_func(self, context): print("my test function", self) bpy.types.Scene.testprop = bpy.props.FloatProperty(update=update_func) ```
HEIGHT = tan(radians(45)) * (HEAD_RADIUS - SHANK_RADIUS) + RAD1
else:
HEIGHT = tan(radians(60)) * (HEAD_RADIUS - SHANK_RADIUS) + RAD1
FaceStart = len(verts)