3D 座標架的製作
Author: 藍邦偉  老師

3D 座標架的製作

單位向量

單位點

座標軸

xy平面

x

y

z

複合多面體

α = 4.461061568097507 rad (slider from 0*° to 6.283185307179586, step 0.1*°)
β = 1.3089969389957472 rad (slider from 0 to 6.283185307179586, step 0.017453292519943295)
L = 2 (slider from 1 to 10, step 1)
O = (29.8, 12.78)
X_{unit}: O + (cos(α), sin(α) * cos(β))
Y_{unit}: O + (-sin(α), cos(α) * cos(β))
Z_{unit}: O + (0, -sin(β))
u = Vector(O, X_{unit})
v = Vector(O, Y_{unit})
w = Vector(O, Z_{unit})
x_{Axis} = Vector(O - L * u, O + L * u)
y_{Axis} = Vector(O - L * v, O + L * v)
z_{Axis} = Vector(O - L * w, O + L * w)
多邊形1, d, e, f, g = Polygon(O + L * u + L * v, O - L * u + L * v, O - L * u - L * v, O + L * u - L * v)
h = false
i = false
j = false
k = false
A_1: O + 2 * cos(0°) * u + 2 * sin(0°) * v + w
A_3: O + 2 * cos(180°) * u + 2 * sin(180°) * v + w
A_2: O + 2 * cos(90°) * u + 2 * sin(90°) * v + w
A_4: O + 2 * cos(270°) * u + 2 * sin(270°) * v + w
B_1: O + 2 * cos(0°) * u + 2 * sin(0°) * v - w
B_2: O + 2 * cos(90°) * u + 2 * sin(90°) * v - w
B_3: O + 2 * cos(180°) * u + 2 * sin(180°) * v - w
B_4: O + 2 * cos(270°) * u + 2 * sin(270°) * v - w
A = Midpoint(B_3, B_4)
B = Midpoint(B_4, B_1)
C = Midpoint(B_1, B_2)
D = Midpoint(B_2, B_3)
E: O - 2.1 * w
poly8, b_{13}, e_1, a_{13} = Polygon(E, A, B)
poly9, a_{14}, e_2, d_2 = Polygon(E, D, A)
poly10, c_1, e_3, d_3 = Polygon(E, D, C)
poly11, c_2, e_4, b_{14} = Polygon(E, B, C)
F = Midpoint(B_3, A_3)
G = Midpoint(A_3, A_4)
H = Midpoint(A_4, B_4)
I: O + 2 * v + 2 * u
J: O - 2 * v - 2 * u
poly13, h_2, a_{16}, j_1 = Polygon(A, J, H)
poly14, h_3, j_2, g_2 = Polygon(J, G, H)
poly15, a_{17}, j_3, f_2 = Polygon(J, F, A)
poly16, g_3, j_4, f_3 = Polygon(J, F, G)
K = Midpoint(B_1, A_1)
M = Midpoint(B_4, A_4)
N = Midpoint(B_4, B_1)
P = Midpoint(A_4, A_1)
Z_1: O + 2 * v - 2 * u
X: O - 2 * v + 2 * u
poly7, Q, n, k_1 = Polygon(N, K, X)
poly12, R, n_1, m = Polygon(N, M, X)
poly17, m_1, S, p = Polygon(X, P, M)
poly18, k_2, p_1, T = Polygon(P, X, K)
U = Midpoint(B_2, A_2)
V = Midpoint(A_1, A_2)
poly19, i_1, c, u_1 = Polygon(C, U, I)
W = Intersect(u_1, i_1)
poly20, i_2, w_1, k_3 = Polygon(W, K, I)
poly21, i_3, k_4, v_1 = Polygon(K, V, I)
Z = Intersect(u_1, c)
poly22, z, u_2, v_2 = Polygon(U, V, Z)
C_1 = Midpoint(A_2, A_3)
poly23, z_1, d_1, f_1 = Polygon(D, F, Z_1)
poly24, d_4, u_3, z_2 = Polygon(U, Z_1, D)
poly25, c_3, z_3, u_4 = Polygon(Z_1, U, C_1)
poly26, z_4, c_4, f_4 = Polygon(C_1, F, Z_1)
poly27, b_{15}, d_5, a = Polygon(D, A, B_3)
poly28, d_6, b_{16}, f_5 = Polygon(B_3, F, D)
poly29, a_{15}, b_{17}, f_6 = Polygon(B_3, F, A)
poly30, b_{18}, b, a_{18} = Polygon(B, A, B_4)
poly31, b_{19}, a_{19}, h_1 = Polygon(A, H, B_4)
poly32, h_4, b_{20}, b_{21} = Polygon(B, B_4, H)
poly33, b_{22}, c_5, b_{23} = Polygon(C, B, B_1)
poly34, k_5, b_{24}, b_{25} = Polygon(B, B_1, K)
poly36, c_6, b_{30}, k_6 = Polygon(B_1, K, C)
poly37, c_7, d_7, b_{31} = Polygon(D, B_2, C)
poly38, c_8, b_{32}, u_5 = Polygon(B_2, U, C)
poly39, d_8, b_{33}, u_6 = Polygon(B_2, U, D)
E_1: O + 2.1 * w
poly40, v_3, c_9, e_5 = Polygon(C_1, E_1, V)
poly41, e_6, c_{10}, g_1 = Polygon(C_1, G, E_1)
poly42, p_2, g_4, e_7 = Polygon(G, E_1, P)
poly43, v_4, e_8, p_3 = Polygon(E_1, P, V)
poly44, v_5, u_7, a_{20} = Polygon(U, A_2, V)
poly45, c_{11}, u_8, a_{21} = Polygon(U, A_2, C_1)
poly46, c_{12}, a_{22}, v_6 = Polygon(A_2, V, C_1)
poly47, g_5, e_9, c_{13} = Polygon(E_1, C_1, G)
poly48, c_{14}, f_7, a_{23} = Polygon(F, A_3, C_1)
poly49, g_6, f_8, a_{24} = Polygon(F, A_3, G)
poly50, g_7, a_{25}, c_{15} = Polygon(A_3, C_1, G)
poly51, p_4, h_5, a_{26} = Polygon(H, A_4, P)
poly52, h_6, g_8, a_{27} = Polygon(G, A_4, H)
poly53, a_{28}, g_9, p_5 = Polygon(G, P, A_4)
poly54, p_6, k_7, a_{29} = Polygon(K, A_1, P)
poly55, p_7, a_{30}, v_7 = Polygon(A_1, V, P)
poly56, a_{31}, v_8, k_8 = Polygon(V, K, A_1)