# SplitKnot.slf # Final shape of split Moebius band for Snowsculpture for Breckenridge 2005 # CHS 2004/10/1 ################################################################# tclinit { set winName .slfWindow source SLIDEUI.tcl source MATH.tcl set to_rad [expr $SLF_PI/180.0 ] CreateGroupUI $winName gRoot } tclinit { ### SWEEP ASSEMBLY UI proc CreateSweepUI { 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 minTorsion [CreateScale $name $root minTorsion "minTorsion" 1 0 1 1 1 horizontal] set closed [CreateScale $name $root closed "closed" 0 0 1 1 1 horizontal] set azim [CreateScale $name $root azim "azimuth" 90 -180 180 1 1 horizontal] set twst [CreateScale $name $root twst "twist" -368.0 -600 0 0.5 1 horizontal] set drawSweep [CreateScale $name $root drawSweep "drawSweep" 1 0 1 1 1 horizontal] set drawCurve [CreateScale $name $root drawCurve "drawCurve" 0 0 1 1 1 horizontal] set drawControls [CreateScale $name $root drawControls "drawControls" 0 0 1 1 1 horizontal] set slices [CreateScale $name $root slices "slices" 240 0 360 1 1 horizontal] set rot [CreateScale $name $root rot "Z-rot" -25 -300 300 1 1 horizontal] set xshf [CreateScale $name $root xshf "x-shift" -0.00 -1.0 1.0 0.01 1 horizontal] set yshf [CreateScale $name $root yshf "y-shift" -0.22 -1.0 1.0 0.01 1 horizontal] set gLOD [CreateScale $name $root gLOD "global LOD" 3 0 3 1 1 horizontal] pack $slices $rot $xshf $yshf $gLOD -side top -fill x } CreateSweepUI $winName sweep } ### PATH DEFINITION ### tclinit { set winName .slfWindow proc CreateParamUI { parent name } { set subname "slf_[subst $name]" if { $parent == {} } { set root .$subname } elseif { $parent == "." } { set root .$subname } else { set root $parent.$subname } toplevel $root scale $root.a0 -from -180 -to 180 -orient horizontal -resolution 1 -variable a0 global a0 scale $root.ax -from -6 -to 6 -orient horizontal -resolution 0.05 -variable ax global ax scale $root.ay -from -6 -to 6 -orient horizontal -resolution 0.05 -variable ay global ay scale $root.az -from -7 -to 6 -orient horizontal -resolution 0.05 -variable az global az scale $root.b0 -from -180 -to 180 -orient horizontal -resolution 1 -variable b0 global b0 scale $root.bx -from -6 -to 6 -orient horizontal -resolution 0.05 -variable bx global bx scale $root.by -from -6 -to 6 -orient horizontal -resolution 0.05 -variable by global by scale $root.bz -from -7 -to 6 -orient horizontal -resolution 0.05 -variable bz global bz scale $root.c0 -from -180 -to 180 -orient horizontal -resolution 1 -variable c0 global c0 scale $root.cx -from -6 -to 6 -orient horizontal -resolution 0.05 -variable cx global cx scale $root.cy -from -6 -to 6 -orient horizontal -resolution 0.05 -variable cy global cy scale $root.cz -from -6 -to 6 -orient horizontal -resolution 0.05 -variable cz global cz scale $root.d0 -from -180 -to 180 -orient horizontal -resolution 1 -variable d0 global d0 scale $root.dx -from -6 -to 6 -orient horizontal -resolution 0.05 -variable dx global dx scale $root.dy -from -6 -to 6 -orient horizontal -resolution 0.05 -variable dy global dy scale $root.dz -from -6 -to 6 -orient horizontal -resolution 0.05 -variable dz global dz scale $root.e0 -from -180 -to 180 -orient horizontal -resolution 1 -variable e0 global e0 scale $root.ex -from -6 -to 6 -orient horizontal -resolution 0.05 -variable ex global ex scale $root.ey -from -6 -to 6 -orient horizontal -resolution 0.05 -variable ey global ey scale $root.ez -from -6 -to 6 -orient horizontal -resolution 0.05 -variable ez global ez scale $root.f0 -from -180 -to 180 -orient horizontal -resolution 1 -variable f0 global f0 scale $root.fx -from -6 -to 6 -orient horizontal -resolution 0.05 -variable fx global fx scale $root.fy -from -6 -to 6 -orient horizontal -resolution 0.05 -variable fy global fy scale $root.fz -from -7 -to 6 -orient horizontal -resolution 0.05 -variable fz global fz scale $root.g0 -from -180 -to 180 -orient horizontal -resolution 1 -variable g0 global g0 scale $root.gx -from -6 -to 6 -orient horizontal -resolution 0.05 -variable gx global gx scale $root.gy -from -6 -to 6 -orient horizontal -resolution 0.05 -variable gy global gy scale $root.gz -from -7 -to 6 -orient horizontal -resolution 0.05 -variable gz global gz scale $root.h0 -from -180 -to 180 -orient horizontal -resolution 1 -variable h0 global h0 scale $root.hx -from -6 -to 6 -orient horizontal -resolution 0.05 -variable hx global hx scale $root.hy -from -6 -to 6 -orient horizontal -resolution 0.05 -variable hy global hy scale $root.hz -from -6 -to 6 -orient horizontal -resolution 0.05 -variable hz global hz scale $root.i0 -from -180 -to 180 -orient horizontal -resolution 1 -variable i0 global i0 scale $root.ix -from -6 -to 6 -orient horizontal -resolution 0.05 -variable ix global ix scale $root.iy -from -6 -to 6 -orient horizontal -resolution 0.05 -variable iy global iy scale $root.iz -from -6 -to 6 -orient horizontal -resolution 0.05 -variable iz global iz scale $root.j0 -from -180 -to 180 -orient horizontal -resolution 1 -variable j0 global j0 scale $root.jx -from -6 -to 6 -orient horizontal -resolution 0.05 -variable jx global jx scale $root.jy -from -6 -to 6 -orient horizontal -resolution 0.05 -variable jy global jy scale $root.jz -from -6 -to 6 -orient horizontal -resolution 0.05 -variable jz global jz scale $root.k0 -from -180 -to 180 -orient horizontal -resolution 1 -variable k0 global k0 scale $root.kx -from -6 -to 6 -orient horizontal -resolution 0.05 -variable kx global kx scale $root.ky -from -6 -to 6 -orient horizontal -resolution 0.05 -variable ky global ky scale $root.kz -from -7 -to 6 -orient horizontal -resolution 0.05 -variable kz global kz scale $root.l0 -from -180 -to 180 -orient horizontal -resolution 1 -variable l0 global l0 scale $root.lx -from -6 -to 6 -orient horizontal -resolution 0.05 -variable lx global lx scale $root.ly -from -6 -to 6 -orient horizontal -resolution 0.05 -variable ly global ly scale $root.lz -from -7 -to 6 -orient horizontal -resolution 0.05 -variable lz global lz scale $root.m0 -from -180 -to 180 -orient horizontal -resolution 1 -variable m0 global m0 scale $root.mx -from -6 -to 6 -orient horizontal -resolution 0.05 -variable mx global mx scale $root.my -from -6 -to 6 -orient horizontal -resolution 0.05 -variable my global my scale $root.mz -from -6 -to 7 -orient horizontal -resolution 0.05 -variable mz global mz scale $root.n0 -from -180 -to 180 -orient horizontal -resolution 1 -variable n0 global n0 scale $root.nx -from -6 -to 6 -orient horizontal -resolution 0.05 -variable nx global nx scale $root.ny -from -6 -to 6 -orient horizontal -resolution 0.05 -variable ny global ny scale $root.nz -from -6 -to 7 -orient horizontal -resolution 0.05 -variable nz global nz scale $root.o0 -from -180 -to 180 -orient horizontal -resolution 1 -variable o0 global o0 scale $root.ox -from -6 -to 6 -orient horizontal -resolution 0.05 -variable ox global ox scale $root.oy -from -6 -to 6 -orient horizontal -resolution 0.05 -variable oy global oy scale $root.oz -from -6 -to 6 -orient horizontal -resolution 0.05 -variable oz global oz label $root.row1Label -text "Med-loA"; set a0 25; set ax 3.75; set ay -1.50; set az -5.55; label $root.row2Label -text "Med-loB" ; set b0 -5; set bx -0.0; set by -1.1; set bz -5.55 label $root.row3Label -text "Med-hiA" ; set c0 -80; set cx -3.8; set cy -2.0; set cz 3.0 label $root.row4Label -text "Med-hiB"; set d0 -40; set dx -3.5; set dy 2.7; set dz 3.0; label $root.row5Label -text "Med-down"; set e0 -20; set ex -2.0; set ey 4.2; set ez -1.0; label $root.row6Label -text "Shrt-loA"; set f0 -12; set fx -0.5; set fy 4.0; set fz -5.45; label $root.row7Label -text "Shrt-loB"; set g0 -12; set gx 1.4; set gy 1.3; set gz -5.45; label $root.row8Label -text "Shrt-hiA"; set h0 -15; set hx 1.5; set hy 0.0; set hz 0.0; label $root.row9Label -text "Shrt-hiB"; set i0 -20; set ix 1.5; set iy -3.5; set iz 0.0; label $root.row10Label -text "Shrt-down"; set j0 0; set jx -1.0; set jy -4.65; set jz -3.0; label $root.row11Label -text "Tall-loA"; set k0 -12; set kx -3.7; set ky -2.0; set kz -5.35; label $root.row12Label -text "Tall-loB"; set l0 -20; set lx -2.7; set ly 1.7; set lz -5.35; label $root.row13Label -text "Tall-hiA"; set m0 -20; set mx -0.5; set my 1.25; set mz 4.0; label $root.row14Label -text "Tall-hiB"; set n0 -36; set nx 3.7; set ny 1.0; set nz 5.8; label $root.row15Label -text "Tall-down"; set o0 -25; set ox 4.4; set oy -0.4; set oz 0.0; grid $root.row1Label -row 1 -col 0 -padx 10 -pady 10 -sticky e,w grid $root.a0 -row 1 -col 1 grid $root.ax -row 1 -col 2 grid $root.ay -row 1 -col 3 grid $root.az -row 1 -col 4 grid $root.row2Label -row 2 -col 0 -padx 2 -pady 2 -sticky e,w grid $root.b0 -row 2 -col 1 grid $root.bx -row 2 -col 2 grid $root.by -row 2 -col 3 grid $root.bz -row 2 -col 4 grid $root.row3Label -row 3 -col 0 -padx 2 -pady 2 -sticky e,w grid $root.c0 -row 3 -col 1 grid $root.cx -row 3 -col 2 grid $root.cy -row 3 -col 3 grid $root.cz -row 3 -col 4 grid $root.row4Label -row 4 -col 0 -padx 2 -pady 2 -sticky e,w grid $root.d0 -row 4 -col 1 grid $root.dx -row 4 -col 2 grid $root.dy -row 4 -col 3 grid $root.dz -row 4 -col 4 grid $root.row5Label -row 5 -col 0 -padx 2 -pady 2 -sticky e,w grid $root.e0 -row 5 -col 1 grid $root.ex -row 5 -col 2 grid $root.ey -row 5 -col 3 grid $root.ez -row 5 -col 4 grid $root.row6Label -row 6 -col 0 -padx 2 -pady 2 -sticky e,w grid $root.f0 -row 6 -col 1 grid $root.fx -row 6 -col 2 grid $root.fy -row 6 -col 3 grid $root.fz -row 6 -col 4 grid $root.row7Label -row 7 -col 0 -padx 2 -pady 2 -sticky e,w grid $root.g0 -row 7 -col 1 grid $root.gx -row 7 -col 2 grid $root.gy -row 7 -col 3 grid $root.gz -row 7 -col 4 grid $root.row8Label -row 8 -col 0 -padx 2 -pady 2 -sticky e,w grid $root.h0 -row 8 -col 1 grid $root.hx -row 8 -col 2 grid $root.hy -row 8 -col 3 grid $root.hz -row 8 -col 4 grid $root.row9Label -row 9 -col 0 -padx 2 -pady 2 -sticky e,w grid $root.i0 -row 9 -col 1 grid $root.ix -row 9 -col 2 grid $root.iy -row 9 -col 3 grid $root.iz -row 9 -col 4 grid $root.row10Label -row 10 -col 0 -padx 2 -pady 2 -sticky e,w grid $root.j0 -row 10 -col 1 grid $root.jx -row 10 -col 2 grid $root.jy -row 10 -col 3 grid $root.jz -row 10 -col 4 grid $root.row11Label -row 11 -col 0 -padx 10 -pady 10 -sticky e,w grid $root.k0 -row 11 -col 1 grid $root.kx -row 11 -col 2 grid $root.ky -row 11 -col 3 grid $root.kz -row 11 -col 4 grid $root.row12Label -row 12 -col 0 -padx 2 -pady 2 -sticky e,w grid $root.l0 -row 12 -col 1 grid $root.lx -row 12 -col 2 grid $root.ly -row 12 -col 3 grid $root.lz -row 12 -col 4 grid $root.row13Label -row 13 -col 0 -padx 2 -pady 2 -sticky e,w grid $root.m0 -row 13 -col 1 grid $root.mx -row 13 -col 2 grid $root.my -row 13 -col 3 grid $root.mz -row 13 -col 4 grid $root.row14Label -row 14 -col 0 -padx 2 -pady 2 -sticky e,w grid $root.n0 -row 14 -col 1 grid $root.nx -row 14 -col 2 grid $root.ny -row 14 -col 3 grid $root.nz -row 14 -col 4 grid $root.row15Label -row 15 -col 0 -padx 2 -pady 2 -sticky e,w grid $root.o0 -row 15 -col 1 grid $root.ox -row 15 -col 2 grid $root.oy -row 15 -col 3 grid $root.oz -row 15 -col 4 wm geometry $root +10+230 } CreateParamUI $winName param } point pa ({expr $ax} {expr $ay} {expr $az}) endpoint point pb ({expr $bx} {expr $by} {expr $bz}) endpoint point pc ({expr $cx} {expr $cy} {expr $cz}) endpoint point pd ({expr $dx} {expr $dy} {expr $dz}) endpoint point pe ({expr $ex} {expr $ey} {expr $ez}) endpoint point pf ({expr $fx} {expr $fy} {expr $fz}) endpoint point pg ({expr $gx} {expr $gy} {expr $gz}) endpoint point ph ({expr $hx} {expr $hy} {expr $hz}) endpoint point pi ({expr $ix} {expr $iy} {expr $iz}) endpoint point pj ({expr $jx} {expr $jy} {expr $jz}) endpoint point pk ({expr $kx} {expr $ky} {expr $kz}) endpoint point pl ({expr $lx} {expr $ly} {expr $lz}) endpoint point pm ({expr $mx} {expr $my} {expr $mz}) endpoint point pn ({expr $nx} {expr $ny} {expr $nz}) endpoint point po ({expr $ox} {expr $oy} {expr $oz}) endpoint controlpoint ca point pa rotate (0 0 {expr $a0}) endcontrolpoint controlpoint cb point pb rotate (0 0 {expr $b0}) endcontrolpoint controlpoint cc point pc rotate (0 0 {expr $c0}) endcontrolpoint controlpoint cd point pd rotate (0 0 {expr $d0}) endcontrolpoint controlpoint ce point pe rotate (0 0 {expr $e0}) endcontrolpoint controlpoint cf point pf rotate (0 0 {expr $f0}) endcontrolpoint controlpoint cg point pg rotate (0 0 {expr $g0}) endcontrolpoint controlpoint ch point ph rotate (0 0 {expr $h0}) endcontrolpoint controlpoint ci point pi rotate (0 0 {expr $i0}) endcontrolpoint controlpoint cj point pj rotate (0 0 {expr $j0}) endcontrolpoint controlpoint ck point pk rotate (0 0 {expr $k0}) endcontrolpoint controlpoint cl point pl rotate (0 0 {expr $l0}) endcontrolpoint controlpoint cm point pm rotate (0 0 {expr $m0}) endcontrolpoint controlpoint cn point pn rotate (0 0 {expr $n0}) endcontrolpoint controlpoint co point po rotate (0 0 {expr $o0}) endcontrolpoint bsplinecurve bspath order 5 controlpointlist ( cn co ca cb cc cd ce cf cg ch ci cj ck cl cm cn co ca cb ) slices {expr $sweep_slices} drawcontrols {expr $sweep_drawControls} endbsplinecurve ##################################### include "roundCprof.slf" ### defines: pProfile crosssection crossSP type polyline pProfile endcrosssection sweep trefoil_a path bspath minimizetorsion {expr $sweep_minTorsion} closed {expr $sweep_closed} azimuth {expr $sweep_azim} twist {expr $sweep_twst} endpath crosssection crossSP surface WHT endcrosssection crosssection crossSP surface WHT transform rotate (0 0 1) (180) endtransform endcrosssection drawpath {expr $sweep_drawCurve} drawsweep {expr $sweep_drawSweep} endsweep ## snow box 10 x 10 x 12 point sb0 (5 5 6) endpoint point sb3 (5 -5 6) endpoint point sb2 (5 -5 -6) endpoint point sb1 (5 5 -6) endpoint point sb4 (-5 5 6) endpoint point sb7 (-5 -5 6) endpoint point sb6 (-5 -5 -6) endpoint point sb5 (-5 5 -6) endpoint face sf0 (sb0 sb3 sb2 sb1) endface face sf1 (sb4 sb5 sb6 sb7) endface face sf2 (sb0 sb1 sb5 sb4) endface face sf3 (sb1 sb2 sb6 sb5) endface face sf4 (sb2 sb3 sb7 sb6) endface face sf5 (sb3 sb0 sb4 sb7) endface object oSnowBox (sf0 sf1 sf2 sf3 sf4 sf5) solid SLF_HOLLOW endobject # object oGround (sf3) solid SLF_HOLLOW endobject cylinder oDisk thetaslices 60 begincap 1 endcap 1 endcylinder ############################################################################## ############################################################################## group assembly (* instance oSnowBox ## Square PEDESTAL lod {expr $sweep_gLOD} surface YEL scale(1 1 0.04) translate(0 0 -6.04) endinstance *) instance trefoil_a rotate(0 0 1)( {expr $sweep_rot} ) translate({expr $sweep_xshf} {expr $sweep_yshf} 0) endinstance endgroup ########################################################################### surface RED color (1.0 0.5 0.0) endsurface surface MAG color (1.0 0.0 0.5) endsurface surface YEL color (0.8 1.0 0.3) endsurface surface GRN color (0.2 0.9 0.4) endsurface surface WHT color (1 1 1) endsurface light amb type SLF_AMBIENT color (0.2 0.2 0.2) endlight light sun type SLF_DIRECTIONAL color (0.8 0.8 0.8) endlight light anti_sun type SLF_DIRECTIONAL color (0.4 0.4 0.4) endlight group world instance assembly #rotate(1 0 0)(-90) scale ( 0.04 0.04 0.04 ) endinstance instance amb id main_amb endinstance instance sun id front_sun rotate (0 1 0) (-30) rotate (0 0 1) (-45) endinstance instance anti_sun id back_sun rotate (1 0 0) (180) rotate (0 1 0) (-30) rotate (0 0 1) (-45) endinstance endgroup camera cam projection SLF_PARALLEL #projection SLF_PERSPECTIVE #frustum ( -0.1 -0.1 -2.0 ) ( 0.1 0.1 -0.01) frustum ( -0.2 -0.2 -2.0 ) ( 0.2 0.2 -0.01) endcamera group gCam instance cam id iCam translate ( 0.0 0.0 1 ) endinstance endgroup window Window background (0.1 0.3 0.6) endwindow viewport vp Window endviewport render vp gCam.iCam.cam world light world.front_sun.sun light world.back_sun.anti_sun light world.main_amb.amb endrender