正八面體的分解
Author: 藍邦偉  老師

x

y

$ z $

顯示座標軸

Step 2

正八面體的分解

α = 3.490658503988659 rad (slider from 0 to 6.283185307179586, step 0.1*°)
β = 1.3962634015954636 rad (slider from 0 to 6.283185307179586, step 0.1*°)
O = (81.30330865869168, 11.050270262843771)
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})
A_1: O + 4 * u
A_2: O + 4 * v
A_3: O - 4 * u
A_4: O - 4 * v
A_5: O + 4 * w
A_6: O - 4 * w
A_a: (Corner[1] + Corner[3]) / 2
L = 6.2 (slider from 1 to 6.2, step 0.01)
y_{Axis} = Vector(O - L * v, O + L * v)
x_{Axis} = Vector(O - L * u, O + L * u)
z_{Axis} = Vector(O - L * w, O + L * w)
a = Segment(A_4, A_1)
b = Segment(A_1, A_2)
c = Segment(A_2, A_3)
d = Segment(A_3, A_4)
e = Segment(A_5, A_1)
f = Segment(A_5, A_2)
g = Segment(A_5, A_3)
h = Segment(A_5, A_4)
i = Segment(A_1, A_6)
j = Segment(A_4, A_6)
k = Segment(A_3, A_6)
l = Segment(A_2, A_6)
d1 = 0 (slider from 0 to 1.7, step 0.01)
d2 = 0 (slider from 0 to 2, step 0.01)
poly1 = Poly_C3(A_5, A_1, A_2)
poly2 = Poly_P3(A_1, A_6, A_2)
poly3 = Poly_R3(A_5, A_2, A_3)
poly4 = Poly_G3(A_2, A_6, A_3)
poly5 = Poly_Y3(A_5, A_3, A_4)
poly6 = Poly_C3(A_3, A_6, A_4)
poly7 = Poly_C3(A_5, A_4, A_1)
poly8 = Poly_C3(A_4, A_6, A_1)
A_{1U}: A_1 + d1 * w
A_{2U}: A_2 + d1 * w
A_{3U}: A_3 + d1 * w
A_{4U}: A_4 + d1 * w
A_{5U}: A_5 + d1 * w
A_{1D}: A_1 - d1 * w
A_{2D}: A_2 - d1 * w
A_{3D}: A_3 - d1 * w
A_{4D}: A_4 - d1 * w
A_{6D}: A_6 - d1 * w
m = Segment(A_{4U}, A_{1U})
n' = Segment(A_{1U}, A_{2U})
p = Segment(A_{2U}, A_{3U})
q = Segment(A_{3U}, A_{4U})
r = Segment(A_{5U}, A_{3U})
s = Segment(A_{5U}, A_{2U})
t = Segment(A_{5U}, A_{1U})
a_1 = Segment(A_{5U}, A_{4U})
b_1 = Segment(A_{4D}, A_{1D})
c_1 = Segment(A_{1D}, A_{2D})
d_1 = Segment(A_{2D}, A_{3D})
e_1 = Segment(A_{3D}, A_{4D})
f_1 = Segment(A_{4D}, A_{6D})
g_1 = Segment(A_{6D}, A_{1D})
h_1 = Segment(A_{2D}, A_{6D})
i_1 = Segment(A_{3D}, A_{6D})
n = 0 (slider from 0 to 2, step 1)
a_{11} = Segment(A_1, A_2)
a_{12} = Segment(A_3, A_2)
a_{13} = Segment(A_3, A_4)
a_{14} = Segment(A_1, A_4)
j_1 = Segment(A_{1U}, A_{3U})
k_1 = Segment(A_{4U}, A_{2U})
l_1 = Segment(A_{4D}, A_{2D})
m_1 = Segment(A_{1D}, A_{3D})
A_U = Intersect(j_1, k_1)
A_D = Intersect(l_1, m_1)
o = false
n_1 = Segment(A_{5U}, A_U)
p_1 = Segment(A_D, A_{6D})
A_{5U1}: A_{5U} + d2 * u + d2 * v
A_{U1}: A_U + d2 * u + d2 * v
A_{1U1}: A_{1U} + d2 * u + d2 * v
A_{2U1}: A_{2U} + d2 * u + d2 * v
q_1 = Segment(A_{5U1}, A_{U1})
r_1 = Segment(A_{5U1}, A_{2U1})
s_1 = Segment(A_{5U1}, A_{1U1})
t_1 = Segment(A_{1U1}, A_{2U1})
a_2 = Segment(A_{U1}, A_{1U1})
b_2 = Segment(A_{U1}, A_{2U1})
A_{5U2}: A_{5U} + d2 * u - d2 * v
A_{U2}: A_U + d2 * u - d2 * v
A_{1U2}: A_{1U} + d2 * u - d2 * v
A_{4U2}: A_{4U} + d2 * u - d2 * v
c_2 = Segment(A_{5U2}, A_{U2})
d_2 = Segment(A_{U2}, A_{1U2})
e_2 = Segment(A_{U2}, A_{4U2})
f_2 = Segment(A_{4U2}, A_{1U2})
g_2 = Segment(A_{5U2}, A_{1U2})
h_2 = Segment(A_{5U2}, A_{4U2})
A_{5U3}: A_{5U} - d2 * u - d2 * v
A_{U3}: A_U - d2 * u - d2 * v
A_{3U3}: A_{3U} - d2 * u - d2 * v
A_{4U3}: A_{4U} - d2 * u - d2 * v
i_2 = Segment(A_{5U3}, A_{U3})
j_2 = Segment(A_{U3}, A_{4U3})
k_2 = Segment(A_{U3}, A_{3U3})
l_2 = Segment(A_{5U3}, A_{3U3})
m_2 = Segment(A_{3U3}, A_{4U3})
n_2 = Segment(A_{4U3}, A_{5U3})
A_{5U4}: A_{5U} - d2 * u + d2 * v
A_{U4}: A_U - d2 * u + d2 * v
A_{3U4}: A_{3U} - d2 * u + d2 * v
A_{2U4}: A_{2U} - d2 * u + d2 * v
p_2 = Segment(A_{5U4}, A_{U4})
q_2 = Segment(A_{U4}, A_{2U4})
r_2 = Segment(A_{U4}, A_{3U4})
s_2 = Segment(A_{3U4}, A_{2U4})
t_2 = Segment(A_{2U4}, A_{5U4})
a_3 = Segment(A_{5U4}, A_{3U4})
A_{1D5}: A_{1D} + d2 * u + d2 * v
A_{2D5}: A_{2D} + d2 * u + d2 * v
A_{D5}: A_D + d2 * u + d2 * v
A_{6D5}: A_{6D} + d2 * u + d2 * v
b_3 = Segment(A_{D5}, A_{6D5})
c_3 = Segment(A_{1D5}, A_{D5})
d_3 = Segment(A_{D5}, A_{2D5})
e_3 = Segment(A_{1D5}, A_{6D5})
f_3 = Segment(A_{1D5}, A_{2D5})
g_3 = Segment(A_{6D5}, A_{2D5})
A_{1D6}: A_{1D} + d2 * u - d2 * v
A_{4D6}: A_{4D} + d2 * u - d2 * v
A_{D6}: A_D + d2 * u - d2 * v
A_{6D6}: A_{6D} + d2 * u - d2 * v
h_3 = Segment(A_{D6}, A_{4D6})
i_3 = Segment(A_{D6}, A_{1D6})
j_3 = Segment(A_{D6}, A_{6D6})
k_3 = Segment(A_{4D6}, A_{1D6})
l_3 = Segment(A_{4D6}, A_{6D6})
m_3 = Segment(A_{1D6}, A_{6D6})
A_{3D7}: A_{3D} - d2 * u - d2 * v
A_{4D7}: A_{4D} - d2 * u - d2 * v
A_{D7}: A_D - d2 * u - d2 * v
A_{6D7}: A_{6D} - d2 * u - d2 * v
n_3 = Segment(A_{D7}, A_{6D7})
p_3 = Segment(A_{3D7}, A_{4D7})
q_3 = Segment(A_{3D7}, A_{D7})
r_3 = Segment(A_{4D7}, A_{6D7})
s_3 = Segment(A_{D7}, A_{4D7})
t_3 = Segment(A_{3D7}, A_{6D7})
A_{6D8}: A_{6D} - d2 * u + d2 * v
A_{2D8}: A_{2D} - d2 * u + d2 * v
A_{3D8}: A_{3D} - d2 * u + d2 * v
A_{D8}: A_D - d2 * u + d2 * v
a_4 = Segment(A_{2D8}, A_{3D8})
b_4 = Segment(A_{D8}, A_{6D8})
c_4 = Segment(A_{2D8}, A_{6D8})
d_4 = Segment(A_{D8}, A_{3D8})
e_4 = Segment(A_{2D8}, A_{D8})
f_4 = Segment(A_{3D8}, A_{6D8})
d3 = 0

Tool: Poly_B3
Input: A, B, C
Output: poly1'

α = Angle(C, B, A)
d: sqrt(sgn(sin(α)))
A' = Dilate(A, d, A)
B' = Dilate(B, d, A)
C' = Dilate(C, d, A)
poly1', c', a', b' = Polygon(A', B', C')

Tool: Poly_C3
Input: A, B, C
Output: poly1

poly1 = Poly_B3(A, B, C)

Tool: Poly_G3
Input: A, B, C
Output: poly1'

α = Angle(C, B, A)
d: sqrt(sgn(sin(α)))
A' = Dilate(A, d, A)
B' = Dilate(B, d, A)
C' = Dilate(C, d, A)
poly1', c', a', b' = Polygon(A', B', C')

Tool: Poly_P3
Input: A, B, C
Output: poly1

poly1 = Poly_B3(A, B, C)

Tool: Poly_R3
Input: A, B, C
Output: poly1'

α = Angle(C, B, A)
d: sqrt(sgn(sin(α)))
A' = Dilate(A, d, A)
B' = Dilate(B, d, A)
C' = Dilate(C, d, A)
poly1', c', a', b' = Polygon(A', B', C')

Tool: Poly_Y3
Input: A, B, C
Output: poly1

poly1 = Poly_B3(A, B, C)

Tool: SDLine
Input: A, B, C, D
Output: g, h

b: sgn(sin(Angle[D, B, A]))
a: sgn(sin(Angle[A, B, C]))
c: sgn(a + b + 0.5)
d: sqrt(c)
e: sqrt(-c)
E = Midpoint(A, B)
A' = Dilate(A, d, E)
B' = Dilate(B, d, E)
g = Segment(A', B')
A'_1 = Dilate(A, e, E)
B'_1 = Dilate(B, e, E)
h = Segment(A'_1, B'_1)

Tool: Poly_R4
Input: A, B, C, D
Output: poly1'

α = Angle(C, B, A)
a: sqrt(sgn(sin(α)))
A' = Dilate(A, a, B)
B' = Dilate(B, a, B)
C' = Dilate(C, a, B)
D' = Dilate(D, a, B)
poly1', a', b', c', d' = Polygon(A', B', C', D')

Tool: Poly_P4
Input: A, B, C, D
Output: poly1

poly1 = Poly_R4(A, B, C, D)