Skip to content

Commit fe1385e

Browse files
authored
Merge pull request #406 from UR-0/master
If global constants are defined, use them
2 parents 5e44715 + 5915acb commit fe1385e

29 files changed

+105
-115
lines changed

FsFunctions/FSmakeAllMetalFlangedLockNut.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,21 @@ def makeAllMetalFlangedLockNut(self, fa):
4646
# flange of the hex
4747
fm = FSFaceMaker()
4848
fm.AddPoint((1.05 * dia + s) / 4, 0.0)
49-
fm.AddPoint((dc + math.sqrt(3) * c) / 2, 0.0)
49+
fm.AddPoint((dc + sqrt3 * c) / 2, 0.0)
5050
fm.AddPoint((dc - c) / 2, 0.0)
5151
fm.AddArc2(0, c / 2, 150)
5252
fm.AddPoint(
5353
(1.05 * dia + s) / 4,
54-
math.sqrt(3)
54+
sqrt3
5555
/ 3
56-
* ((dc - c) / 2 + c / (4 - 2 * math.sqrt(3)) - (1.05 * dia + s) / 4),
56+
* ((dc - c) / 2 + c / (4 - 2 * sqrt3) - (1.05 * dia + s) / 4),
5757
)
5858
flange = self.RevolveZ(fm.GetFace())
5959
shape = shape.fuse(flange).removeSplitter()
6060
# internal bore
6161
fm.Reset()
6262
id = self.GetInnerThreadMinDiameter(dia, P, 0.0)
63-
bore_cham_ht = (dia * 1.05 - id) / 2 * math.tan(math.radians(15))
63+
bore_cham_ht = (dia * 1.05 - id) / 2 * tan15
6464
fm.AddPoint(0.0, 0.0)
6565
fm.AddPoint(dia * 1.05 / 2, 0.0)
6666
fm.AddPoint(id / 2, bore_cham_ht)
@@ -71,9 +71,9 @@ def makeAllMetalFlangedLockNut(self, fa):
7171
shape = shape.cut(bore_cutter)
7272
# outer chamfer on the hex
7373
fm.Reset()
74-
fm.AddPoint((s / math.sqrt(3) + 1.05 * dia / 2) / 2, h)
75-
fm.AddPoint(s / math.sqrt(3), h)
76-
fm.AddPoint(s / math.sqrt(3), m_w)
74+
fm.AddPoint((s / sqrt3 + 1.05 * dia / 2) / 2, h)
75+
fm.AddPoint(s / sqrt3, h)
76+
fm.AddPoint(s / sqrt3, m_w)
7777
top_cham_cutter = self.RevolveZ(fm.GetFace())
7878
shape = shape.cut(top_cham_cutter)
7979
# add modelled threads if needed

FsFunctions/FSmakeAllMetalLockNut.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def makeAllMetalLockNut(self, fa):
4747
# internal bore
4848
fm = FSFaceMaker()
4949
id = self.GetInnerThreadMinDiameter(dia, P, 0.0)
50-
bore_cham_ht = (dia * 1.05 - id) / 2 * math.tan(math.radians(15))
50+
bore_cham_ht = (dia * 1.05 - id) / 2 * tan15
5151
fm.AddPoint(0.0, 0.0)
5252
fm.AddPoint(dia * 1.05 / 2, 0.0)
5353
fm.AddPoint(id / 2, bore_cham_ht)
@@ -58,17 +58,17 @@ def makeAllMetalLockNut(self, fa):
5858
shape = shape.cut(bore_cutter)
5959
# outer chamfer on the hex
6060
fm.Reset()
61-
fm.AddPoint((s / math.sqrt(3) + 1.05 * dia / 2) / 2, h)
62-
fm.AddPoint(s / math.sqrt(3), h)
63-
fm.AddPoint(s / math.sqrt(3), m_w)
61+
fm.AddPoint((s / sqrt3 + 1.05 * dia / 2) / 2, h)
62+
fm.AddPoint(s / sqrt3, h)
63+
fm.AddPoint(s / sqrt3, m_w)
6464
top_cham_cutter = self.RevolveZ(fm.GetFace())
6565
shape = shape.cut(top_cham_cutter)
6666
# bottom chamfer
6767
fm.Reset()
6868
fm.AddPoint(s / 2, 0.0)
69-
fm.AddPoint(s / math.sqrt(3), 0.0)
70-
cham_ht = s * (1 / math.sqrt(3) - 0.5) * math.tan(math.radians(22.5))
71-
fm.AddPoint(s / math.sqrt(3), cham_ht)
69+
fm.AddPoint(s / sqrt3, 0.0)
70+
cham_ht = s * (1 / sqrt3 - 0.5) * math.tan(math.radians(22.5))
71+
fm.AddPoint(s / sqrt3, cham_ht)
7272
top_cham_cutter = self.RevolveZ(fm.GetFace())
7373
shape = shape.cut(top_cham_cutter)
7474
# add modelled threads if needed

FsFunctions/FSmakeButtonHeadScrew.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def makeButtonHeadScrew(self, fa):
4242
elif SType == 'ASMEB18.3.3A':
4343
P, b, da, dk, s_mean, t_min, r, k = fa.dimTable
4444
# Bottom of recess
45-
e_cham = 2.0 * s_mean / math.sqrt(3.0) * 1.005
45+
e_cham = 2.0 * s_mean / sqrt3 * 1.005
4646
# helper value for button arc
4747
ak = -(4 * k ** 2 + e_cham ** 2 - dk ** 2) / (8 * k)
4848
# radius of button arc

FsFunctions/FSmakeCastleNut.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ def _makeCastleNut(self, fa):
5050
else:
5151
raise NotImplementedError(f"Unknown fastener type: {fa.baseType}")
5252
dia = self.getDia(fa.calc_diam, True)
53-
inner_rad = dia / 2 - P * 0.625 * math.sqrt(3) / 2
53+
inner_rad = dia / 2 - P * 0.625 * sqrt3 / 2
5454
outer_rad = 0.505 * dia
55-
inner_cham_ht = math.tan(math.radians(15)) * (outer_rad - inner_rad)
55+
inner_cham_ht = tan15 * (outer_rad - inner_rad)
5656
# create the nut profile
5757
fm = FSFaceMaker()
5858
fm.AddPoint(inner_rad, m - inner_cham_ht)
@@ -63,7 +63,7 @@ def _makeCastleNut(self, fa):
6363
fil_h = fil_r * math.sin(math.radians(60))
6464
fm.AddPoint(d_e_max / 2, w + fil_h)
6565
fm.AddArc2(fil_r, 0.0, 60)
66-
fm.AddPoint(s / 2 + w * math.sqrt(3) / 2, w / 2)
66+
fm.AddPoint(s / 2 + w * sqrt3 / 2, w / 2)
6767
fm.AddPoint(s / 2, 0.0)
6868
fm.AddPoint(outer_rad, 0.0)
6969
fm.AddPoint(inner_rad, inner_cham_ht)
@@ -103,15 +103,15 @@ def _makeSlottedNut(self, fa):
103103
else:
104104
raise NotImplementedError(f"Unknown fastener type: {fa.baseType}")
105105
dia = self.getDia(fa.calc_diam, True)
106-
inner_rad = dia / 2 - P * 0.625 * math.sqrt(3) / 2
106+
inner_rad = dia / 2 - P * 0.625 * sqrt3 / 2
107107
outer_rad = 0.505 * dia
108-
inner_cham_ht = math.tan(math.radians(15)) * (outer_rad - inner_rad)
108+
inner_cham_ht = tan15 * (outer_rad - inner_rad)
109109
# create the nut profile
110110
fm = FSFaceMaker()
111111
fm.AddPoint(inner_rad, m - inner_cham_ht)
112112
fm.AddPoint(outer_rad, m)
113113
fm.AddPoint(s / 2, m)
114-
fm.AddPoint(s / 2 + m * math.sqrt(3) / 2, m / 2)
114+
fm.AddPoint(s / 2 + m * sqrt3 / 2, m / 2)
115115
fm.AddPoint(s / 2, 0.0)
116116
fm.AddPoint(outer_rad, 0.0)
117117
fm.AddPoint(inner_rad, inner_cham_ht)

FsFunctions/FSmakeClevisPin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def makeClevisPin(self, fa):
4141
fm.AddPoint(d / 2 + r, 0.0)
4242
fm.AddArc2(0.0, -r, 90)
4343
fm.AddPoint(d / 2, -length + c)
44-
fm.AddPoint(d / 2 - c * math.sqrt(3) / 3, -length)
44+
fm.AddPoint(d / 2 - c * sqrt3 / 3, -length)
4545
fm.AddPoint(0.0, -length)
4646
shape = self.RevolveZ(fm.GetFace())
4747
if fa.Type == "ISO2341B":

FsFunctions/FSmakeCupNut.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,18 @@ def makeCupNut(self, fa):
5252
else:
5353
raise RuntimeError("unknown screw type")
5454
# create the profile of the nut in the x-z plane
55-
sq3 = math.sqrt(3)
56-
ec = (2 - sq3) * s / 6
55+
ec = (2 - sqrt3) * s / 6
5756
fm = FastenerBase.FSFaceMaker()
5857
fm.AddPoint(0, 1.1 * dia / 4)
5958
fm.AddPoint(1.1 * dia / 2, 0)
6059
fm.AddPoint(s / 2, 0)
61-
fm.AddPoint(s * sq3 / 3, ec)
62-
fm.AddPoint(s * sq3 / 3, m - ec)
63-
fm.AddPoint(d_k / 2, (m - ec) + (2 * s - sq3 * d_k) / 6)
60+
fm.AddPoint(s * sqrt3 / 3, ec)
61+
fm.AddPoint(s * sqrt3 / 3, m - ec)
62+
fm.AddPoint(d_k / 2, (m - ec) + (2 * s - sqrt3 * d_k) / 6)
6463
fm.AddPoint(d_k / 2, h - d_k / 2)
6564
fm.AddArc(
66-
d_k / 2 * math.sqrt(2) / 2, h - d_k / 2 + d_k /
67-
2 * math.sqrt(2) / 2, 0, h
65+
d_k / 2 * sqrt2 / 2, h - d_k / 2 + d_k /
66+
2 * sqrt2 / 2, 0, h
6867
)
6968
solid = self.RevolveZ(fm.GetFace())
7069
# create an additional solid to cut the hex flats with
@@ -87,8 +86,8 @@ def makeCupNut(self, fa):
8786
fm.Reset()
8887
fm.AddPoint(0, 0),
8988
fm.AddPoint(0, h - w)
90-
fm.AddPoint(dia / 2 - 0.625 * P * sq3 / 2, t)
91-
fm.AddPoint(dia / 2 - 0.625 * P * sq3 / 2, 0)
89+
fm.AddPoint(dia / 2 - 0.625 * P * sqrt3 / 2, t)
90+
fm.AddPoint(dia / 2 - 0.625 * P * sqrt3 / 2, 0)
9291
hole = self.RevolveZ(fm.GetFace())
9392
solid = solid.cut(hole)
9493
return solid

FsFunctions/FSmakeDowelPin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def makeDowelPin(self, fa):
3434
raise NotImplementedError(f"Unknown fastener type: {fa.Type}")
3535
length = fa.calc_len
3636
fm = FSFaceMaker()
37-
cham_d = math.tan(math.radians(15)) * cham
37+
cham_d = tan15 * cham
3838
fm.AddPoint(0.0, 0.0)
3939
fm.AddPoint(dia / 2 - cham_d, 0.0)
4040
fm.AddPoint(dia / 2, -cham)

FsFunctions/FSmakeExternalRetainingRing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ def makeExternalRetainingRing(self, fa):
4242
pnt1 = Base.Vector(d5_Min/2, -1*math.sqrt(d3**2-d5_Min**2)/2)
4343
pnt2 = Base.Vector(d5_Min/2, -1*math.sqrt(d3**2-d5_Min**2)/2-a_Max)
4444
pnt3 = Base.Vector(
45-
d5_Min*(1/2+math.sqrt(2)/2),
45+
d5_Min*(1/2+sqrt2/2),
4646
-1*math.sqrt(d3**2-d5_Min**2)/2-a_Max
47-
+ d5_Min*(1-math.sqrt(2)/2)
47+
+ d5_Min*(1-sqrt2/2)
4848
)
4949
pnt4 = Base.Vector(
5050
d5_Min*1.5,

FsFunctions/FSmakeFlangedButtonHeadScrew.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def makeFlangedButtonHeadScrew(self, fa):
4242
P, b, c, da, dk, dk_c, s_mean, t_min, r, k, e, w = fa.dimTable
4343
if SType == 'ASMEB18.3.3B':
4444
P, b, c, dk, dk_c, s_mean, t_min, r, k = fa.dimTable
45-
e_cham = 2.0 * s_mean / math.sqrt(3.0) * 1.005
45+
e_cham = 2.0 * s_mean / sqrt3 * 1.005
4646
ak = -(4 * (k - c) ** 2 + e_cham ** 2 - dk ** 2) / (8 * (k - c))
4747
rH = math.sqrt((dk / 2.0) ** 2 + ak ** 2) # radius of button arc
4848
alpha = (math.atan(2 * (k - c + ak) / e_cham) + math.atan((2 * ak) / dk)) / 2

FsFunctions/FSmakeFlangedNylocNut.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,22 @@ def makeFlangedNylocNut(self, fa):
5959
# flange of the hex
6060
fm.Reset()
6161
fm.AddPoint((1.05 * dia + s) / 4, 0.0)
62-
fm.AddPoint((dc + math.sqrt(3) * c) / 2, 0.0)
62+
fm.AddPoint((dc + sqrt3 * c) / 2, 0.0)
6363
fm.AddPoint((dc - c) / 2, 0.0)
6464
fm.AddArc2(0, c / 2, 150)
6565
fm.AddPoint(
6666
(1.05 * dia + s) / 4,
67-
math.sqrt(3)
67+
sqrt3
6868
/ 3
69-
* ((dc - c) / 2 + c / (4 - 2 * math.sqrt(3)) - (1.05 * dia + s) / 4),
69+
* ((dc - c) / 2 + c / (4 - 2 * sqrt3) - (1.05 * dia + s) / 4),
7070
)
7171
flange = self.RevolveZ(fm.GetFace())
7272
shape = shape.fuse(flange).removeSplitter()
7373

7474
# internal bore
7575
fm.Reset()
7676
id = self.GetInnerThreadMinDiameter(dia, P, 0.0)
77-
bore_cham_ht = (dia * 1.05 - id) / 2 * math.tan(math.radians(15))
77+
bore_cham_ht = (dia * 1.05 - id) / 2 * tan15
7878
fm.AddPoint(0.0, 0.0)
7979
fm.AddPoint(dia * 1.05 / 2, 0.0)
8080
fm.AddPoint(id / 2, bore_cham_ht)

FsFunctions/FSmakeHexHeadBolt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ def makeHexHeadBolt(self, fa):
8787
fm = FSFaceMaker()
8888
fm.AddPoint(0.0, k)
8989
fm.AddPoint(s / 2.0, k)
90-
fm.AddPoint(s / math.sqrt(3.0), k - cham)
91-
fm.AddPoint(s / math.sqrt(3.0), c)
90+
fm.AddPoint(s / sqrt3, k - cham)
91+
fm.AddPoint(s / sqrt3, c)
9292
fm.AddPoint(dw / 2.0, c)
9393
fm.AddPoint(dw / 2.0, 0.0)
9494
fm.AddPoint(dia / 2.0 + r, 0.0)

FsFunctions/FSmakeHexHeadWithFlange.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ def makeHexHeadWithFlange(self, fa):
7272
else:
7373
b = b3
7474
# needed for chamfer at head top
75-
cham = s * (2.0 / math.sqrt(3.0) - 1.0) * math.sin(math.radians(25))
76-
sqrt2_ = 1.0 / math.sqrt(2.0)
75+
cham = s * (2.0 / sqrt3 - 1.0) * math.sin(math.radians(25))
76+
sqrt2_ = 1.0 / sqrt2
7777
# Flange is made with a radius of c
7878
beta = math.radians(25.0)
7979
tan_beta = math.tan(beta)
8080
# Calculation of Arc points of flange edge using dc and c
8181
arc1_x = dc / 2.0 - c / 2.0 + (c / 2.0) * math.sin(beta)
8282
arc1_z = c / 2.0 + (c / 2.0) * math.cos(beta)
83-
kmean = arc1_z + (arc1_x - s / math.sqrt(3.0)) * tan_beta + kw * 1.1 + cham
83+
kmean = arc1_z + (arc1_x - s / sqrt3) * tan_beta + kw * 1.1 + cham
8484
# lay out the fastener profile
8585
fm = FSFaceMaker()
8686
fm.AddPoint(0.0, kmean * 0.9)
@@ -99,7 +99,7 @@ def makeHexHeadWithFlange(self, fa):
9999
kmean,
100100
)
101101
fm.AddPoint(s / 2.0, kmean)
102-
fm.AddPoint(s / 2 + (kmean - 0.1) * math.sqrt(3), 1.0)
102+
fm.AddPoint(s / 2 + (kmean - 0.1) * sqrt3, 1.0)
103103
fm.AddPoint(0.0, 0.1)
104104
head = self.RevolveZ(fm.GetFace())
105105
# cut the hexagon flats with a boolean operation

FsFunctions/FSmakeHexNut.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
***************************************************************************
2727
"""
2828
from screw_maker import *
29-
from math import sqrt
3029
import FastenerBase
3130

3231

@@ -63,19 +62,19 @@ def makeHexNut(self, fa):
6362
s = F * 25.4
6463
da = dia
6564
da = self.getDia(da, True)
66-
sqrt2_ = 1.0 / sqrt(2.0)
65+
sqrt2_ = 1.0 / sqrt2
6766
# needed for chamfer at nut top
68-
cham = s * (sqrt(3) / 3 - 1 / 2) * math.tan(math.radians(22.5))
69-
H = P * math.cos(math.radians(30))
67+
cham = s * (sqrt3 / 3 - 1 / 2) * math.tan(math.radians(22.5))
68+
H = P * cos30
7069
cham_i_delta = da / 2.0 - (dia / 2.0 - H * 5.0 / 8.0)
7170
cham_i = cham_i_delta * math.tan(math.radians(15.0))
7271
# layout the nut profile, then create a revolved solid
7372
fm = FastenerBase.FSFaceMaker()
7473
fm.AddPoint(dia / 2.0 - H * 5.0 / 8.0, m - cham_i)
7574
fm.AddPoint(da / 2.0, m)
7675
fm.AddPoint(s / 2.0, m)
77-
fm.AddPoint(s / sqrt(3.0), m - cham)
78-
fm.AddPoint(s / sqrt(3.0), cham)
76+
fm.AddPoint(s / sqrt3, m - cham)
77+
fm.AddPoint(s / sqrt3, cham)
7978
fm.AddPoint(s / 2.0, 0.0)
8079
fm.AddPoint(da / 2.0, 0.0)
8180
fm.AddPoint(dia / 2.0 - H * 5.0 / 8.0, 0.0 + cham_i)

FsFunctions/FSmakeHexNutWFlange.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def _makeHexNutWithTaperedFlange(self, fa):
8383
s = s_max
8484
flange_edge_rounded = True
8585
inner_rad = dia / 2 - P * 0.625 * sqrt3 / 2
86-
inner_cham_ht = math.tan(math.radians(15)) * (da / 2 - inner_rad)
86+
inner_cham_ht = tan15 * (da / 2 - inner_rad)
8787
# create the body of the nut
8888
fm = FastenerBase.FSFaceMaker()
8989
fm.AddPoint(inner_rad, m - inner_cham_ht)

FsFunctions/FSmakeInternalThreadedDowelPin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ def makeInternalThreadedDowelPin(self, fa):
4040
raise NotImplementedError(f"Unknown fastener type: {fa.Type}")
4141
length = fa.calc_len
4242
fm = FSFaceMaker()
43-
cham_top = math.tan(math.radians(15)) * c_1
44-
cham_bottom = math.tan(math.radians(15)) * c_2
43+
cham_top = tan15 * c_1
44+
cham_bottom = tan15 * c_2
4545
fm.AddPoint(0.0, -t_2)
4646
d_4 = self.GetInnerThreadMinDiameter(d_2, P)
4747
fm.AddPoint(d_4 / 2, d_4 / (2 * math.tan(math.radians(59))) - t_2)

FsFunctions/FSmakeInternalThreadedTaperPin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def makeInternalThreadedTaperPin(self, fa):
3535
else:
3636
raise NotImplementedError(f"Unknown fastener type: {fa.Type}")
3737
fm = FSFaceMaker()
38-
cham_top = math.tan(math.radians(15)) * a
38+
cham_top = tan15 * a
3939
fm.AddPoint(0.0, -t_2)
4040
d_4 = self.GetInnerThreadMinDiameter(d_2, P)
4141
fm.AddPoint(d_4 / 2, d_4 / (2 * math.tan(math.radians(59))) - t_2)

FsFunctions/FSmakePCBSpacer.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@
2929

3030
# PCB spacers / Wurth standard WA-SSTII
3131

32-
cos30 = math.cos(math.radians(30))
33-
34-
3532
def pspMakeFace(m, sw, l, id, thl):
3633
id2 = id / 2.0
3734
sw2 = sw / 2.0

FsFunctions/FSmakePCBStandoff.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@
2929

3030
# PCB standoffs / Wurth standard WA-SSTII
3131

32-
cos30 = math.cos(math.radians(30))
33-
34-
3532
def psMakeFace(m, sw, lo, l, id):
3633
id2 = id / 2.0
3734
sw2 = float(sw) / 2.0

FsFunctions/FSmakePEMStud.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
from screw_maker import *
2828
import FastenerBase
2929

30-
cos30 = math.cos(math.radians(30))
31-
3230
# PEM Self Clinching studs types: FH/FHS/FHA
3331

3432
def fhMakeFace(m, h, d, l):

FsFunctions/FSmakePalNut.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ def makePalNut(self, fa):
4040
raise NotImplementedError(f"Unknown fastener type: {fa.Type}")
4141
# construct the base of the hexagonal shape
4242
fm = FSFaceMaker()
43-
fm.AddPoint(s / math.sqrt(3), 0.0)
44-
fm.AddPoint(s / math.sqrt(3), t)
43+
fm.AddPoint(s / sqrt3, 0.0)
44+
fm.AddPoint(s / sqrt3, t)
4545
fm.AddPoint(od / 2, t)
4646
fm.AddPoint(id / 2, t + (od - id) / 2 * math.tan(math.radians(30)))
4747
fm.AddPoint(id / 2, (od - id) / 2 * math.tan(math.radians(30)))

FsFunctions/FSmakePilotedGroovedDowelPin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def makePilotedGroovedDowelPin(self, fa):
3636
fm = FSFaceMaker()
3737
fm.AddPoint(0.0, 0.0)
3838
fm.AddPoint(d_2 / 2, 0.0)
39-
cham_ht = (d_2 - d_1) / 2 / math.tan(math.radians(15))
39+
cham_ht = (d_2 - d_1) / 2 / tan15
4040
fm.AddPoint(d_2 / 2, -length + c + cham_ht)
4141
fm.AddPoint(d_1 / 2, c - length)
4242
fm.AddPoint(d_1 / 2, -length)

FsFunctions/FSmakeReducedShankHexHeadBolt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ def makeReducedShankHexHeadBolt(self, fa):
4545
b = b1
4646
else:
4747
raise NotImplementedError(f"Unknown fastener type: {fa.Type}")
48-
dp = (dia / 2 - 0.375 * math.sqrt(3) / 2 * P) * 2
48+
dp = (dia / 2 - 0.375 * sqrt3 / 2 * P) * 2
4949
# needed for chamfer at head top
5050
cham = (e - s) * math.sin(math.radians(15))
5151
# lay out head profile
5252
fm = FSFaceMaker()
5353
fm.AddPoint(0.0, k)
5454
fm.AddPoint(s / 2.0, k)
55-
fm.AddPoint(s / math.sqrt(3.0), k - cham)
56-
fm.AddPoint(s / math.sqrt(3.0), c)
55+
fm.AddPoint(s / sqrt3, k - cham)
56+
fm.AddPoint(s / sqrt3, c)
5757
fm.AddPoint(dw / 2.0, c)
5858
fm.AddPoint(dw / 2.0, 0.0)
5959
fm.AddPoint(dp / 2.0 + r, 0.0)

0 commit comments

Comments
 (0)