############################################################################ # Geometry of triacontrahedron frame # by Mark M. Thomas ############################################################################ point fZx ( 0.356822088434994 0.000000000000000 0.934172359473823 ) endpoint point fZa ( -0.356822088434994 0.000000000000000 0.934172359473823 ) endpoint point fXy ( 0.934172359473823 0.356822088434994 0.000000000000000 ) endpoint point fXb ( 0.934172359473823 -0.356822088434994 0.000000000000000 ) endpoint point fAy ( -0.934172359473823 0.356822088434994 0.000000000000000 ) endpoint point fAb ( -0.934172359473823 -0.356822088434994 0.000000000000000 ) endpoint point fYz ( 0.000000000000000 0.934172359473823 0.356822088434994 ) endpoint point fYc ( 0.000000000000000 0.934172359473823 -0.356822088434994 ) endpoint point fBz ( 0.000000000000000 -0.934172359473823 0.356822088434994 ) endpoint point fBc ( 0.000000000000000 -0.934172359473823 -0.356822088434994 ) endpoint point fCx ( 0.356822088434994 0.000000000000000 -0.934172359473823 ) endpoint point fCa ( -0.356822088434994 0.000000000000000 -0.934172359473823 ) endpoint point fXYZ ( 0.577350269189626 0.577350269189626 0.577350269189626 ) endpoint point fXBZ ( 0.577350269189626 -0.577350269189626 0.577350269189626 ) endpoint point fAYZ ( -0.577350269189626 0.577350269189626 0.577350269189626 ) endpoint point fABZ ( -0.577350269189626 -0.577350269189626 0.577350269189626 ) endpoint point fXYC ( 0.577350269189626 0.577350269189626 -0.577350269189626 ) endpoint point fXBC ( 0.577350269189626 -0.577350269189626 -0.577350269189626 ) endpoint point fAYC ( -0.577350269189626 0.577350269189626 -0.577350269189626 ) endpoint point fABC ( -0.577350269189626 -0.577350269189626 -0.577350269189626 ) endpoint point Zy ( 0.000000000000000 0.577350269189626 0.934172359473823 ) endpoint point Zb ( 0.000000000000000 -0.577350269189626 0.934172359473823 ) endpoint point Yx ( 0.577350269189626 0.934172359473823 0.000000000000000 ) endpoint point Ya ( -0.577350269189626 0.934172359473823 0.000000000000000 ) endpoint point Bx ( 0.577350269189626 -0.934172359473823 0.000000000000000 ) endpoint point Ba ( -0.577350269189626 -0.934172359473823 0.000000000000000 ) endpoint point Xz ( 0.934172359473823 0.000000000000000 0.577350269189626 ) endpoint point Xc ( 0.934172359473823 0.000000000000000 -0.577350269189626 ) endpoint point Az ( -0.934172359473823 0.000000000000000 0.577350269189626 ) endpoint point Ac ( -0.934172359473823 0.000000000000000 -0.577350269189626 ) endpoint #point Cy ( 0.000000000000000 0.525731114764192 -0.934172359473823 ) endpoint #point Cb ( 0.000000000000000 -0.525731114764192 -0.934172359473823 ) endpoint point Cy ( 0.000000000000000 0.577350269189626 -0.934172359473823 ) endpoint point Cb ( 0.000000000000000 -0.577350269189626 -0.934172359473823 ) endpoint tclupdate { #angle between faces ( /2 ) # set theta .157 #edge length #set edge_length .635385873172 set edge_length .678715949115 #actual thickness set t [expr $slider_thickness * $edge_length / 2] #actual width set w [expr $slider_width * $edge_length / 2] #change in width to make frames fit nicely # tan(theta) set dw [expr $t * .162459848116] #correction for high t, low w set adj 0 set dw1 $dw if {$dw > $w} { # ((w - dw) / tan(theta)) / 2 set adj [expr [expr [expr $w - $dw] / .162459848116] / 2] set dw1 $w } } #crossection 1 points point c11 ( {expr $dw1} {expr [expr $t / -2.0] - $adj} 0.0 ) endpoint point c12 ( {expr $w} {expr [expr $t / -2.0] - $adj} 0.0 ) endpoint point c13 ( {expr $w} {expr $t / 2.0} 0.0 ) endpoint point c14 ( {expr -$dw} {expr $t / 2.0} 0.0 ) endpoint polyline Box1 pointlist (c11 c12 c13 c14) endpolyline crosssection Cross type polyline Box1 endcrosssection tclinit { ### Faces set faces { { fCx Cb fCa Cy fCx} \ { fCx Xc fXBC Cb fCx} \ { fBc Cb fXBC Bx fBc} \ { fBc Ba fABC Cb fBc} \ { fCa Cb fABC Ac fCa} \ { fCa Ac fAYC Cy fCa} \ { fYc Cy fAYC Ya fYc} \ { fYc Yx fXYC Cy fYc} \ { fCx Cy fXYC Xc fCx} \ { fAy Ac fAb Az fAy} \ { fAy Ya fAYC Ac fAy} \ { fAb Ac fABC Ba fAb} \ { fAb Ba fABZ Az fAb} \ { fZa Az fABZ Zb fZa} \ { fZa Zy fAYZ Az fZa} \ { fAy Az fAYZ Ya fAy} \ { fXy Xz fXb Xc fXy} \ { fXb Bx fXBC Xc fXb} \ { fXy Xc fXYC Yx fXy} \ { fXy Yx fXYZ Xz fXy} \ { fZx Xz fXYZ Zy fZx} \ { fZx Zb fXBZ Xz fZx} \ { fXb Xz fXBZ Bx fXb} \ { fBz Ba fBc Bx fBz} \ { fBz Zb fABZ Ba fBz} \ { fBz Bx fXBZ Zb fBz} \ { fYz Yx fYc Ya fYz} \ { fYz Ya fAYZ Zy fYz} \ { fYz Zy fXYZ Yx fYz} \ { fZx Zy fZa Zb fZx} } ### Create a face proc drawFrame { face face_num } { set current_name "face_[subst $face_num]" set current_sweep "sw[subst $face_num]" slide create polyline $current_name \ -pointlist $face } set face_num 0 foreach face $faces { drawFrame $face $face_num incr face_num } } #hack: {expr 1} forces the sweep # to be re-evaluated every frame sweep sw0 path face_0 minimizetorsion 1 closed {expr 1} azimuth 0.0 twist 0.0 endpath crosssection Cross endcrosssection drawpath 1 endsweep sweep sw1 path face_1 minimizetorsion 1 closed {expr 1} azimuth 0.0 twist 0.0 endpath crosssection Cross endcrosssection drawpath 1 endsweep sweep sw2 path face_2 minimizetorsion 1 closed {expr 1} azimuth 0.0 twist 0.0 endpath crosssection Cross endcrosssection drawpath 1 endsweep sweep sw3 path face_3 minimizetorsion 1 closed {expr 1} azimuth 0.0 twist 0.0 endpath crosssection Cross endcrosssection endsweep sweep sw4 path face_4 minimizetorsion 1 closed {expr 1} azimuth 0.0 twist 0.0 endpath crosssection Cross endcrosssection endsweep sweep sw5 path face_5 minimizetorsion 1 closed {expr 1} azimuth 0.0 twist 0.0 endpath crosssection Cross endcrosssection endsweep sweep sw6 path face_6 minimizetorsion 1 closed {expr 1} azimuth 0.0 twist 0.0 endpath crosssection Cross endcrosssection endsweep sweep sw7 path face_7 minimizetorsion 1 closed {expr 1} azimuth 0.0 twist 0.0 endpath crosssection Cross endcrosssection endsweep sweep sw8 path face_8 minimizetorsion 1 closed {expr 1} azimuth 0.0 twist 0.0 endpath crosssection Cross endcrosssection endsweep sweep sw9 path face_9 minimizetorsion 1 closed {expr 1} azimuth 0.0 twist 0.0 endpath crosssection Cross endcrosssection endsweep sweep sw10 path face_10 minimizetorsion 1 closed {expr 1} azimuth 0.0 twist 0.0 endpath crosssection Cross endcrosssection endsweep sweep sw11 path face_11 minimizetorsion 1 closed {expr 1} azimuth 0.0 twist 0.0 endpath crosssection Cross endcrosssection endsweep sweep sw12 path face_12 minimizetorsion 1 closed {expr 1} azimuth 0.0 twist 0.0 endpath crosssection Cross endcrosssection drawpath 1 endsweep sweep sw13 path face_13 minimizetorsion 1 closed {expr 1} azimuth 0.0 twist 0.0 endpath crosssection Cross endcrosssection drawpath 1 endsweep sweep sw14 path face_14 minimizetorsion 1 closed {expr 1} azimuth 0.0 twist 0.0 endpath crosssection Cross endcrosssection drawpath 1 endsweep sweep sw15 path face_15 minimizetorsion 1 closed {expr 1} azimuth 0.0 twist 0.0 endpath crosssection Cross endcrosssection endsweep sweep sw16 path face_16 minimizetorsion 1 closed {expr 1} azimuth 0.0 twist 0.0 endpath crosssection Cross endcrosssection endsweep sweep sw17 path face_17 minimizetorsion 1 closed {expr 1} azimuth 0.0 twist 0.0 endpath crosssection Cross endcrosssection endsweep sweep sw18 path face_18 minimizetorsion 1 closed {expr 1} azimuth 0.0 twist 0.0 endpath crosssection Cross endcrosssection endsweep sweep sw19 path face_19 minimizetorsion 1 closed {expr 1} azimuth 0.0 twist 0.0 endpath crosssection Cross endcrosssection endsweep sweep sw20 path face_20 minimizetorsion 1 closed {expr 1} azimuth 0.0 twist 0.0 endpath crosssection Cross endcrosssection endsweep sweep sw21 path face_21 minimizetorsion 1 closed {expr 1} azimuth 0.0 twist 0.0 endpath crosssection Cross endcrosssection endsweep sweep sw22 path face_22 minimizetorsion 1 closed {expr 1} azimuth 0.0 twist 0.0 endpath crosssection Cross endcrosssection drawpath 1 endsweep sweep sw23 path face_23 minimizetorsion 1 closed {expr 1} azimuth 0.0 twist 0.0 endpath crosssection Cross endcrosssection drawpath 1 endsweep sweep sw24 path face_24 minimizetorsion 1 closed {expr 1} azimuth 0.0 twist 0.0 endpath crosssection Cross endcrosssection drawpath 1 endsweep sweep sw25 path face_25 minimizetorsion 1 closed {expr 1} azimuth 0.0 twist 0.0 endpath crosssection Cross endcrosssection endsweep sweep sw26 path face_26 minimizetorsion 1 closed {expr 1} azimuth 0.0 twist 0.0 endpath crosssection Cross endcrosssection endsweep sweep sw27 path face_27 minimizetorsion 1 closed {expr 1} azimuth 0.0 twist 0.0 endpath crosssection Cross endcrosssection endsweep sweep sw28 path face_28 minimizetorsion 1 closed {expr 1} azimuth 0.0 twist 0.0 endpath crosssection Cross endcrosssection endsweep sweep sw29 path face_29 minimizetorsion 1 closed {expr 1} azimuth 0.0 twist 0.0 endpath crosssection Cross endcrosssection endsweep group the_solid instance sw0 endinstance instance sw1 endinstance instance sw2 endinstance instance sw3 endinstance instance sw4 endinstance instance sw5 endinstance instance sw6 endinstance instance sw7 endinstance instance sw8 endinstance instance sw9 endinstance instance sw10 endinstance instance sw11 endinstance instance sw12 endinstance instance sw13 endinstance instance sw14 endinstance instance sw15 endinstance instance sw16 endinstance instance sw17 endinstance instance sw18 endinstance instance sw19 endinstance instance sw20 endinstance instance sw21 endinstance instance sw22 endinstance instance sw23 endinstance instance sw24 endinstance instance sw25 endinstance instance sw26 endinstance instance sw27 endinstance instance sw28 endinstance instance sw29 endinstance endgroup ############################################################################ # Tcl Sliders ############################################################################ tclinit { set winName .slfWINDOW source SLIDEUI.tcl source MATH.tcl proc CreateSliders { parent name } { set subname "slf_[subst $name]" if { $parent == {} } { set root .$subname } elseif { $parent == "." } { set root .$subname } else { set root $parent.$subname } toplevel $root set width [CreateScale $name $root width "width" 0.25 0.02 1.0 0.01 1 horizontal] set thickness [CreateScale $name $root thickness "thickness" 0.2 0.02 1.0 0.01 1 horizontal] pack $width $thickness -side top -fill x } CreateSliders $winName slider } #################### # CAMERA #################### camera cam projection SLF_PARALLEL frustum ( -10 -10 -100 ) ( 10 10 100 ) endcamera group gCamera instance cam id instCam translate ( 0.0 0.0 1.0 ) endinstance endgroup #################### # LIGHTS #################### light lite type SLF_DIRECTIONAL endlight group gLight instance lite id instLite lookat eye ( 1.0 1.0 1.0 ) target ( 0.0 0.0 0.0 ) up ( 0.0 1.0 0.0 ) endlookat endinstance endgroup light lite2 type SLF_AMBIENT color (0.5 0.5 0.5) endlight group gLight2 instance lite2 id instLite2 endinstance endgroup #################### # RENDER #################### window WINDOW endwindow viewport VIEWPORT WINDOW origin ( 0.0 0.0 ) size ( 1.0 1.0 ) endviewport render VIEWPORT gCamera.instCam.cam the_solid light gLight.instLite.lite light gLight2.instLite2.lite2 endrender