正立方體的切割
Author: 藍邦偉　老師

單位向量

座標軸

x

y

z

正立方體的切割

α = 1.1344640137963142 rad (slider from 0 to 6.283185307179586, step 0.017)
β = 1.7453292519943295 rad (slider from 0 to 6.283185307179586, step 0.017)
O = (9.133645172337227, 2.6917602808315135)
X_{unit}: O + (cos(α), sin(α) * cos(β))
Y_{unit}: O + (-1 * sin(α), cos(α) * cos(β))
Z_{unit}: O + (0, sin(β))
u = Vector(O, X_{unit})
v = Vector(O, Y_{unit})
w = Vector(O, Z_{unit})
L = 6 (slider from 1 to 10, step 1)
a = Vector(O - L * v, O + L * v)
b = Vector(O - L * w, O + L * w)
z = Vector(O - L * u, O + L * u)
c = false
d = false
Q_2: 0.2 * Corner[2] + 0.8 * Corner[1]
Q_3: (x(Q_2), y(Corner[3]))
g = Segment(Q_2, Q_3)
A_1: O
A_2: O + 4 * u
A_3: O + 4 * u + 4 * v
A_4: O + 4 * v
A_5: O + 4 * w
A_6: O + 4 * u + 4 * w
A_7: O + 4 * u + 4 * v + 4 * w
A_8: O + 4 * v + 4 * w
p_1 = Segment(A_1, A_2)
p_2 = Segment(A_3, A_2)
p_3 = Segment(A_3, A_4)
p_4 = Segment(A_1, A_4)
p_5 = Segment(A_5, A_6)
p_6 = Segment(A_7, A_6)
p_7 = Segment(A_7, A_8)
p_8 = Segment(A_5, A_8)
p_9 = Segment(A_5, A_1)
p_a = Segment(A_2, A_6)
p_b = Segment(A_3, A_7)
p_c = Segment(A_4, A_8)
t = 0 (slider from 0 to 2, step 0.01)
B_4: A_7 + t * u + t * v
B_3: O + 4 * u + 4 * v + t * u + t * v
B_2: O + 4 * v + 4 * w + t * u + t * v
B_1: O + 4 * u + 4 * w + t * u + t * v
q_1 = Segment(B_1, B_2)
q_2 = Segment(B_1, B_3)
q_3 = Segment(B_1, B_4)
q_4 = Segment(B_2, B_4)
q_5 = Segment(B_2, B_3)
q_6 = Segment(B_4, B_3)
r_1 = Segment(A_3, A_6)
r_2 = Segment(A_3, A_8)
r_3 = Segment(A_6, A_8)
poly1, a_3, a_8, a_6 = Polygon(A_8, A_6, A_3)
poly2, b_2, b_1, b_3 = Polygon(B_1, B_3, B_2)
poly3, e, q_7, q_8, f = Polygon(Corner[1], Q_2, Q_3, Corner[4])
poly4 = Poly_B4(A_1, A_4, A_8, A_5)
poly5 = Poly_R4(A_1, A_5, A_6, A_2)
poly6 = Poly_C4(A_4, A_1, A_2, A_3)
poly7 = Poly_P4(A_5, A_8, A_7, A_6)
poly8 = Poly_P3(A_6, A_5, A_8)
poly9 = Poly_P3(B_4, B_1, B_2)
poly10 = Poly_C4(A_7, A_8, A_4, A_3)
poly11 = Poly_P3(A_3, A_8, A_4)
poly12 = Poly_P3(B_2, B_3, B_4)
poly13 = Poly_P4(A_6, A_7, A_3, A_2)
poly14 = Poly_B3(A_3, A_2, A_6)
poly15 = Poly_B3(B_3, B_1, B_4)

Tool: Poly_B4
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_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)

Tool: Poly_R6
Input: A, B, C, D, E, F
Output: poly1'

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

Tool: Poly_R4 (command Poly_R41)
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_R4 (command Poly_R42)
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_C4
Input: A, B, C, D
Output: poly1

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

Tool: Poly_R4 (command Poly_R43)
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_Y4
Input: A, B, C, D
Output: poly1

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

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_P3
Input: A, B, C
Output: poly1

poly1 = Poly_B3(A, B, C)