我试图使十字形的所有边缘都弯曲,以减少 3D 打印图形时的压力。 我现在的代码是:
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
# DATA
L = 0.1 #m, length of arm of cross
t = L/2 #m, thickness
# VECTORS OF COORDINATES OF THE CROSS
X = np.array([L, t/2, t/2, -t/2, -t/2, -L, -L, -t/2, -t/2, t/2, t/2, L, L])
Y = np.array([t/2, t/2, L, L, t/2, t/2, -t/2, -t/2, -L, -L, -t/2, -t/2, t/2])
# PLOT
fig, ax = plt.subplots(figsize=(8,8))
ax.plot(X,Y,color='C1', linewidth=2.5)
ax.axis('equal')
circle2 = plt.Circle((L - t/2, 0), t/4, color='b', fill=False)
circle3 = plt.Circle((-L + t/2, 0), t/4, color='b', fill=False)
circle4 = plt.Circle((0, L-t/2), t/4, color='b', fill=False)
circle5 = plt.Circle((0, -L+t/2), t/4, color='b', fill=False)
circle6 = plt.Circle((0, 0), t/4, color='b', fill=False)
ax.add_patch(circle2)
ax.add_patch(circle3)
ax.add_patch(circle4)
ax.add_patch(circle5)
ax.add_patch(circle6)
plt.axis('off')
plt.show()
axis_off = ax.axis('off')
我希望弯曲四个内角和十字架两端的八个角。image of the figure the code above creates