Mod: bodyCentered, faceCentered - new fillet radius curve

This commit is contained in:
L-Nafaryus 2021-05-14 19:35:45 +05:00
parent 1c1887a204
commit 2910c03b33
No known key found for this signature in database
GPG Key ID: C76D8DCD2727DBB7
3 changed files with 84 additions and 10 deletions

70
extra/fillet-radius.py Normal file
View File

@ -0,0 +1,70 @@
import matplotlib.pyplot as plt
from math import sqrt
import sys
if __name__ == "__main__":
try:
stype = sys.argv[1]
except IndexError:
print("python fillet-radius.py [simple|bodyCentered|faceCentered]")
exit(1)
if stype == "simple":
r0 = 1.0
C1, C2 = 0.8, 0.5
theta1, theta2 = 0.01, 0.28
delta = 0.2
elif stype == "bodyCentered":
L = 1.0
r0 = L * sqrt(3) / 4
C1, C2 = 0.3, 0.2
theta1, theta2 = 0.01, 0.18
delta = 0.02
elif stype == "faceCentered":
L = 1.0
r0 = L * sqrt(2) / 4
C1, C2 = 0.3, 0.2
theta1, theta2 = 0.01, 0.13
delta = 0.012
else:
print("python fillet-radius.py [simple|bodyCentered|faceCentered]")
exit(1)
Cf = lambda theta: C1 + (C2 - C1) / (theta2 - theta1) * (theta - theta1)
fillet = lambda theta: delta - Cf(theta) * (r0 / (1 - theta) - r0)
tocount = lambda num: int(num * 100)
theta = [ 0.01 * n for n in range(tocount(theta1), tocount(theta2) + 1) ]
coeffs = [ Cf(n) for n in theta ]
radiuses = [ fillet(n) for n in theta ]
plt.figure(1)
plt.subplot(211)
plt.plot(theta, coeffs, "o")
plt.grid(True)
plt.ylabel("Cf")
plt.subplot(212)
plt.plot(theta, radiuses, "o")
plt.grid(True)
plt.ylabel("Radius")
plt.xlabel("Theta")
plt.show()

View File

@ -28,10 +28,11 @@ def bodyCenteredCubic(theta = 0.01, fillet = False, direction = [1, 0, 0]):
yw = xl
zh = height
C1, C2 = 0.8, 0.5 #0.8, 0.05
theta1, theta2 = 0.01, 0.13
C1, C2 = 0.3, 0.2
theta1, theta2 = 0.01, 0.18
Cf = C1 + (C2 - C1) / (theta2 - theta1) * (theta - theta1)
filletradius = 0.05 - Cf * (radius - r0)
delta = 0.02
filletradius = delta - Cf * (radius - r0)
scale = 100
oo = geompy.MakeVertex(0, 0, 0)
@ -178,10 +179,11 @@ def bodyCenteredHexagonalPrism(theta = 0.01, fillet = False, direction = [1, 1,
point.append((0 + xl, L + yw, L + zh))
point.append((L / 3 + xl, L / 3 + yw, 4 * L / 3 + zh))
C1, C2 = 0.8, 0.05
theta1, theta2 = 0.01, 0.13
C1, C2 = 0.3, 0.2
theta1, theta2 = 0.01, 0.18
Cf = C1 + (C2 - C1) / (theta2 - theta1) * (theta - theta1)
filletradius = Cf * (radius - r0)
delta = 0.02
filletradius = delta - Cf * (radius - r0)
scale = 100
oo = geompy.MakeVertex(0, 0, 0)

View File

@ -28,10 +28,11 @@ def faceCenteredCubic(theta = 0.01, fillet = False, direction = [1, 0, 0]):
yw = xl
zh = width
C1, C2 = 0.8, 0.05
C1, C2 = 0.3, 0.2
theta1, theta2 = 0.01, 0.13
Cf = C1 + (C2 - C1) / (theta2 - theta1) * (theta - theta1)
filletradius = Cf * (radius - r0)
delta = 0.012
filletradius = delta - Cf * (radius - r0)
scale = 100
oo = geompy.MakeVertex(0, 0, 0)
@ -176,10 +177,11 @@ def faceCenteredHexagonalPrism(theta = 0.01, fillet = False, direction = [1, 1,
point.append((-width + xl, 0 + yw, 0 + zh))
point.append((-2 * width / 3 + xl, -2 * width / 3 + yw, width / 3 + zh))
C1, C2 = 0.8, 0.05
C1, C2 = 0.3, 0.2
theta1, theta2 = 0.01, 0.13
Cf = C1 + (C2 - C1) / (theta2 - theta1) * (theta - theta1)
filletradius = Cf * (radius - r0)
delta = 0.012
filletradius = delta - Cf * (radius - r0)
scale = 100
oo = geompy.MakeVertex(0, 0, 0)