def x040 {
% vertices of the tetrahedron
def p1 (0,0,1)
def p2 (1,0,0)
def p3 (0,1,0)
def p4 (-.3,-.5,-.8)
% faces of the tetrahedron.
polygon(p1)(p2)(p3) % original front polygon
polygon(p1)(p4)(p2) % bottom
polygon(p1)(p3)(p4) % left
polygon(p3)(p2)(p4) % rear
% line to pierce the tetrahedron
line[linecolor=red](-1,-1,-1)(2,2,2)
}
def x042 {
% vertices of the tetrahedron
def p1 (0,0,1)
def p2 (1,0,0)
def p3 (0,1,0)
def p4 (-.3,-.5,-.8)
% faces of the tetrahedron.
polygon(p1)(p2)(p3) % original front polygon
polygon(p1)(p4)(p2) % bottom
polygon(p1)(p3)(p4) % left
polygon(p3)(p2)(p4) % rear
% line to pierce the tetrahedron
line[linecolor=red](-1,-1,-1)(2,2,2)
% labels
special |\footnotesize
\uput{2pt}[ur]#1{$P1$}\uput[r]#2{$P2$}
\uput[u]#3{$P3$}\uput[d]#4{$P4$}|
(p1)(p2)(p3)(p4)
}
def x045 {
def O (0,0,0)
def K [0,0,1]
def n_segs 60
def degrees_per_seg 20
def pitch 3
put { view((20,7,4)) then perspective(22) } {
sweep[cull=false] { n_segs, rotate(10, (O), [K]) then translate(pitch * degrees_per_seg / 360 * [K]) } line[cull=false](-1,0)(1,0)
put { translate([0,2.5,0]) }
sweep[cull=true] { n_segs, rotate(10, (O), [K]) then translate(pitch * degrees_per_seg / 360 * [K]) } line[cull=false](-1,0)(1,0)
}
}
def x050 {
def pierced_tetrahedron {
def p1 (0,0,1) def p2 (1,0,0)
def p3 (0,1,0) def p4 (-.3,-.5,-.8)
% faces of the tetrahedron.
polygon(p1)(p2)(p3) % original
polygon(p1)(p4)(p2) % bottom
polygon(p1)(p3)(p4) % left
polygon[fillcolor=lightgray](p3)(p2)(p4) % rear
line[linecolor=red](-1,-1,-1)(2,2,2)
}
{pierced_tetrahedron} % tetrahedron in original position
put { rotate(90, (0,0,0), [1,0,0]) % copy in new position
then translate([2.5,0,0]) } {pierced_tetrahedron}
}
def x060 {
def pierced_tetrahedron {
def p1 (0,0,1) def p2 (1,0,0)
def p3 (0,1,0) def p4 (-.3,-.5,-.8)
% faces of the tetrahedron.
polygon(p1)(p2)(p3) % original
polygon(p1)(p4)(p2) % bottom
polygon(p1)(p3)(p4) % left
polygon[fillcolor=lightgray](p3)(p2)(p4) % rear
line[linecolor=red](-1,-1,-1)(2,2,2)
}
repeat { 7, rotate(15, (0,0,0), [1,0,0]) % copy in new position
then translate([1.8,0,0]) } {pierced_tetrahedron}
}