截立方體
Author: 藍邦偉　老師

單位向量

座標軸

x

y

z

$ 截正八面體 $

O = (9.87031602203425, 4.097568686228629)
β = 1.3962634015954636 rad (slider from 0 to 6.283185307179586, step 0.017)
Z_{unit}: O + (0, sin(β))
w = Vector(O, Z_{unit})
α = 4.276056667386108 rad (slider from 0 to 6.283185307179586, step 0.1*°)
X_{unit}: O + (cos(α), sin(α) * cos(β))
u = Vector(O, X_{unit})
Y_{unit}: O + (-1 * sin(α), cos(α) * cos(β))
v = Vector(O, Y_{unit})
L = 5 (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)
poly1, h, q_1, q_4, i = Polygon(Corner[1], Q_2, Q_3, Corner[4])
x_1 = 1 (slider from 0.1 to 5, step 0.1)
x_2 = 2 (slider from 0.1 to 5, step 0.1)
x_3 = 1 (slider from 0.1 to 5, step 0.1)
y_1 = 1 (slider from 0.1 to 5, step 0.1)
y_2 = 1 (slider from 0.1 to 5, step 0.1)
y_3 = 1 (slider from 0.1 to 5, step 0.1)
z_1 = 1 (slider from 0.1 to 5, step 0.1)
z_2 = 2 (slider from 0.1 to 5, step 0.1)
r = 2.6 (slider from -5 to 5, step 0.1)
t = 0 (slider from 0 to 0.5, step 0.01)
A_1: O + 2 * r * u
A_2: O + 2 * r * v
A_3: O - 2 * r * u
A_4: O - 2 * r * v
A_5: O + 2 * r * w
A_6: O - 2 * r * w
a_0 = Segment(A_1, A_2)
a_1 = Segment(A_3, A_2)
a_2 = Segment(A_3, A_4)
a_3 = Segment(A_1, A_4)
a_4 = Segment(A_1, A_5)
a_5 = Segment(A_2, A_5)
a_6 = Segment(A_3, A_5)
a_7 = Segment(A_4, A_5)
a_8 = Segment(A_1, A_6)
a_9 = Segment(A_2, A_6)
a_{10} = Segment(A_3, A_6)
a_{11} = Segment(A_4, A_6)
B_1: A_5 + t * Vector[A_5, A_1]
B_2: A_5 + t * Vector[A_5, A_2]
B_3: A_5 + t * Vector[A_5, A_3]
B_4: A_5 + t * Vector[A_5, A_4]
C_1: A_6 + t * Vector[A_6, A_1]
C_2: A_6 + t * Vector[A_6, A_2]
C_3: A_6 + t * Vector[A_6, A_3]
C_4: A_6 + t * Vector[A_6, A_4]
D_5: A_1 + t * Vector[A_1, A_5]
D_2: A_1 + t * Vector[A_1, A_2]
D_6: A_1 + t * Vector[A_1, A_6]
D_4: A_1 + t * Vector[A_1, A_4]
E_5: A_2 + t * Vector[A_2, A_5]
E_3: A_2 + t * Vector[A_2, A_3]
E_1: A_2 + t * Vector[A_2, A_1]
E_6: A_2 + t * Vector[A_2, A_6]
F_6: A_3 + t * Vector[A_3, A_6]
F_2: A_3 + t * Vector[A_3, A_2]
F_5: A_3 + t * Vector[A_3, A_5]
F_4: A_3 + t * Vector[A_3, A_4]
G_5: A_4 + t * Vector[A_4, A_5]
G_6: A_4 + t * Vector[A_4, A_6]
G_1: A_4 + t * Vector[A_4, A_1]
G_3: A_4 + t * Vector[A_4, A_3]
poly2 = Poly_G4(B_1, B_2, B_3, B_4)
poly3 = Poly_G4(G_5, G_3, G_6, G_1)
poly4 = Poly_G4(F_5, F_2, F_6, F_4)
poly5 = Poly_G4(E_5, E_1, E_6, E_3)
poly6 = Poly_G4(D_5, D_4, D_6, D_2)
poly7 = Poly_G4(C_1, C_4, C_3, C_2)
poly8 = Poly_R6(B_1, B_4, G_5, G_1, D_4, D_5)
poly9 = Poly_R6(D_4, G_1, G_6, C_4, C_1, D_6)
poly10 = Poly_R6(B_2, B_1, D_5, D_2, E_1, E_5)
poly11 = Poly_R6(D_2, D_6, C_1, C_2, E_6, E_1)
poly12 = Poly_R6(B_3, B_2, E_5, E_3, F_2, F_5)
poly13 = Poly_R6(F_2, E_3, E_6, C_2, C_3, F_6)
poly14 = Poly_R6(B_4, B_3, F_5, F_4, G_3, G_5)
poly15 = Poly_R6(F_4, F_6, C_3, C_4, G_6, G_3)
b_5, b_6 = SDLine(D_5, D_2, D_4, E_5)
b_3, b_4 = SDLine(D_5, D_4, B_4, D_2)
b_9, b_{10} = SDLine(D_2, D_6, D_4, C_2)
b_{13}, b_{14} = SDLine(E_1, D_2, B_2, C_2)
b_{15}, b_{16} = SDLine(D_4, G_1, B_1, C_1)
b_7, b_8 = SDLine(D_4, D_6, C_4, D_2)
b_{17}, b_{18} = SDLine(B_2, E_5, D_5, F_5)
b_{19}, b_{20} = SDLine(E_5, E_3, E_6, F_5)
b_{23}, b_{24} = SDLine(E_3, E_6, E_5, F_6)
b_{25}, b_{26} = SDLine(E_1, E_6, C_1, E_3)
b_{21}, b_{22} = SDLine(E_5, E_1, D_5, E_3)
b_{27}, b_{28} = SDLine(G_3, F_4, B_4, C_4)
b_{29}, b_{30} = SDLine(F_2, E_3, B_3, C_3)
b_{31}, b_{32} = SDLine(B_3, F_5, E_5, G_5)
b_{35}, b_{36} = SDLine(G_5, G_1, G_6, B_1)
b_{37}, b_{38} = SDLine(G_1, G_6, G_3, D_6)
b_{41}, b_{42} = SDLine(G_5, G_3, F_5, G_6)
b_{43}, b_{44} = SDLine(G_3, G_6, C_3, G_1)
b_{47}, b_{48} = SDLine(F_5, F_4, F_6, G_5)
b_{49}, b_{50} = SDLine(F_2, F_6, C_2, F_4)
b_{51}, b_{52} = SDLine(F_4, F_6, F_5, G_3)
b_{45}, b_{46} = SDLine(F_5, F_2, B_3, F_4)
b_{53}, b_{54} = SDLine(G_6, C_4, A_3, A_1)
b_1, b_2 = SDLine(B_1, D_5, A_4, A_2)
b_{11}, b_{12} = SDLine(D_6, C_1, A_4, A_2)
b_{39}, b_{40} = SDLine(E_6, C_2, A_1, A_3)
b_{33}, b_{34} = SDLine(B_4, G_5, A_3, A_1)
b_{55}, b_{56} = SDLine(F_6, C_3, A_2, A_4)
b_{57}, b_{58} = SDLine(B_1, B_4, A_5, A_1)
b_{59}, b_{60} = SDLine(B_2, B_1, A_5, A_2)
b_{61}, b_{62} = SDLine(B_3, B_3, A_5, A_3)
b_{63}, b_{64} = SDLine(B_4, B_3, A_5, A_4)
b_{65}, b_{66} = SDLine(B_3, B_2, A_5, A_3)
b_{67}, b_{68} = SDLine(C_4, C_3, A_5, A_6)
b_{69}, b_{70} = SDLine(C_3, C_2, A_5, A_6)
b_{71}, b_{72} = SDLine(C_2, C_1, A_5, A_6)
b_{73}, b_{74} = SDLine(C_1, C_4, A_5, A_6)

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_G4
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: 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_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')