Skip to content

Commit

Permalink
Merge pull request #223 from alexneufeld/din603
Browse files Browse the repository at this point in the history
add Din603 mushroom-head square-neck bolts
  • Loading branch information
shaise committed Oct 24, 2022
2 parents 93e28ad + 19c88ea commit 6be7a55
Show file tree
Hide file tree
Showing 8 changed files with 182 additions and 19 deletions.
2 changes: 2 additions & 0 deletions FastenersCmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@
"GOST1144-3": (translate("FastenerCmd", "GOST 1144 (Type 3) Half — round head wood screw"), HCrossGroup, ScrewParametersLC),
"GOST1144-4": (translate("FastenerCmd", "GOST 1144 (Type 4) Half — round head wood screw"), HCrossGroup, ScrewParametersLC),

"DIN603": (translate("FastenerCmd", "DIN 603 Mushroom head square neck bolts"), OtherHeadGroup, ScrewParametersLC),

"ISO4032": (translate("FastenerCmd", "ISO 4032 Hexagon nuts, Style 1"), NutGroup, NutParameters),
"ISO4033": (translate("FastenerCmd", "ISO 4033 Hexagon nuts, Style 2"), NutGroup, NutParameters),
"ISO4035": (translate("FastenerCmd", "ISO 4035 Hexagon thin nuts, chamfered"), NutGroup, NutParameters),
Expand Down
9 changes: 9 additions & 0 deletions FsData/din603def.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"DIN603def"
"Dia","P","b1","b2","b3","dk_max","dk_min","ds_max","ds_min","f_max","f_min","k_max","k_min","r1_approx","r2_max","r2_max","v_max","v_min"
"M5",0.8,16,22,22,13.55,12.45,5,4.52,4.1,2.9,3.3,2.7,10.7,0.5,0.75,5.48,4.52
"M6",1,18,24,24,16.55,15.45,6,5.52,4.6,3.4,3.88,3.12,12.6,0.5,0.9,6.48,5.52
"M8",1.25,22,28,41,20.65,19.35,8,7.42,5.6,4.4,4.88,4.12,16,0.5,1.2,8.58,7.42
"M10",1.5,26,32,45,24.65,23.35,10,9.42,6.6,5.4,5.38,4.62,19.2,0.5,1.5,10.58,9.42
"M12",1.75,30,36,49,30.65,29.35,12,11.3,8.75,7.25,6.95,6.05,24.1,1,1.8,12.7,11.3
"M16",2,38,44,57,38.8,37.2,16,15.3,12.9,11.1,8.95,8.05,29.3,1,2.4,16.7,15.3
"M20",2.5,46,52,65,46.8,45.2,20,19.16,15.9,14.1,11.05,9.95,33.9,1,3,20.84,19.16
25 changes: 25 additions & 0 deletions FsData/din603length.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"DIN603length"
"Nominal","Min","Max"
"16",15.1,16.9
"20",18.95,21.05
"25",23.95,26.05
"30",28.95,31.05
"35",33.75,36.25
"40",38.75,41.25
"45",43.75,46.25
"50",48.75,51.25
"55",53.5,56.5
"60",58.5,61.5
"65",63.5,66.5
"70",68.5,71.5
"80",78.5,81.5
"90",88.25,91.75
"100",98.25,101.75
"110",108.25,111.75
"120",118.25,121.75
"130",128,132
"140",138,142
"150",148,152
"160",156,164
"180",176,184
"200",195.4,204.6
9 changes: 9 additions & 0 deletions FsData/din603range.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"DIN603range"
"Dia","Min_L","Max_L"
"M5","16","80"
"M6","16","150"
"M8","20","150"
"M10","20","200"
"M12","30","200"
"M16","55","200"
"M20","70","200"
79 changes: 61 additions & 18 deletions FsFunctions/FSmakeCarriageBolt.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,56 @@
import FastenerBase

# ASMEB18.5.2 UNC Round head square neck bolts
# DIN603 Mushroom head square neck bolts
cos22_5 = math.cos(math.radians(22.5))
sin22_5 = math.sin(math.radians(22.5))
sqrt2 = math.sqrt(2)

def makeCarriageBolt(self, fa): # dynamically loaded method of class Screw

def makeCarriageBolt(self, fa): # dynamically loaded method of class Screw
SType = fa.type
l = fa.calc_len
length = fa.calc_len
d = self.getDia(fa.calc_diam, False)
if SType == 'ASMEB18.5.2':
tpi, _, A, H, O, P, _, _ = fa.dimTable
A, H, O, P = (25.4 * x for x in (A, H, O, P))
pitch = 25.4 / tpi
if l <= 152.4:
if length <= 152.4:
L_t = d * 2 + 6.35
else:
L_t = d * 2 + 12.7

elif SType == 'DIN603':
pitch, b1, b2, b3, dk_max, dk_min, ds_max, ds_min, f_max, f_min, \
k_max, k_min, r1_approx, r2_max, r2_max, v_max, v_min = fa.dimTable
A = (dk_max+dk_min)/2
H = k_max
O = v_max
P = f_max
if length <= 125:
L_t = b1
elif (125 < length) and (length <= 200):
L_t = b2
else: # len > 200
L_t = b3
head_r = A / sqrt2
flat_len = l - P
flat_len = length - P

# create a profile for head generation. Basially when this profile revolves we get the head solid
# FSFaceMaker is a nice helper to build a profile from lines and arcs it make a profile on the x,z plane
# create a profile for head generation.
# Basially when this profile revolves we get the head solid
# FSFaceMaker is a nice helper to build a profile from lines and arcs.
# It make a profile on the x,z plane
fm = FastenerBase.FSFaceMaker()
fm.AddPoint(0, H)
fm.AddArc(head_r * sin22_5, H - head_r + head_r * cos22_5, A / 2, 0) # arcs are 3 point arcs where the first point is the last added
r_fillet = d * 0.05
# angle for determining an approximate fillet at the outer edge
theta = math.pi / 4
fm.AddArc(
head_r * math.sin(theta / 2),
head_r * math.cos(theta / 2) - head_r + H,
A / 2 - r_fillet + r_fillet * math.sin(theta),
r_fillet * (1 + math.cos(theta)),
)
fm.AddArc(A / 2, r_fillet, A / 2 - r_fillet, 0)
fm.AddPoint(sqrt2 / 2 * O, 0)
fm.AddPoint(sqrt2 / 2 * O, -1 * P + (sqrt2 / 2 * O - d / 2))
fm.AddPoint(d / 2, -1 * P)
Expand All @@ -64,23 +89,41 @@ def makeCarriageBolt(self, fa): # dynamically loaded method of class Screw
fm.Reset()
fm.AddPoint(d / 2, -1 * P)
if (flat_len > L_t):
fm.AddPoint(d / 2, -l + L_t)
fm.AddPoint(d / 2, -l + d / 10)
fm.AddPoint(d / 2 - d / 10, -l)
fm.AddPoint(0, -l)
fm.AddPoint(d / 2, -length + L_t)
fm.AddPoint(d / 2, -length + d / 10)
fm.AddPoint(d / 2 - d / 10, -length)
fm.AddPoint(0, -length)
thread_profile_wire = fm.GetWire()
shell_thread = self.RevolveZ(thread_profile_wire)
else:
# modeled threaded section
shell_thread = self.makeShellthread(d, pitch, flat_len, False, -P, L_t)
shell_thread = self.makeShellthread(d, pitch, flat_len, True, -P, L_t)
p_shell = Part.Shell(head_shell.Faces + shell_thread.Faces)
p_solid = Part.Solid(p_shell)
# cut 4 flats under the head
d_mod = d + 0.0002
outerBox = Part.makeBox(A * 4, A * 4, P + 0.0001, Base.Vector(-A * 2, -A * 2, -P + 0.0001))
innerBox = Part.makeBox(d_mod, d_mod, P * 3, Base.Vector(-d_mod / 2, -d_mod / 2, -P * 2))
outerBox = Part.makeBox(
A * 4,
A * 4,
P + 0.0001,
Base.Vector(-A * 2, -A * 2, -P + 0.0001)
)
innerBox = Part.makeBox(
d_mod,
d_mod,
P * 3,
Base.Vector(-d_mod / 2, -d_mod / 2, -P * 2)
)
# add fillets to the square cutting tool
edgelist = innerBox.Edges
edges_to_fillet = []
for edge in edgelist:
if (
abs(abs(edge.CenterOfMass.x) - d_mod / 2) < 0.0001 and
abs(abs(edge.CenterOfMass.y) - d_mod / 2) < 0.0001
):
edges_to_fillet.append(edge)
innerBox = innerBox.makeFillet(d * 0.08, edges_to_fillet)
tool = outerBox.cut(innerBox)
p_solid = p_solid.cut(tool)
# removeSplitter is equivalent to the 'Refine' option for FreeCAD PartDesign objects
# return p_solid.removeSplitter()
return p_solid # not refining so thread location will be visible when not using real thread
return p_solid
2 changes: 1 addition & 1 deletion FsFunctions/FSmakeNylocNut.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from screw_maker import *
import FastenerBase

# ASMEB18.5.2 UNC Round head square neck bolts
# DIN985 Nyloc Nuts

tan30 = math.tan(math.radians(30.0))

Expand Down
74 changes: 74 additions & 0 deletions Icons/DIN603.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions ScrewMaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
'ISO14584': ("Screw", "makeCountersunkHeadScrew"),#
'DIN7984': ("Screw", "makeCylinderHeadScrew"),
'DIN6912': ("Screw", "makeCylinderHeadScrew"),
'DIN603': ("Screw", "makeCarriageBolt"),
'DIN571': ("Screw", "makeWoodScrew"),
'DIN96': ("Screw", "makeWoodScrew"),
'GOST1144-1': ("Screw", "makeWoodScrew"),
Expand Down

0 comments on commit 6be7a55

Please sign in to comment.