# ShellwIOsymPProj.slf
# Path coloring in all shells of the 600-Cell
# I/o symmetry enforced by cobmining option sliders: 
# opposite edges on complementary shells are equally colored.
# -- trying to have single option control for z1+z2 shell
# verify I/O symmetry by parallel projection
# CHS 2004-12-08
########################################

tclinit { 
  source SLIDEUI.tcl

  set winName .slfWINDOW
}

tclinit {
  proc CreatePathUI { parent name } {

    set subname "slf_[subst $name]"

    if { $parent == {} } {
      set root .$subname
    } elseif { $parent == "." } {
      set root .$subname
    } else {
      set root $parent.$subname
    }

    toplevel $root

    label $root.rowpathR1 -text "   RED"
    label $root.rowpathR2 -text "path   "
    radiobutton $root.b0pR -text "-" -variable vispR -value 0 -height 2 
    radiobutton $root.b1pR -text "+    " -variable vispR -value 2  -height 2 
    global vispR
    set vispR 2

    label $root.rowpathC1 -text "  CYAN"
    label $root.rowpathC2 -text "path   "
    radiobutton $root.b0pC -text "-" -variable vispC -value 0 -height 2 
    radiobutton $root.b1pC -text "+    " -variable vispC -value 2  -height 2 
    global vispC
    set vispC 0

    label $root.rowpathG1 -text "   G/M"
    label $root.rowpathG2 -text "path   "
    radiobutton $root.b0pG -text "-" -variable vispG -value 0 -height 2 
    radiobutton $root.b1pG -text "+    " -variable vispG -value 2  -height 2 
    global vispG
    set vispG 0

    label $root.rowpathB1 -text "   B/Y"
    label $root.rowpathB2 -text "path   "
    radiobutton $root.b0pB -text "-" -variable vispB -value 0 -height 2 
    radiobutton $root.b1pB -text "+    " -variable vispB -value 2  -height 2 
    global vispB
    set vispB 0

    label $root.rowb0ALL -text "   Spec"
    label $root.rowb1ALL -text "ALL   "
    radiobutton $root.b0ALL -text "-" -variable visALL -value 0 -height 2 
    radiobutton $root.b1ALL -text "+" -variable visALL -value 2  -height 2 
    global visALL
    set visALL 0

    grid $root.rowpathR1   -row 0 -col 0 -padx 2 -pady 2 -sticky e,w
    grid $root.rowpathR2   -row 0 -col 1 -padx 2 -pady 2 -sticky e,w
    grid $root.b0pR 	-row 1 -col 0    
    grid $root.b1pR 	-row 1 -col 1
    grid $root.rowpathC1   -row 0 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.rowpathC2   -row 0 -col 3 -padx 2 -pady 2 -sticky e,w
    grid $root.b0pC 	-row 1 -col 2    
    grid $root.b1pC 	-row 1 -col 3
    grid $root.rowpathG1   -row 0 -col 4 -padx 2 -pady 2 -sticky e,w
    grid $root.rowpathG2   -row 0 -col 5 -padx 2 -pady 2 -sticky e,w
    grid $root.b0pG 	-row 1 -col 4    
    grid $root.b1pG 	-row 1 -col 5
    grid $root.rowpathB1   -row 0 -col 6 -padx 2 -pady 2 -sticky e,w
    grid $root.rowpathB2   -row 0 -col 7 -padx 2 -pady 2 -sticky e,w
    grid $root.b0pB 	-row 1 -col 6    
    grid $root.b1pB 	-row 1 -col 7
    grid $root.rowb0ALL   -row 0 -col 8 -padx 2 -pady 2 -sticky e,w
    grid $root.rowb1ALL   -row 0 -col 9 -padx 2 -pady 2 -sticky e,w
    grid $root.b0ALL 	-row 1 -col 8    
    grid $root.b1ALL 	-row 1 -col 9

    wm geometry $root +500+20
  }
  CreatePathUI $winName path
}


###  The values set here may get overwritten with the file "options.txt"

tclinit {
  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


    label $root.rowshr -text "SHELL r:"
    scale $root.shr -from 0 -to 11 -orient horizontal -resolution 1 -variable shr
    global shr
    set shr 3
    radiobutton $root.b0r -text "-" -variable visr -value 0 -height 2 
    radiobutton $root.b1r -text "+" -variable visr -value 2  -height 2 
    global visr
    set visr 2

    label $root.rowsht1 -text "SHELL t1:"
    scale $root.sht1 -from 0 -to 11 -orient horizontal -resolution 1 -variable sht1
    global sht1
    set sht1 7
    radiobutton $root.b0t1 -text "-" -variable vist1 -value 0 -height 2 
    radiobutton $root.b1t1 -text "+" -variable vist1 -value 2  -height 2 
    global vist1
    set vist1 2

    label $root.rowsht2 -text "SHELL t2:"
    scale $root.sht2 -from 0 -to 11 -orient horizontal -resolution 1 -variable sht2
    global sht2
    set sht2 9
    radiobutton $root.b0t2 -text "-" -variable vist2 -value 0 -height 2 
    radiobutton $root.b1t2 -text "+" -variable vist2 -value 2  -height 2 
    global vist2
    set vist2 2

    label $root.rowshu -text "SHELL u:"
    scale $root.shu -from 0 -to 11 -orient horizontal -resolution 1 -variable shu
    global shu
    set shu 1
    radiobutton $root.b0u -text "-" -variable visu -value 0 -height 2 
    radiobutton $root.b1u -text "+" -variable visu -value 2  -height 2 
    global visu
    set visu 2

    label $root.rowshv -text "SHELL v:"
    scale $root.shv -from 0 -to 11 -orient horizontal -resolution 1 -variable shv
    global shv
    set shv 3
    radiobutton $root.b0v -text "-" -variable visv -value 0 -height 2 
    radiobutton $root.b1v -text "+" -variable visv -value 2  -height 2 
    global visv
    set visv 2

    label $root.rowshx1 -text "SHELL x1:"
    scale $root.shx1 -from 0 -to 11 -orient horizontal -resolution 1 -variable shx1
    global shx1
    set shx1 6
    radiobutton $root.b0x1 -text "-" -variable visx1 -value 0 -height 2 
    radiobutton $root.b1x1 -text "+" -variable visx1 -value 2  -height 2 
    global visx1
    set visx1 2

    label $root.rowshx2 -text "SHELL x2:"
    scale $root.shx2 -from 0 -to 11 -orient horizontal -resolution 1 -variable shx2
    global shx2
    set shx2 11
    radiobutton $root.b0x2 -text "-" -variable visx2 -value 0 -height 2 
    radiobutton $root.b1x2 -text "+" -variable visx2 -value 2  -height 2 
    global visx2
    set visx2 2

    label $root.rowshy -text "SHELL y:"
    scale $root.shy -from 0 -to 11 -orient horizontal -resolution 1 -variable shy
    global shy
    set shy 7
    radiobutton $root.b0y -text "-" -variable visy -value 0 -height 2 
    radiobutton $root.b1y -text "+" -variable visy -value 2  -height 2 
    global visy
    set visy 2

    label $root.rowshz1 -text "SHELL z1:"
    scale $root.shz1 -from 0 -to 11 -orient horizontal -resolution 1 -variable shz1
    global shz1
    set shz1 5
    radiobutton $root.b0z1 -text "-" -variable visz1 -value 0 -height 2 
    radiobutton $root.b1z1 -text "+" -variable visz1 -value 2  -height 2 
    global visz1
    set visz1 2

    label $root.rowshz2 -text "SHELL z2:"
    scale $root.shz2 -from 0 -to 11 -orient horizontal -resolution 1 -variable shz2
    global shz2
    set shz2 7
    radiobutton $root.b0z2 -text "-" -variable visz2 -value 0 -height 2 
    radiobutton $root.b1z2 -text "+" -variable visz2 -value 2  -height 2 
    global visz2
    set visz2 2



    grid $root.rowshr    -row 1 -col 2 -padx 10 -pady 10 -sticky e,w
    grid $root.shr       -row 1 -col 3
    grid $root.b0r 	-row 1 -col 0    
    grid $root.b1r 	-row 1 -col 1
    grid $root.rowsht1    -row 2 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.sht1       -row 2 -col 3
    grid $root.b0t1 	-row 2 -col 0    
    grid $root.b1t1 	-row 2 -col 1
    grid $root.rowsht2    -row 3 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.sht2       -row 3 -col 3
    grid $root.b0t2 	-row 3 -col 0    
    grid $root.b1t2 	-row 3 -col 1
    grid $root.rowshu    -row 4 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.shu       -row 4 -col 3
    grid $root.b0u 	-row 4 -col 0    
    grid $root.b1u 	-row 4 -col 1
    grid $root.rowshv    -row 5 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.shv       -row 5 -col 3
    grid $root.b0v 	-row 5 -col 0    
    grid $root.b1v 	-row 5 -col 1
    grid $root.rowshx1    -row 6 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.shx1       -row 6 -col 3
    grid $root.b0x1 	-row 6 -col 0    
    grid $root.b1x1 	-row 6 -col 1
    grid $root.rowshx2    -row 7 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.shx2       -row 7 -col 3
    grid $root.b0x2 	-row 7 -col 0    
    grid $root.b1x2 	-row 7 -col 1
    grid $root.rowshy    -row 8 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.shy       -row 8 -col 3
    grid $root.b0y 	-row 8 -col 0    
    grid $root.b1y 	-row 8 -col 1
    grid $root.rowshz1    -row 9 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.shz1       -row 9 -col 3
    grid $root.b0z1 	-row 9 -col 0    
    grid $root.b1z1 	-row 9 -col 1
    grid $root.rowshz2    -row 10 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.shz2       -row 10 -col 3
    grid $root.b0z2 	-row 10 -col 0    
    grid $root.b1z2 	-row 10 -col 1
    
    wm geometry $root +750+150
  }

  CreateParamUI $winName mparam
}


tclinit {
  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

    label $root.rowsha -text "SHELL a:"
    scale $root.sha -from 0 -to 3 -orient horizontal -resolution 1 -variable sha
    global sha
    set sha 0
    radiobutton $root.b0a -text "-" -variable visa -value 0 -height 2 
    radiobutton $root.b1a -text "+" -variable visa -value 2  -height 2 
    global visa
    set visa 2

    label $root.rowshb -text "SHELL b:"
    scale $root.shb -from 0 -to 11 -orient horizontal -resolution 1 -variable shb
    global shb
    set shb 0
    radiobutton $root.b0b -text "-" -variable visb -value 0 -height 2 
    radiobutton $root.b1b -text "+" -variable visb -value 2  -height 2 
    global visb
    set visb 2

    label $root.rowshc -text "SHELL c:"
    scale $root.shc -from 0 -to 11 -orient horizontal -resolution 1 -variable shc
    global shc
    set shc 0
    radiobutton $root.b0c -text "-" -variable visc -value 0 -height 2 
    radiobutton $root.b1c -text "+" -variable visc -value 2  -height 2 
    global visc
    set visc 2

    label $root.rowshd -text "SHELL d:"
    scale $root.shd -from 0 -to 4 -orient horizontal -resolution 1 -variable shd
    global shd
    set shd 0
    radiobutton $root.b0d -text "-" -variable visd -value 0 -height 2 
    radiobutton $root.b1d -text "+" -variable visd -value 2  -height 2 
    global visd
    set visd 2

    label $root.rowshe -text "SHELL e:"
    scale $root.she -from 0 -to 11 -orient horizontal -resolution 1 -variable she
    global she
    set she 0
    radiobutton $root.b0e -text "-" -variable vise -value 0 -height 2 
    radiobutton $root.b1e -text "+" -variable vise -value 2  -height 2 
    global vise
    set vise 2

    label $root.rowshf -text "SHELL f:"
    scale $root.shf -from 0 -to 11 -orient horizontal -resolution 1 -variable shf
    global shf
    set shf 1
    radiobutton $root.b0f -text "-" -variable visf -value 0 -height 2 
    radiobutton $root.b1f -text "+" -variable visf -value 2  -height 2 
    global visf
    set visf 2

    label $root.rowshg -text "SHELL g:"
    scale $root.shg -from 0 -to 11 -orient horizontal -resolution 1 -variable shg
    global shg
    set shg 1
    radiobutton $root.b0g -text "-" -variable visg -value 0 -height 2 
    radiobutton $root.b1g -text "+" -variable visg -value 2  -height 2 
    global visg
    set visg 2

    label $root.rowshh -text "SHELL h:"
    scale $root.shh -from 0 -to 11 -orient horizontal -resolution 1 -variable shh
    global shh
    set shh 1
    radiobutton $root.b0h -text "-" -variable vish -value 0 -height 2 
    radiobutton $root.b1h -text "+" -variable vish -value 2  -height 2 
    global vish
    set vish 2

    label $root.rowshi -text "SHELL i:"
    scale $root.shi -from 0 -to 11 -orient horizontal -resolution 1 -variable shi
    global shi
    set shi 3
    radiobutton $root.b0i -text "-" -variable visi -value 0 -height 2 
    radiobutton $root.b1i -text "+" -variable visi -value 2  -height 2 
    global visi
    set visi 2

    label $root.rowshk -text "SHELL k:"
    scale $root.shk -from 0 -to 11 -orient horizontal -resolution 1 -variable shk
    global shk
    set shk 1
    radiobutton $root.b0k -text "-" -variable visk -value 0 -height 2 
    radiobutton $root.b1k -text "+" -variable visk -value 2  -height 2 
    global visk
    set visk 2

    label $root.rowshl1 -text "SHELL l1:"
    scale $root.shl1 -from 0 -to 11 -orient horizontal -resolution 1 -variable shl1
    global shl1
    set shl1 0
    radiobutton $root.b0l1 -text "-" -variable visl1 -value 0 -height 2 
    radiobutton $root.b1l1 -text "+" -variable visl1 -value 2  -height 2 
    global visl1
    set visl1 2

    label $root.rowshl2 -text "SHELL l2:"
    scale $root.shl2 -from 0 -to 11 -orient horizontal -resolution 1 -variable shl2
    global shl2
    set shl2 3
    radiobutton $root.b0l2 -text "-" -variable visl2 -value 0 -height 2 
    radiobutton $root.b1l2 -text "+" -variable visl2 -value 2  -height 2 
    global visl2
    set visl2 2

    label $root.rowshm -text "SHELL m:"
    scale $root.shm -from 0 -to 11 -orient horizontal -resolution 1 -variable shm
    global shm
    set shm 2
    radiobutton $root.b0m -text "-" -variable vism -value 0 -height 2 
    radiobutton $root.b1m -text "+" -variable vism -value 2  -height 2 
    global vism
    set vism 2

    label $root.rowshn -text "SHELL n:"
    scale $root.shn -from 0 -to 11 -orient horizontal -resolution 1 -variable shn
    global shn
    set shn 2
    radiobutton $root.b0n -text "-" -variable visn -value 0 -height 2 
    radiobutton $root.b1n -text "+" -variable visn -value 2  -height 2 
    global visn
    set visn 2

    label $root.rowsho1 -text "SHELL o1:"
    scale $root.sho1 -from 0 -to 11 -orient horizontal -resolution 1 -variable sho1
    global sho1
    set sho1 0
    radiobutton $root.b0o1 -text "-" -variable viso1 -value 0 -height 2 
    radiobutton $root.b1o1 -text "+" -variable viso1 -value 2  -height 2 
    global viso1
    set viso1 2

    label $root.rowsho2 -text "SHELL o2:"
    scale $root.sho2 -from 0 -to 11 -orient horizontal -resolution 1 -variable sho2
    global sho2
    set sho2 1
    radiobutton $root.b0o2 -text "-" -variable viso2 -value 0 -height 2 
    radiobutton $root.b1o2 -text "+" -variable viso2 -value 2  -height 2 
    global viso2
    set viso2 2

    label $root.rowshp1 -text "SHELL p1:"
    scale $root.shp1 -from 0 -to 11 -orient horizontal -resolution 1 -variable shp1
    global shp1
    set shp1 2
    radiobutton $root.b0p1 -text "-" -variable visp1 -value 0 -height 2 
    radiobutton $root.b1p1 -text "+" -variable visp1 -value 2  -height 2 
    global visp1
    set visp1 2

    label $root.rowshp2 -text "SHELL p2:"
    scale $root.shp2 -from 0 -to 11 -orient horizontal -resolution 1 -variable shp2
    global shp2
    set shp2 2
    radiobutton $root.b0p2 -text "-" -variable visp2 -value 0 -height 2 
    radiobutton $root.b1p2 -text "+" -variable visp2 -value 2  -height 2 
    global visp2
    set visp2 2

    label $root.rowshq -text "SHELL q:"
    scale $root.shq -from 0 -to 11 -orient horizontal -resolution 1 -variable shq
    global shq 
    set shq 5
    radiobutton $root.b0q -text "-" -variable visq -value 0 -height 2 
    radiobutton $root.b1q -text "+" -variable visq -value 2  -height 2 
    global visq
    set visq 2

    label $root.rowshs1 -text "SHELL s1:"
    scale $root.shs1 -from 0 -to 11 -orient horizontal -resolution 1 -variable shs1
    global shs1
    set shs1 3
    radiobutton $root.b0s1 -text "-" -variable viss1 -value 0 -height 2 
    radiobutton $root.b1s1 -text "+" -variable viss1 -value 2  -height 2 
    global viss1
    set viss1 2

    label $root.rowshs2 -text "SHELL s2:"
    scale $root.shs2 -from 0 -to 11 -orient horizontal -resolution 1 -variable shs2
    global shs2
    set shs2 2
    radiobutton $root.b0s2 -text "-" -variable viss2 -value 0 -height 2 
    radiobutton $root.b1s2 -text "+" -variable viss2 -value 2  -height 2 
    global viss2
    set viss2 2

    label $root.rowshw -text "SHELL w:"
    scale $root.shw -from 0 -to 11 -orient horizontal -resolution 1 -variable shw
    global shw
    set shw 6
    radiobutton $root.b0w -text "-" -variable visw -value 0 -height 2 
    radiobutton $root.b1w -text "+" -variable visw -value 2  -height 2 
    global visw
    set visw 2


    grid $root.rowsha    -row 1 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.sha       -row 1 -col 3
    grid $root.b0a 	-row 1 -col 0    
    grid $root.b1a 	-row 1 -col 1
    grid $root.rowshb    -row 2 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.shb       -row 2 -col 3
    grid $root.b0b 	-row 2 -col 0    
    grid $root.b1b 	-row 2 -col 1
    grid $root.rowshc    -row 3 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.shc       -row 3 -col 3
    grid $root.b0c 	-row 3 -col 0    
    grid $root.b1c 	-row 3 -col 1
    grid $root.rowshd    -row 4 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.shd       -row 4 -col 3
    grid $root.b0d 	-row 4 -col 0    
    grid $root.b1d 	-row 4 -col 1
    grid $root.rowshe    -row 5 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.she       -row 5 -col 3
    grid $root.b0e 	-row 5 -col 0    
    grid $root.b1e 	-row 5 -col 1
    grid $root.rowshf    -row 6 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.shf       -row 6 -col 3
    grid $root.b0f 	-row 6 -col 0    
    grid $root.b1f 	-row 6 -col 1
    grid $root.rowshg    -row 7 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.shg       -row 7 -col 3
    grid $root.b0g 	-row 7 -col 0    
    grid $root.b1g 	-row 7 -col 1
    grid $root.rowshh    -row 8 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.shh       -row 8 -col 3
    grid $root.b0h 	-row 8 -col 0    
    grid $root.b1h 	-row 8 -col 1
    grid $root.rowshi    -row 9 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.shi       -row 9 -col 3
    grid $root.b0i 	-row 9 -col 0    
    grid $root.b1i 	-row 9 -col 1
    grid $root.rowshk    -row 10 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.shk       -row 10 -col 3
    grid $root.b0k 	-row 10 -col 0    
    grid $root.b1k 	-row 10 -col 1
    grid $root.rowshl1    -row 11 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.shl1       -row 11 -col 3
    grid $root.b0l1 	-row 11 -col 0    
    grid $root.b1l1 	-row 11 -col 1
    grid $root.rowshl2    -row 12 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.shl2       -row 12 -col 3
    grid $root.b0l2 	-row 12 -col 0    
    grid $root.b1l2 	-row 12 -col 1
    grid $root.rowshm    -row 13 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.shm       -row 13 -col 3
    grid $root.b0m 	-row 13 -col 0    
    grid $root.b1m 	-row 13 -col 1
    grid $root.rowshn    -row 14 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.shn       -row 14 -col 3
    grid $root.b0n 	-row 14 -col 0    
    grid $root.b1n 	-row 14 -col 1
    grid $root.rowsho1    -row 15 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.sho1       -row 15 -col 3
    grid $root.b0o1 	-row 15 -col 0    
    grid $root.b1o1 	-row 15 -col 1
    grid $root.rowsho2    -row 16 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.sho2       -row 16 -col 3
    grid $root.b0o2 	-row 16 -col 0    
    grid $root.b1o2 	-row 16 -col 1
    grid $root.rowshp1    -row 17 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.shp1       -row 17 -col 3
    grid $root.b0p1 	-row 17 -col 0    
    grid $root.b1p1 	-row 17 -col 1
    grid $root.rowshp2    -row 18 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.shp2       -row 18 -col 3
    grid $root.b0p2 	-row 18 -col 0    
    grid $root.b1p2 	-row 18 -col 1
    grid $root.rowshq    -row 19 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.shq       -row 19 -col 3
    grid $root.b0q 	-row 19 -col 0    
    grid $root.b1q 	-row 19 -col 1
    grid $root.rowshs1    -row 20 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.shs1       -row 20 -col 3
    grid $root.b0s1 	-row 20 -col 0    
    grid $root.b1s1 	-row 20 -col 1
    grid $root.rowshs2    -row 21 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.shs2       -row 21 -col 3
    grid $root.b0s2 	-row 21 -col 0    
    grid $root.b1s2 	-row 21 -col 1
    grid $root.rowshw    -row 22 -col 2 -padx 2 -pady 2 -sticky e,w
    grid $root.shw       -row 22 -col 3
    grid $root.b0w 	-row 22 -col 0    
    grid $root.b1w 	-row 22 -col 1
    
    wm geometry $root +1050+80
  }

  CreateParamUI $winName iparam
}

#include "z1z2only.txt"

include "options.txt"  ###  DO NOT CHANGE THE PRESET VALUES ###    


### BASIC GEOMETRIC ELEMENTS ########################

sphere ball
 radius 0.3
 zslices 3
 thetaslices 6
endsphere

crosssection cs
  type circle
  radius 0.04
  slices 6
endcrosssection

######################### Some of the C-600 Points #########################
(*
group balls
# SHELL 14 -- Outermost vertices for reference
instance ball  surface S14  translate ( -5 -5 5 ) endinstance
instance ball  surface S14  translate ( 5 -5 -5 ) endinstance
instance ball  surface S14  translate ( -5 5 -5 ) endinstance
instance ball  surface S14  translate ( 5 5 5 )  endinstance
endgroup


# POINTS
# SHELL 14
point v116 ( -5 -5 5 ) endpoint
point v117 ( 5 -5 -5 ) endpoint
point v118 ( -5 5 -5 ) endpoint
point v119 ( 5 5 5 ) endpoint

# SHELL 13
point v112 ( -3.37630689383837 -3.37630689383837 -3.376293 ) endpoint
point v113 ( 3.37630689383837 -3.37630689383837 3.376293 ) endpoint
point v114 ( -3.37630689383837 3.37630689383837 3.376293 ) endpoint
point v115 ( 3.37630689383837 3.37630689383837 -3.376293 ) endpoint

# SHELL 12
point v106 ( 0 -4 0 ) endpoint
point v107 ( -4 0 0 ) endpoint
point v108 ( 0 0 -4 ) endpoint
point v109 ( 0 0 4 ) endpoint
point v110 ( 4 0 0 ) endpoint
point v111 ( 0 4 0 ) endpoint

# SHELL 11
point v94 ( -2.6735608401714 -2.6735608401714 0.631144 ) endpoint
point v95 ( -0.631141592576895 -2.67355871885106 2.673552 ) endpoint
point v96 ( -2.67355871885106 -0.631141592576895 2.673552 ) endpoint
point v97 ( 0.631141592576896 -2.67355871885106 -2.673552 ) endpoint
point v98 ( -2.67355871885106 0.631141592576896 -2.673552 ) endpoint
point v99 ( 2.6735608401714 -2.6735608401714 -0.631144 ) endpoint
point v100 ( -2.6735608401714 2.6735608401714 -0.631144 ) endpoint
point v101 ( 2.67355871885106 -0.631141592576896 -2.673552 ) endpoint
point v102 ( -0.631141592576896 2.67355871885106 -2.673552 ) endpoint
point v103 ( 2.67355871885106 0.631141592576895 2.673552 ) endpoint
point v104 ( 0.631141592576895 2.67355871885106 2.673552 ) endpoint
point v105 ( 2.6735608401714 2.6735608401714 0.631144 ) endpoint

# SHELL 10
point v82 ( -1.09383196509884 -2.44588801297852 -1.093836 ) endpoint
point v83 ( -2.44588801297852 -1.09383196509884 -1.093836 ) endpoint
point v84 ( -1.09383408641919 -1.09383408641919 -2.445883 ) endpoint
point v85 ( 1.09383196509884 -2.44588801297852 1.093836 ) endpoint
point v86 ( -2.44588801297852 1.09383196509884 1.093836 ) endpoint
point v87 ( 1.09383408641919 -1.09383408641919 2.445883 ) endpoint
point v88 ( -1.09383408641919 1.09383408641919 2.445883 ) endpoint
point v89 ( 2.44588801297852 -1.09383196509884 1.093836 ) endpoint
point v90 ( -1.09383196509884 2.44588801297852 1.093836 ) endpoint
point v91 ( 1.09383408641919 1.09383408641919 -2.445883 ) endpoint
point v92 ( 2.44588801297852 1.09383196509884 -1.093836 ) endpoint
point v93 ( 1.09383196509884 2.44588801297852 -1.093836 ) endpoint

# SHELL 9
point v70 ( -0.559203377086101 -2.36883670835296 0.559207 ) endpoint
point v71 ( -2.36883670835296 -0.559203377086101 0.559207 ) endpoint
point v72 ( 0.559203377086101 -2.36883670835296 -0.559207 ) endpoint
point v73 ( -2.36883670835296 0.559203377086101 -0.559207 ) endpoint
point v74 ( -0.559206205513226 -0.559206205513226 2.368832 ) endpoint
point v75 ( 0.559206205513226 -0.559206205513226 -2.368832 ) endpoint
point v76 ( -0.559206205513226 0.559206205513226 -2.368832 ) endpoint
point v77 ( 0.559206205513226 0.559206205513226 2.368832 ) endpoint
point v78 ( 2.36883670835296 -0.559203377086101 -0.559207 ) endpoint
point v79 ( -0.559203377086101 2.36883670835296 -0.559207 ) endpoint
point v80 ( 2.36883670835296 0.559203377086101 0.559207 ) endpoint
point v81 ( 0.559203377086101 2.36883670835296 0.559207 ) endpoint

# SHELL 8
point v66 ( -1.32275142154696 -1.32275142154696 1.322755 ) endpoint
point v67 ( 1.32275142154696 -1.32275142154696 -1.322755 ) endpoint
point v68 ( -1.32275142154696 1.32275142154696 -1.322755 ) endpoint
point v69 ( 1.32275142154696 1.32275142154696 1.322755 ) endpoint

# SHELL 0
point v0 ( -0.226948749848947 -0.226948749848947 -0.226948 ) endpoint
point v1 ( 0.226948749848947 -0.226948749848947 0.226948 ) endpoint
point v2 ( -0.226948749848947 0.226948749848947 0.226948 ) endpoint
point v3 ( 0.226948749848947 0.226948749848947 -0.226948 ) endpoint
# SHELL 1
point v4 ( -0.394906409370625 -0.394906409370625 0.394905 ) endpoint
point v5 ( 0.394906409370625 -0.394906409370625 -0.394905 ) endpoint
point v6 ( -0.394906409370625 0.394906409370625 -0.394905 ) endpoint
point v7 ( 0.394906409370625 0.394906409370625 0.394905 ) endpoint
# SHELL 2
point v8 ( 5.55111512312578e-17 -0.828426505848286 0.000000 ) endpoint
point v9 ( -0.828426505848286 5.55111512312578e-17 0.000000 ) endpoint
point v10 ( 0 0 -0.828427 ) endpoint
point v11 ( 0 0 0.828427 ) endpoint
point v12 ( 0.828426505848286 -5.55111512312578e-17 0.000000 ) endpoint
point v13 ( -5.55111512312578e-17 0.828426505848286 0.000000 ) endpoint
# SHELL 3
point v14 ( -0.727783290575223 -0.727783290575223 -0.171807 ) endpoint
point v15 ( -0.171807148838458 -0.727785411895567 -0.727784 ) endpoint
point v16 ( -0.727785411895567 -0.171807148838458 -0.727784 ) endpoint
point v17 ( 0.171807148838458 -0.727785411895567 0.727784 ) endpoint
point v18 ( -0.727785411895567 0.171807148838458 0.727784 ) endpoint
point v19 ( 0.727783290575224 -0.727783290575224 0.171807 ) endpoint
point v20 ( -0.727783290575224 0.727783290575224 0.171807 ) endpoint
point v21 ( 0.727785411895567 -0.171807148838458 0.727784 ) endpoint
point v22 ( -0.171807148838458 0.727785411895567 0.727784 ) endpoint
point v23 ( 0.727785411895567 0.171807148838458 -0.727784 ) endpoint
point v24 ( 0.171807148838458 0.727785411895567 -0.727784 ) endpoint
point v25 ( 0.727783290575223 0.727783290575223 -0.171807 ) endpoint
# SHELL 4
point v26 ( -0.522405540193153 -1.16813686698627 0.522408 ) endpoint
point v27 ( -1.16813686698627 -0.522405540193153 0.522408 ) endpoint
point v28 ( -0.522408368620278 -0.522408368620278 1.168138 ) endpoint
point v29 ( 0.522405540193153 -1.16813686698627 -0.522408 ) endpoint
point v30 ( -1.16813686698627 0.522405540193153 -0.522408 ) endpoint
point v31 ( 0.522408368620278 -0.522408368620278 -1.168138 ) endpoint
point v32 ( -0.522408368620278 0.522408368620278 -1.168138 ) endpoint
point v33 ( 1.16813686698627 -0.522405540193153 -0.522408 ) endpoint
point v34 ( -0.522405540193153 1.16813686698627 -0.522408 ) endpoint
point v35 ( 0.522408368620278 0.522408368620278 1.168138 ) endpoint
point v36 ( 1.16813686698627 0.522405540193153 0.522408 ) endpoint
point v37 ( 0.522405540193153 1.16813686698627 0.522408 ) endpoint
# SHELL 5
point v38 ( -0.358645973631379 -1.51925710314548 -0.358648 ) endpoint
point v39 ( -1.51925710314548 -0.358645973631379 -0.358648 ) endpoint
point v40 ( 0.35864597363138 -1.51925710314548 0.358648 ) endpoint
point v41 ( -1.51925710314548 0.35864597363138 0.358648 ) endpoint
point v42 ( -0.358648802058504 -0.358648802058504 -1.519259 ) endpoint
point v43 ( 0.358648802058504 -0.358648802058504 1.519259 ) endpoint
point v44 ( -0.358648802058504 0.358648802058504 1.519259 ) endpoint
point v45 ( 0.358648802058504 0.358648802058504 -1.519259 ) endpoint
point v46 ( 1.51925710314548 -0.35864597363138 0.358648 ) endpoint
point v47 ( -0.35864597363138 1.51925710314548 0.358648 ) endpoint
point v48 ( 1.51925710314548 0.358645973631379 -0.358648 ) endpoint
point v49 ( 0.358645973631379 1.51925710314548 -0.358648 ) endpoint
# SHELL 6
point v50 ( -1.00799485871705 -1.00799485871705 -1.007997 ) endpoint
point v51 ( 1.00799485871705 -1.00799485871705 1.007997 ) endpoint
point v52 ( -1.00799485871705 1.00799485871705 1.007997 ) endpoint
point v53 ( 1.00799485871705 1.00799485871705 -1.007997 ) endpoint

# SHELL 7
point v54 ( -1.41421356237309 -1.41421356237309 0.000000 ) endpoint
point v55 ( 1.11022302462516e-16 -1.41421356237309 -1.414214 ) endpoint
point v56 ( 1.11022302462516e-16 -1.41421356237309 1.414214 ) endpoint
point v57 ( -1.41421356237309 1.11022302462516e-16 -1.414214 ) endpoint
point v58 ( -1.41421356237309 1.11022302462516e-16 1.414214 ) endpoint
point v59 ( 1.4142135623731 -1.4142135623731 0.000000 ) endpoint
point v60 ( -1.4142135623731 1.4142135623731 0.000000 ) endpoint
point v61 ( 1.41421356237309 -1.11022302462516e-16 -1.414214 ) endpoint
point v62 ( 1.41421356237309 -1.11022302462516e-16 1.414214 ) endpoint
point v63 ( -1.11022302462516e-16 1.41421356237309 -1.414214 ) endpoint
point v64 ( -1.11022302462516e-16 1.41421356237309 1.414214 ) endpoint
point v65 ( 1.41421356237309 1.41421356237309 0.000000 ) endpoint
*)

point v0 ( -2  0  0  ) endpoint
point v1 ( -1.61803  -1  -0.618034  ) endpoint
point v2 ( -1.61803  -1  0.618034  ) endpoint
point v3 ( -1.61803  -0.618034  0  ) endpoint
point v4 ( -1.61803  -0.618034  0  ) endpoint
point v5 ( -1.61803  0  -1  ) endpoint
point v6 ( -1.61803  0  -1  ) endpoint
point v7 ( -1.61803  0  1  ) endpoint
point v8 ( -1.61803  0  1  ) endpoint
point v9 ( -1.61803  0.618034  0  ) endpoint
point v10 ( -1.61803  0.618034  0  ) endpoint
point v11 ( -1.61803  1  -0.618034  ) endpoint
point v12 ( -1.61803  1  0.618034  ) endpoint
point v13 ( -1  -1.61803  0  ) endpoint
point v14 ( -1  -1.61803  0  ) endpoint
point v15 ( -1  -1  -1  ) endpoint
point v16 ( -1  -1  -1  ) endpoint
point v17 ( -1  -1  1  ) endpoint
point v18 ( -1  -1  1  ) endpoint
point v19 ( -1  -0.618034  -1.61803  ) endpoint
point v20 ( -1  -0.618034  1.61803  ) endpoint
point v21 ( -1  0  -0.618034  ) endpoint
point v22 ( -1  0  -0.618034  ) endpoint
point v23 ( -1  0  0.618034  ) endpoint
point v24 ( -1  0  0.618034  ) endpoint
point v25 ( -1  0.618034  -1.61803  ) endpoint
point v26 ( -1  0.618034  1.61803  ) endpoint
point v27 ( -1  1  -1  ) endpoint
point v28 ( -1  1  -1  ) endpoint
point v29 ( -1  1  1  ) endpoint
point v30 ( -1  1  1  ) endpoint
point v31 ( -1  1.61803  0  ) endpoint
point v32 ( -1  1.61803  0  ) endpoint
point v33 ( -0.618034  -1.61803  -1  ) endpoint
point v34 ( -0.618034  -1.61803  1  ) endpoint
point v35 ( -0.618034  -1  0  ) endpoint
point v36 ( -0.618034  -1  0  ) endpoint
point v37 ( -0.618034  0  -1.61803  ) endpoint
point v38 ( -0.618034  0  -1.61803  ) endpoint
point v39 ( -0.618034  0  1.61803  ) endpoint
point v40 ( -0.618034  0  1.61803  ) endpoint
point v41 ( -0.618034  1  0  ) endpoint
point v42 ( -0.618034  1  0  ) endpoint
point v43 ( -0.618034  1.61803  -1  ) endpoint
point v44 ( -0.618034  1.61803  1  ) endpoint
point v45 ( 0  -2  0  ) endpoint
point v46 ( 0  -1.61803  -0.618034  ) endpoint
point v47 ( 0  -1.61803  -0.618034  ) endpoint
point v48 ( 0  -1.61803  0.618034  ) endpoint
point v49 ( 0  -1.61803  0.618034  ) endpoint
point v50 ( 0  -1  -1.61803  ) endpoint
point v51 ( 0  -1  -1.61803  ) endpoint
point v52 ( 0  -1  1.61803  ) endpoint
point v53 ( 0  -1  1.61803  ) endpoint
point v54 ( 0  -0.618034  -1  ) endpoint
point v55 ( 0  -0.618034  -1  ) endpoint
point v56 ( 0  -0.618034  1  ) endpoint
point v57 ( 0  -0.618034  1  ) endpoint
point v58 ( 0  0  -2  ) endpoint
point v59 ( 0  0  0  ) endpoint
point v60 ( 0  0  0  ) endpoint
point v61 ( 0  0  2  ) endpoint
point v62 ( 0  0.618034  -1  ) endpoint
point v63 ( 0  0.618034  -1  ) endpoint
point v64 ( 0  0.618034  1  ) endpoint
point v65 ( 0  0.618034  1  ) endpoint
point v66 ( 0  1  -1.61803  ) endpoint
point v67 ( 0  1  -1.61803  ) endpoint
point v68 ( 0  1  1.61803  ) endpoint
point v69 ( 0  1  1.61803  ) endpoint
point v70 ( 0  1.61803  -0.618034  ) endpoint
point v71 ( 0  1.61803  -0.618034  ) endpoint
point v72 ( 0  1.61803  0.618034  ) endpoint
point v73 ( 0  1.61803  0.618034  ) endpoint
point v74 ( 0  2  0  ) endpoint
point v75 ( 0.618034  -1.61803  -1  ) endpoint
point v76 ( 0.618034  -1.61803  1  ) endpoint
point v77 ( 0.618034  -1  0  ) endpoint
point v78 ( 0.618034  -1  0  ) endpoint
point v79 ( 0.618034  0  -1.61803  ) endpoint
point v80 ( 0.618034  0  -1.61803  ) endpoint
point v81 ( 0.618034  0  1.61803  ) endpoint
point v82 ( 0.618034  0  1.61803  ) endpoint
point v83 ( 0.618034  1  0  ) endpoint
point v84 ( 0.618034  1  0  ) endpoint
point v85 ( 0.618034  1.61803  -1  ) endpoint
point v86 ( 0.618034  1.61803  1  ) endpoint
point v87 ( 1  -1.61803  0  ) endpoint
point v88 ( 1  -1.61803  0  ) endpoint
point v89 ( 1  -1  -1  ) endpoint
point v90 ( 1  -1  -1  ) endpoint
point v91 ( 1  -1  1  ) endpoint
point v92 ( 1  -1  1  ) endpoint
point v93 ( 1  -0.618034  -1.61803  ) endpoint
point v94 ( 1  -0.618034  1.61803  ) endpoint
point v95 ( 1  0  -0.618034  ) endpoint
point v96 ( 1  0  -0.618034  ) endpoint
point v97 ( 1  0  0.618034  ) endpoint
point v98 ( 1  0  0.618034  ) endpoint
point v99 ( 1  0.618034  -1.61803  ) endpoint
point v100 ( 1  0.618034  1.61803  ) endpoint
point v101 ( 1  1  -1  ) endpoint
point v102 ( 1  1  -1  ) endpoint
point v103 ( 1  1  1  ) endpoint
point v104 ( 1  1  1  ) endpoint
point v105 ( 1  1.61803  0  ) endpoint
point v106 ( 1  1.61803  0  ) endpoint
point v107 ( 1.61803  -1  -0.618034  ) endpoint
point v108 ( 1.61803  -1  0.618034  ) endpoint
point v109 ( 1.61803  -0.618034  0  ) endpoint
point v110 ( 1.61803  -0.618034  0  ) endpoint
point v111 ( 1.61803  0  -1  ) endpoint
point v112 ( 1.61803  0  -1  ) endpoint
point v113 ( 1.61803  0  1  ) endpoint
point v114 ( 1.61803  0  1  ) endpoint
point v115 ( 1.61803  0.618034  0  ) endpoint
point v116 ( 1.61803  0.618034  0  ) endpoint
point v117 ( 1.61803  1  -0.618034  ) endpoint
point v118 ( 1.61803  1  0.618034  ) endpoint
point v119 ( 2  0  0  ) endpoint

######################### SHELL A:  OUTER TETRAHEDRON #########################

polyline pl307 pointlist ( v116 v117 ) endpolyline ##
polyline pl309 pointlist ( v116 v118 ) endpolyline ##
polyline pl311 pointlist ( v116 v119 ) endpolyline ##
polyline pl415 pointlist ( v117 v118 ) endpolyline ##
polyline pl417 pointlist ( v117 v119 ) endpolyline ##
polyline pl464 pointlist ( v118 v119 ) endpolyline ##

group wiresA
instance pl307 	surface SA endinstance
instance pl309 	surface SA endinstance
instance pl311 	surface SA endinstance
instance pl415 	surface SA endinstance
instance pl417 	surface SA endinstance
instance pl464 	surface SA endinstance
endgroup

# Prototype TETRA EDGE on the +X-face
polyline lineA
  pointlist (v117 v119)
endpolyline
sweep beamA
  path lineA  endpath
  crosssection cs    endcrosssection
endsweep

group protopathA
  lod {expr $visa}
  instance beamA 
    rotate(1 0 0)({expr $sha * 90})  rotate(0 0 1)({expr $sha * 90})  
  endinstance
endgroup


######################## SHELL B:  TRUNC TETRA CORNERS  #######################

polyline pl80 pointlist ( v94 v95 ) endpolyline
polyline pl82 pointlist ( v94 v96 ) endpolyline
polyline pl170 pointlist ( v95 v96 ) endpolyline
polyline pl283 pointlist ( v97 v99 ) endpolyline
polyline pl287 pointlist ( v97 v101 ) endpolyline
polyline pl322 pointlist ( v98 v100 ) endpolyline
polyline pl323 pointlist ( v98 v102 ) endpolyline
polyline pl367 pointlist ( v99 v101 ) endpolyline
polyline pl508 pointlist ( v100 v102 ) endpolyline
polyline pl623 pointlist ( v103 v104 ) endpolyline
polyline pl626 pointlist ( v103 v105 ) endpolyline
polyline pl653 pointlist ( v104 v105 ) endpolyline

group wiresB
instance pl80 	surface SB endinstance
instance pl82 	surface SB endinstance
instance pl170 	surface SB endinstance
instance pl283 	surface SB endinstance
instance pl287 	surface SB endinstance
instance pl322 	surface SB endinstance
instance pl323 	surface SB endinstance
instance pl367 	surface SB endinstance
instance pl508 	surface SB endinstance
instance pl623 	surface SB endinstance
instance pl626 	surface SB endinstance
instance pl653 	surface SB endinstance
endgroup

# Prototype TRUNC TETRA EDGE on X-side edge of {1 1 1} triangle.
polyline lineB
  pointlist (v103 v105)
endpolyline
sweep beamB
  path lineB  endpath
  crosssection cs    endcrosssection
endsweep

group protopathB
  lod {expr $visb}
  instance beamB 
    rotate(0 0 1)({expr 90*( $shb + $shb / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shb + $shb / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shb + $shb / 6 )}) 
  endinstance
  instance beamB 
    rotate(0 0 1)({expr 90*( $shb + $shb / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shb + $shb / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shb + $shb / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shb / 6) ) })    rotate(0 1 0)({expr 90*( pow(-1, $shb / 6) -1) }) 
  endinstance
endgroup

######################## SHELL C:  SMALL FACE TRIANGLE  #######################

polyline pl44 pointlist ( v82 v83 ) endpolyline
polyline pl48 pointlist ( v82 v84 ) endpolyline
polyline pl95 pointlist ( v83 v84 ) endpolyline
polyline pl273 pointlist ( v85 v87 ) endpolyline
polyline pl275 pointlist ( v85 v89 ) endpolyline
polyline pl330 pointlist ( v86 v88 ) endpolyline
polyline pl335 pointlist ( v86 v90 ) endpolyline
polyline pl386 pointlist ( v87 v89 ) endpolyline
polyline pl482 pointlist ( v88 v90 ) endpolyline
polyline pl634 pointlist ( v91 v92 ) endpolyline
polyline pl636 pointlist ( v91 v93 ) endpolyline
polyline pl695 pointlist ( v92 v93 ) endpolyline

group wiresC
instance pl44 	surface SC endinstance
instance pl48 	surface SC endinstance
instance pl95 	surface SC endinstance
instance pl273 	surface SC endinstance
instance pl275 	surface SC endinstance
instance pl330 	surface SC endinstance
instance pl335 	surface SC endinstance
instance pl386 	surface SC endinstance
instance pl482 	surface SC endinstance
instance pl634 	surface SC endinstance
instance pl636 	surface SC endinstance
instance pl695 	surface SC endinstance
endgroup

# Prototype TRUNC TETRA EDGE on X-side edge of {1 1 1} triangle.
polyline lineC
  pointlist (v91 v92)
endpolyline
sweep beamC
  path lineC  endpath
  crosssection cs    endcrosssection
endsweep

group protopathC
  lod {expr $visc}
  instance beamC 
    rotate(0 0 1)({expr 90*( $shc + $shc / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shc + $shc / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shc + $shc / 6 )}) 
  endinstance
  instance beamC 
    rotate(0 0 1)({expr 90*( $shc + $shc / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shc + $shc / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shc + $shc / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shc / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shc / 6) -1) }) 
  endinstance
endgroup

######################## SHELL D:  SHORT TETRA CROSS EDGES  #######################

polyline pl28 pointlist ( v70 v72 ) endpolyline
polyline pl112 pointlist ( v71 v73 ) endpolyline
polyline pl305 pointlist ( v74 v77 ) endpolyline
polyline pl403 pointlist ( v75 v76 ) endpolyline
polyline pl597 pointlist ( v78 v80 ) endpolyline
polyline pl677 pointlist ( v79 v81 ) endpolyline

group wiresD
instance pl28 	surface SD endinstance
instance pl112 	surface SD endinstance
instance pl305 	surface SD endinstance
instance pl403 	surface SD endinstance
instance pl597 	surface SD endinstance
instance pl677 	surface SD endinstance
endgroup

# Prototype SHORT TETRA CROSS EDGE under +X-face
polyline lineD
  pointlist (v78 v80)
endpolyline
sweep beamD
  path lineD  endpath
  crosssection cs    endcrosssection
endsweep

group protopathD
  lod {expr $visd}
  instance beamD 
    rotate(1 0 0)({expr $shd * 90})  rotate(0 0 1)({expr $shd * 90})  
  endinstance
endgroup


######################### SHELL E:  OUTER FACE SPOKES  ##################### 

# Prototype TETRA FACE SPOKE in the (1 1 -1) face for the 111 vertex.
polyline lineE
  pointlist (v119 v115)
endpolyline
sweep beamE
  path lineE  endpath
  crosssection cs    endcrosssection
endsweep

group protopathE
  lod {expr $vise}
  instance beamE 
    rotate(0 0 1)({expr 90*( $she + $she / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $she + $she / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $she + $she / 6 )}) 
  endinstance
  instance beamE 
    rotate(0 0 1)({expr 90*( $she + $she / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $she + $she / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $she + $she / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $she / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $she / 6) -1) }) 
  endinstance 
endgroup

################  SHELL F:  TETRA HALF-EDGES  #######################

# Prototype TETRA HALF-EDGE underneath tetra edge on X-face.
polyline lineF
  pointlist (v119 v110)
endpolyline
sweep beamF
  path lineF  endpath
  crosssection cs    endcrosssection
endsweep

group protopathF
  lod {expr $visf}
  instance beamF 
    rotate(0 0 1)({expr 90*( $shf + $shf / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shf + $shf / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shf + $shf / 6 )}) 
  endinstance
  instance beamF 
    rotate(0 0 1)({expr 90*( $shf + $shf / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shf + $shf / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shf + $shf / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shf / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shf / 6) -1) }) 
  endinstance 
endgroup

######################### SHELL G, 14-11:  NARROW CORNER PYRAMID  ##################### 

polyline lineG
  pointlist (v119 v103)
endpolyline
sweep beamG
  path lineG  endpath
  crosssection cs    endcrosssection
endsweep

group protopathG
  lod {expr $visg}
  instance beamG 
    rotate(0 0 1)({expr 90*( $shg + $shg / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shg + $shg / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shg + $shg / 6 )}) 
  endinstance
  instance beamG 
    rotate(0 0 1)({expr 90*( $shg + $shg / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shg + $shg / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shg + $shg / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shg / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shg / 6) -1) }) 
  endinstance 
endgroup

######################### SHELL H, 13-12:  OUTER CROSS CONNECTORS  ##################### 

polyline lineH
  pointlist (v113 v110)
endpolyline
sweep beamH
  path lineH  endpath
  crosssection cs    endcrosssection
endsweep

group protopathH
  lod {expr $vish}
  instance beamH 
    rotate(0 0 1)({expr 90*( $shh + $shh / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shh + $shh / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shh + $shh / 6 )}) 
  endinstance
  instance beamH 
    rotate(0 0 1)({expr 90*( $shh + $shh / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shh + $shh / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shh + $shh / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shh / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shh / 6) -1) }) 
  endinstance 
endgroup

######################### SHELL I, 13-11:  TRUNC FACE CONNECTORS  ##################### 

polyline lineI
  pointlist (v113 v103)
endpolyline
sweep beamI
  path lineI  endpath
  crosssection cs    endcrosssection
endsweep

group protopathI
  lod {expr $visi}
  instance beamI 
    rotate(0 0 1)({expr 90*( $shi + $shi / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shi + $shi / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shi + $shi / 6 )}) 
  endinstance
  instance beamI 
    rotate(0 0 1)({expr 90*( $shi + $shi / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shi + $shi / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shi + $shi / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shi / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shi / 6) -1) }) 
  endinstance 
endgroup

######################### SHELL K, 13-10:  SMALL FACE PYRAMIDS  ##################### 

polyline lineK
  pointlist (v115 v92)
endpolyline
sweep beamK
  path lineK  endpath
  crosssection cs    endcrosssection
endsweep

group protopathK
  lod {expr $visk}
  instance beamK 
    rotate(0 0 1)({expr 90*( $shk + $shk / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shk + $shk / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shk + $shk / 6 )}) 
  endinstance
  instance beamK 
    rotate(0 0 1)({expr 90*( $shk + $shk / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shk + $shk / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shk + $shk / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shk / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shk / 6) -1) }) 
  endinstance 
endgroup


######### SHELL L1/L2:  The first connector shell with 24 edges  #############################

# Prototype L1-EDGE  underneath the 111-edge.
polyline lineL1
  pointlist (v110 v105)
endpolyline
sweep beamL1
  path lineL1  endpath
  crosssection cs    endcrosssection
endsweep

# Prototype L2-EDGE  underneath the 111-edge; the other one.
polyline lineL2
  pointlist (v110 v103)
endpolyline
sweep beamL2
  path lineL2  endpath
  crosssection cs    endcrosssection
endsweep

group protopathL1
  lod {expr $visl1}
  instance beamL1 
    rotate(0 0 1)({expr 90*( $shl1 + $shl1 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shl1 + $shl1 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shl1 + $shl1 / 6 )}) 
  endinstance
  instance beamL1 
    rotate(0 0 1)({expr 90*( $shl1 + $shl1 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shl1 + $shl1 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shl1 + $shl1 / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shl1 / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shl1 / 6) -1) }) 
  endinstance 
endgroup

group protopathL2
  lod {expr $visl2}
  instance beamL2 
    rotate(0 0 1)({expr 90*( $shl2 + $shl2 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shl2 + $shl2 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shl2 + $shl2 / 6 )}) 
  endinstance
  instance beamL2 
    rotate(0 0 1)({expr 90*( $shl2 + $shl2 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shl2 + $shl2 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shl2 + $shl2 / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shl2 / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shl2 / 6) -1) }) 
  endinstance 
endgroup

######################### SHELL M, 12-10:  TRUNC FACE CROSSCONN. ##################### 

polyline lineM
  pointlist (v110 v89)
endpolyline
sweep beamM
  path lineM  endpath
  crosssection cs    endcrosssection
endsweep

group protopathM
  lod {expr $vism}
  instance beamM 
    rotate(0 0 1)({expr 90*( $shm + $shm / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shm + $shm / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shm + $shm / 6 )}) 
  endinstance
  instance beamM 
    rotate(0 0 1)({expr 90*( $shm + $shm / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shm + $shm / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shm + $shm / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shm / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shm / 6) -1) }) 
  endinstance 
endgroup

######################### SHELL N, 12-9:   ##################### 

polyline lineN
  pointlist (v78 v110)
endpolyline
sweep beamN
  path lineN  endpath
  crosssection cs    endcrosssection
endsweep

group protopathN
  lod {expr $visn}
  instance beamN 
    rotate(0 0 1)({expr 90*( $shn + $shn / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shn + $shn / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shn + $shn / 6 )}) 
  endinstance
  instance beamN 
    rotate(0 0 1)({expr 90*( $shn + $shn / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shn + $shn / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shn + $shn / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shn / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shn / 6) -1) }) 
  endinstance 
endgroup

######### SHELL O1/O2:  Second connector shell with 24 edges  #############################

# Prototype O1-EDGE  underneath the 111-edge.
polyline lineO1
  pointlist (v89 v103)
endpolyline
sweep beamO1
  path lineO1  endpath
  crosssection cs    endcrosssection
endsweep

# Prototype O2-EDGE  underneath the 111-edge; the other one.
polyline lineO2
  pointlist (v87 v103)
endpolyline
sweep beamO2
  path lineO2  endpath
  crosssection cs    endcrosssection
endsweep

group protopathO1
  lod {expr $viso1}
  instance beamO1 
    rotate(0 0 1)({expr 90*( $sho1 + $sho1 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $sho1 + $sho1 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $sho1 + $sho1 / 6 )}) 
  endinstance
  instance beamO1 
    rotate(0 0 1)({expr 90*( $sho1 + $sho1 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $sho1 + $sho1 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $sho1 + $sho1 / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $sho1 / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $sho1 / 6) -1) }) 
  endinstance 
endgroup

group protopathO2
  lod {expr $viso2}
  instance beamO2 
    rotate(0 0 1)({expr 90*( $sho2 + $sho2 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $sho2 + $sho2 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $sho2 + $sho2 / 6 )}) 
  endinstance
  instance beamO2 
    rotate(0 0 1)({expr 90*( $sho2 + $sho2 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $sho2 + $sho2 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $sho2 + $sho2 / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $sho2 / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $sho2 / 6) -1) }) 
  endinstance 
endgroup

######### SHELL P1/P2:  11-9 CONNECTION  #############################

polyline lineP1
  pointlist (v80 v105)
endpolyline
sweep beamP1
  path lineP1  endpath
  crosssection cs    endcrosssection
endsweep

polyline lineP2
  pointlist (v81 v105)
endpolyline
sweep beamP2
  path lineP2  endpath
  crosssection cs    endcrosssection
endsweep

group protopathP1
  lod {expr $visp1}
  instance beamP1 
    rotate(0 0 1)({expr 90*( $shp1 + $shp1 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shp1 + $shp1 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shp1 + $shp1 / 6 )}) 
  endinstance
  instance beamP1 
    rotate(0 0 1)({expr 90*( $shp1 + $shp1 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shp1 + $shp1 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shp1 + $shp1 / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shp1 / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shp1 / 6) -1) }) 
  endinstance 
endgroup

group protopathP2
  lod {expr $visp2}
  instance beamP2 
    rotate(0 0 1)({expr 90*( $shp2 + $shp2 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shp2 + $shp2 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shp2 + $shp2 / 6 )}) 
  endinstance
  instance beamP2 
    rotate(0 0 1)({expr 90*( $shp2 + $shp2 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shp2 + $shp2 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shp2 + $shp2 / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shp2 / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shp2 / 6) -1) }) 
  endinstance 
endgroup

######################### SHELL Q, 11-8:  TRUNC FACE CROSSCONN. ##################### 

polyline lineQ
  pointlist (v103 v69)
endpolyline
sweep beamQ
  path lineQ  endpath
  crosssection cs    endcrosssection
endsweep

group protopathQ
  lod {expr $visq}
  instance beamQ 
    rotate(0 0 1)({expr 90*( $shq + $shq / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shq + $shq / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shq + $shq / 6 )}) 
  endinstance
  instance beamQ 
    rotate(0 0 1)({expr 90*( $shq + $shq / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shq + $shq / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shq + $shq / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shq / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shq / 6) -1) }) 
  endinstance 
endgroup

######### SHELL S1/S2:  10-9 CONNECTION  #############################

polyline lineS1
  pointlist (v80 v92)
endpolyline
sweep beamS1
  path lineS1  endpath
  crosssection cs    endcrosssection
endsweep

polyline lineS2
  pointlist (v78 v92)
endpolyline
sweep beamS2
  path lineS2  endpath
  crosssection cs    endcrosssection
endsweep

group protopathS1
  lod {expr $viss1}
  instance beamS1 
    rotate(0 0 1)({expr 90*( $shs1 + $shs1 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shs1 + $shs1 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shs1 + $shs1 / 6 )}) 
  endinstance
  instance beamS1 
    rotate(0 0 1)({expr 90*( $shs1 + $shs1 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shs1 + $shs1 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shs1 + $shs1 / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shs1 / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shs1 / 6) -1) }) 
  endinstance 
endgroup

group protopathS2
  lod {expr $viss2}
  instance beamS2 
    rotate(0 0 1)({expr 90*( $shs2 + $shs2 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shs2 + $shs2 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shs2 + $shs2 / 6 )}) 
  endinstance
  instance beamS2 
    rotate(0 0 1)({expr 90*( $shs2 + $shs2 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shs2 + $shs2 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shs2 + $shs2 / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shs2 / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shs2 / 6) -1) }) 
  endinstance 
endgroup

######################### SHELL W, 9-8:  TRUNC FACE CROSSCONN. ##################### 

polyline lineW
  pointlist (v80 v69)
endpolyline
sweep beamW
  path lineW  endpath
  crosssection cs    endcrosssection
endsweep

group protopathW
  lod {expr $visw}
  instance beamW 
    rotate(0 0 1)({expr 90*( $shw + $shw / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shw + $shw / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shw + $shw / 6 )}) 
  endinstance
  instance beamW 
    rotate(0 0 1)({expr 90*( $shw + $shw / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shw + $shw / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shw + $shw / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shw / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shw / 6) -1) }) 
  endinstance 
endgroup

######################### SHELL a:  innermost TETRAHEDRON #########################

polyline pl289 pointlist ( v0 v1 ) endpolyline
polyline pl291 pointlist ( v0 v2 ) endpolyline
polyline pl293 pointlist ( v0 v3 ) endpolyline
polyline pl397 pointlist ( v1 v2 ) endpolyline
polyline pl399 pointlist ( v1 v3 ) endpolyline
polyline pl446 pointlist ( v2 v3 ) endpolyline

group wiresa
instance pl289 	surface Sa endinstance
instance pl291 	surface Sa endinstance
instance pl293 	surface Sa endinstance
instance pl397 	surface Sa endinstance
instance pl399 	surface Sa endinstance
instance pl446 	surface Sa endinstance
endgroup

# Prototype TETRA EDGE on the +X-face
polyline linea
  #pointlist (v117 v119)
  pointlist ( v0 v2 ) #291
endpolyline
sweep beama
  path linea  endpath
  crosssection cs    endcrosssection
endsweep

group protopatha
  lod {expr $visa}
  instance beama 
    rotate(1 0 0)({expr $sha * 90})  rotate(0 0 1)({expr $sha * 90})  
  endinstance
endgroup


######################## SHELL b:  TRUNC TETRA CORNERS  #######################

polyline pl55 pointlist ( v14 v15 ) endpolyline
polyline pl57 pointlist ( v14 v16 ) endpolyline
polyline pl163 pointlist ( v15 v16 ) endpolyline
polyline pl276 pointlist ( v17 v19 ) endpolyline
polyline pl281 pointlist ( v17 v21 ) endpolyline
polyline pl315 pointlist ( v18 v20 ) endpolyline
polyline pl317 pointlist ( v18 v22 ) endpolyline
polyline pl348 pointlist ( v19 v21 ) endpolyline
polyline pl492 pointlist ( v20 v22 ) endpolyline
polyline pl619 pointlist ( v23 v24 ) endpolyline
polyline pl621 pointlist ( v23 v25 ) endpolyline
polyline pl647 pointlist ( v24 v25 ) endpolyline

group wiresb
instance pl55 	surface Sb endinstance
instance pl57 	surface Sb endinstance
instance pl163 	surface Sb endinstance
instance pl276 	surface Sb endinstance
instance pl281 	surface Sb endinstance
instance pl315 	surface Sb endinstance
instance pl317 	surface Sb endinstance
instance pl348 	surface Sb endinstance
instance pl492 	surface Sb endinstance
instance pl619 	surface Sb endinstance
instance pl621 	surface Sb endinstance
instance pl647 	surface Sb endinstance
endgroup

# Prototype TRUNC TETRA EDGE on X-side edge of {1 1 1} triangle.
polyline lineb
  #pointlist (v103 v105)
  pointlist ( v14 v16 ) #57
endpolyline
sweep beamb
  path lineb  endpath
  crosssection cs    endcrosssection
endsweep

group protopathb
  lod {expr $visb}
  instance beamb 
    rotate(0 0 1)({expr 90*( $shb + $shb / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shb + $shb / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shb + $shb / 6 )}) 
  endinstance
    ### This transformation produces all possible 12 mappings of an oriented tetrahedron onto itself
    ### (regardless what edge or face that we are starting with).
    ###
    ### The idea here is to have a single slider that produces all the 12 possible legal constellations.
    ### Basically this parameter walks around the tetrahedron in 60 degree steps around the 111-axis.
    ### Thus we have to laternate between pyramid edges and base-edges.
    ### To distinguish between the two we need to flip the edge through 90 degree rotations,
    ### and in addition also tilt it through 70.5 degrees to aling it with the pyramid edges.
    ### 12 steps of that visits all tetra edges twice with opposite orientations.
    ###
    ### The second half-edge is then generated from that position by a flip either around the x- or y-axis.
    ### This transformation produces two legal positions for the second prototype edge in that shell.
    ### All shFer placements of the 2nd prototype edge will lead to illegal (overlapping) colorings.
    ###
    ### To pick exactly one non-redundant set of half-edge combinations we need to know when to flip x or y.
    ### An inspection of the behavior showed that an x-flip for steps "0" thru "5", combined with
    ### a y-flip for steps "7" thru "12" would cover all combinations; step "6" would be left out.
    ### This can be achieved with the integer division by 6 which adds +1 from step 6 on, and also
    ### shifts from the x- to the y-flip at the right moment.
  instance beamb 
    rotate(0 0 1)({expr 90*( $shb + $shb / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shb + $shb / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shb + $shb / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shb / 6) ) })    rotate(0 1 0)({expr 90*( pow(-1, $shb / 6) -1) }) 
  endinstance
endgroup

######################## SHELL c:  SMALL FACE TRIANGLE  #######################

polyline pl35 pointlist ( v26 v27 ) endpolyline
polyline pl40 pointlist ( v26 v28 ) endpolyline
polyline pl88 pointlist ( v27 v28 ) endpolyline
polyline pl268 pointlist ( v29 v31 ) endpolyline
polyline pl269 pointlist ( v29 v33 ) endpolyline
polyline pl325 pointlist ( v30 v32 ) endpolyline
polyline pl329 pointlist ( v30 v34 ) endpolyline
polyline pl379 pointlist ( v31 v33 ) endpolyline
polyline pl476 pointlist ( v32 v34 ) endpolyline
polyline pl638 pointlist ( v35 v36 ) endpolyline
polyline pl640 pointlist ( v35 v37 ) endpolyline
polyline pl691 pointlist ( v36 v37 ) endpolyline

group wiresc
instance pl35 	surface Sc endinstance
instance pl40 	surface Sc endinstance
instance pl88 	surface Sc endinstance
instance pl268 	surface Sc endinstance
instance pl269 	surface Sc endinstance
instance pl325 	surface Sc endinstance
instance pl329 	surface Sc endinstance
instance pl379 	surface Sc endinstance
instance pl476 	surface Sc endinstance
instance pl638 	surface Sc endinstance
instance pl640 	surface Sc endinstance
instance pl691 	surface Sc endinstance
endgroup

# Prototype TRUNC TETRA EDGE on X-side edge of {1 1 1} triangle.
polyline linec
  #pointlist (v91 v92)
  pointlist ( v27 v28 ) #88
endpolyline
sweep beamc
  path linec  endpath
  crosssection cs    endcrosssection
endsweep

group protopathc
  lod {expr $visc}
  instance beamc 
    rotate(0 0 1)({expr 90*( $shc + $shc / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shc + $shc / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shc + $shc / 6 )}) 
  endinstance
  instance beamc 
    rotate(0 0 1)({expr 90*( $shc + $shc / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shc + $shc / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shc + $shc / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shc / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shc / 6) -1) }) 
  endinstance
endgroup

######################## SHELL d:  SHORT TETRA CROSS EDGES  #######################

polyline pl17 pointlist ( v38 v40 ) endpolyline
polyline pl105 pointlist ( v39 v41 ) endpolyline
polyline pl299 pointlist ( v42 v45 ) endpolyline
polyline pl409 pointlist ( v43 v44 ) endpolyline
polyline pl591 pointlist ( v46 v48 ) endpolyline
polyline pl673 pointlist ( v47 v49 ) endpolyline

group wiresd
instance pl17 	surface Sd endinstance
instance pl105 	surface Sd endinstance
instance pl299 	surface Sd endinstance
instance pl409 	surface Sd endinstance
instance pl591 	surface Sd endinstance
instance pl673 	surface Sd endinstance
endgroup

# Prototype SHORT TETRA CROSS EDGE under +X-face
polyline lined
  #pointlist (v78 v80)
  pointlist ( v39 v41 ) #105
endpolyline
sweep beamd
  path lined  endpath
  crosssection cs    endcrosssection
endsweep

group protopathd
  lod {expr $visd}
  instance beamd 
    rotate(1 0 0)({expr $shd * 90})  rotate(0 0 1)({expr $shd * 90})  
  endinstance
endgroup


######################### SHELL e:  OUTER FACE SPOKES  ##################### 

# Prototype TETRA FACE SPOKE in the (1 1 -1) face for the 111 vertex.
polyline linee
  #pointlist (v119 v115)
  pointlist ( v4 v0 ) #180
endpolyline
sweep beame
  path linee  endpath
  crosssection cs    endcrosssection
endsweep

group protopathe
  lod {expr $vise}
  instance beame 
    rotate(0 0 1)({expr 90*( $she + $she / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $she + $she / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $she + $she / 6 )}) 
  endinstance
  instance beame 
    rotate(0 0 1)({expr 90*( $she + $she / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $she + $she / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $she + $she / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $she / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $she / 6) -1) }) 
  endinstance 
endgroup

################  SHELL f:  TETRA HALF-EDGES  #######################

# Prototype TETRA HALF-EDGE underneath tetra edge on X-face.
polyline linef
  #pointlist (v119 v110)
  pointlist ( v9 v0 ) #224
endpolyline
sweep beamf
  path linef  endpath
  crosssection cs    endcrosssection
endsweep

group protopathf
  lod {expr $visf}
  instance beamf 
    rotate(0 0 1)({expr 90*( $shf + $shf / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shf + $shf / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shf + $shf / 6 )}) 
  endinstance
  instance beamf 
    rotate(0 0 1)({expr 90*( $shf + $shf / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shf + $shf / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shf + $shf / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shf / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shf / 6) -1) }) 
  endinstance 
endgroup

######################### SHELL g, 14-11:  NARROW CORNER PYRAMID  ##################### 

polyline lineg
  #pointlist (v119 v103)
  pointlist ( v16 v0 ) #209
endpolyline
sweep beamg
  path lineg  endpath
  crosssection cs    endcrosssection
endsweep

group protopathg
  lod {expr $visg}
  instance beamg 
    rotate(0 0 1)({expr 90*( $shg + $shg / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shg + $shg / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shg + $shg / 6 )}) 
  endinstance
  instance beamg 
    rotate(0 0 1)({expr 90*( $shg + $shg / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shg + $shg / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shg + $shg / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shg / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shg / 6) -1) }) 
  endinstance 
endgroup

######################### SHELL h, 13-12:  OUTER CROSS CONNECTORS  ##################### 

polyline lineh
  #pointlist (v113 v110)
  pointlist ( v9 v6 ) #228
endpolyline
sweep beamh
  path lineh  endpath
  crosssection cs    endcrosssection
endsweep

group protopathh
  lod {expr $vish}
  instance beamh 
    rotate(0 0 1)({expr 90*( $shh + $shh / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shh + $shh / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shh + $shh / 6 )}) 
  endinstance
  instance beamh 
    rotate(0 0 1)({expr 90*( $shh + $shh / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shh + $shh / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shh + $shh / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shh / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shh / 6) -1) }) 
  endinstance 
endgroup

######################### SHELL i, 13-11:  TRUNC FACE CONNECTORS  ##################### 

polyline linei
  #pointlist (v113 v103)
  pointlist ( v16 v6 )
endpolyline
sweep beami
  path linei  endpath
  crosssection cs    endcrosssection
endsweep

group protopathi
  lod {expr $visi}
  instance beami 
    rotate(0 0 1)({expr 90*( $shi + $shi / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shi + $shi / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shi + $shi / 6 )}) 
  endinstance
  instance beami 
    rotate(0 0 1)({expr 90*( $shi + $shi / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shi + $shi / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shi + $shi / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shi / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shi / 6) -1) }) 
  endinstance 
endgroup

######################### SHELL k, 13-10:  SMALL FACE PYRAMIDS  ##################### 

polyline linek
  #pointlist (v115 v92)
  pointlist ( v27 v4 ) #87
endpolyline
sweep beamk
  path linek  endpath
  crosssection cs    endcrosssection
endsweep

group protopathk
  lod {expr $visk}
  instance beamk 
    rotate(0 0 1)({expr 90*( $shk + $shk / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shk + $shk / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shk + $shk / 6 )}) 
  endinstance
  instance beamk 
    rotate(0 0 1)({expr 90*( $shk + $shk / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shk + $shk / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shk + $shk / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shk / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shk / 6) -1) }) 
  endinstance 
endgroup


######### SHELL l1/l2:  The first connector shell with 24 edges  #############################

# Prototype l1-EDGE  underneath the 111-edge.
polyline linel1
  #pointlist (v110 v105)
  pointlist ( v14 v9 ) #58
endpolyline
sweep beaml1
  path linel1  endpath
  crosssection cs    endcrosssection
endsweep

# Prototype l2-EDGE  underneath the 111-edge; the other one.
polyline linel2
  #pointlist (v110 v103)
  pointlist ( v16 v9 ) #207
endpolyline
sweep beaml2
  path linel2  endpath
  crosssection cs    endcrosssection
endsweep

group protopathl1
  lod {expr $visl1}
  instance beaml1 
    rotate(0 0 1)({expr 90*( $shl1 + $shl1 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shl1 + $shl1 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shl1 + $shl1 / 6 )}) 
  endinstance
  instance beaml1 
    rotate(0 0 1)({expr 90*( $shl1 + $shl1 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shl1 + $shl1 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shl1 + $shl1 / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shl1 / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shl1 / 6) -1) }) 
  endinstance 
endgroup

group protopathl2
  lod {expr $visl2}
  instance beaml2 
    rotate(0 0 1)({expr 90*( $shl2 + $shl2 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shl2 + $shl2 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shl2 + $shl2 / 6 )}) 
  endinstance
  instance beaml2 
    rotate(0 0 1)({expr 90*( $shl2 + $shl2 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shl2 + $shl2 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shl2 + $shl2 / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shl2 / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shl2 / 6) -1) }) 
  endinstance 
endgroup

######################### SHELL m, 12-10:  TRUNC FACE CROSSCONN. ##################### 

polyline linem
  #pointlist (v110 v89)
  pointlist ( v9 v30 ) #226
endpolyline
sweep beamm
  path linem  endpath
  crosssection cs    endcrosssection
endsweep

group protopathm
  lod {expr $vism}
  instance beamm 
    rotate(0 0 1)({expr 90*( $shm + $shm / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shm + $shm / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shm + $shm / 6 )}) 
  endinstance
  instance beamm 
    rotate(0 0 1)({expr 90*( $shm + $shm / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shm + $shm / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shm + $shm / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shm / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shm / 6) -1) }) 
  endinstance 
endgroup

######################### SHELL n, 12-9:   ##################### 

polyline linen
  #pointlist (v78 v110)
  pointlist ( v9 v41 ) #223
endpolyline
sweep beamn
  path linen  endpath
  crosssection cs    endcrosssection
endsweep

group protopathn
  lod {expr $visn}
  instance beamn 
    rotate(0 0 1)({expr 90*( $shn + $shn / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shn + $shn / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shn + $shn / 6 )}) 
  endinstance
  instance beamn 
    rotate(0 0 1)({expr 90*( $shn + $shn / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shn + $shn / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shn + $shn / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shn / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shn / 6) -1) }) 
  endinstance 
endgroup

######### SHELL o1/o2:  Second connector shell with 24 edges  #############################

# Prototype o1-EDGE  underneath the 111-edge.
polyline lineo1
  #pointlist (v89 v103)
  pointlist ( v16 v30 ) #211
endpolyline
sweep beamo1
  path lineo1  endpath
  crosssection cs    endcrosssection
endsweep

# Prototype o2-EDGE  underneath the 111-edge; the other one.
polyline lineo2
  #pointlist (v87 v103)
  pointlist ( v16 v32 ) #214
endpolyline
sweep beamo2
  path lineo2  endpath
  crosssection cs    endcrosssection
endsweep

group protopatho1
  lod {expr $viso1}
  instance beamo1 
    rotate(0 0 1)({expr 90*( $sho1 + $sho1 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $sho1 + $sho1 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $sho1 + $sho1 / 6 )}) 
  endinstance
  instance beamo1 
    rotate(0 0 1)({expr 90*( $sho1 + $sho1 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $sho1 + $sho1 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $sho1 + $sho1 / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $sho1 / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $sho1 / 6) -1) }) 
  endinstance 
endgroup

group protopatho2
  lod {expr $viso2}
  instance beamo2 
    rotate(0 0 1)({expr 90*( $sho2 + $sho2 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $sho2 + $sho2 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $sho2 + $sho2 / 6 )}) 
  endinstance
  instance beamo2 
    rotate(0 0 1)({expr 90*( $sho2 + $sho2 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $sho2 + $sho2 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $sho2 + $sho2 / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $sho2 / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $sho2 / 6) -1) }) 
  endinstance 
endgroup

######### SHELL p1/p2:  11-9 CONNECTION  #############################

polyline linep1
  #pointlist (v80 v105)
  pointlist ( v14 v39 ) #53
endpolyline
sweep beamp1
  path linep1  endpath
  crosssection cs    endcrosssection
endsweep

polyline linep2
  #pointlist (v81 v105)
  pointlist ( v38 v14 ) #15
endpolyline
sweep beamp2
  path linep2  endpath
  crosssection cs    endcrosssection
endsweep

group protopathp1
  lod {expr $visp1}
  instance beamp1 
    rotate(0 0 1)({expr 90*( $shp1 + $shp1 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shp1 + $shp1 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shp1 + $shp1 / 6 )}) 
  endinstance
  instance beamp1 
    rotate(0 0 1)({expr 90*( $shp1 + $shp1 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shp1 + $shp1 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shp1 + $shp1 / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shp1 / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shp1 / 6) -1) }) 
  endinstance 
endgroup

group protopathp2
  lod {expr $visp2}
  instance beamp2 
    rotate(0 0 1)({expr 90*( $shp2 + $shp2 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shp2 + $shp2 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shp2 + $shp2 / 6 )}) 
  endinstance
  instance beamp2 
    rotate(0 0 1)({expr 90*( $shp2 + $shp2 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shp2 + $shp2 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shp2 + $shp2 / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shp2 / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shp2 / 6) -1) }) 
  endinstance 
endgroup

######################### SHELL q, 11-8:  TRUNC FACE CROSSCONN. ##################### 

polyline lineq
  #pointlist (v103 v69)
  pointlist ( v50 v16 ) #65
endpolyline
sweep beamq
  path lineq  endpath
  crosssection cs    endcrosssection
endsweep

group protopathq
  lod {expr $visq}
  instance beamq 
    rotate(0 0 1)({expr 90*( $shq + $shq / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shq + $shq / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shq + $shq / 6 )}) 
  endinstance
  instance beamq 
    rotate(0 0 1)({expr 90*( $shq + $shq / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shq + $shq / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shq + $shq / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shq / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shq / 6) -1) }) 
  endinstance 
endgroup

######### SHELL s1/s2:  10-9 CONNECTION  #############################

polyline lines1
  #pointlist (v80 v92)
  pointlist ( v27 v39 ) #85
endpolyline
sweep beams1
  path lines1  endpath
  crosssection cs    endcrosssection
endsweep

polyline lines2
  #pointlist (v78 v92)
  pointlist ( v27 v41 ) endpolyline #91
sweep beams2
  path lines2  endpath
  crosssection cs    endcrosssection
endsweep

group protopaths1
  lod {expr $viss1}
  instance beams1 
    rotate(0 0 1)({expr 90*( $shs1 + $shs1 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shs1 + $shs1 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shs1 + $shs1 / 6 )}) 
  endinstance
  instance beams1 
    rotate(0 0 1)({expr 90*( $shs1 + $shs1 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shs1 + $shs1 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shs1 + $shs1 / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shs1 / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shs1 / 6) -1) }) 
  endinstance 
endgroup

group protopaths2
  lod {expr $viss2}
  instance beams2 
    rotate(0 0 1)({expr 90*( $shs2 + $shs2 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shs2 + $shs2 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shs2 + $shs2 / 6 )}) 
  endinstance
  instance beams2 
    rotate(0 0 1)({expr 90*( $shs2 + $shs2 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shs2 + $shs2 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shs2 + $shs2 / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shs2 / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shs2 / 6) -1) }) 
  endinstance 
endgroup

######################### SHELL w, 9-8:  TRUNC FACE CROSSCONN. ##################### 

polyline linew
  #pointlist (v80 v69)
  pointlist ( v50 v39 ) #61
endpolyline
sweep beamw
  path linew  endpath
  crosssection cs    endcrosssection
endsweep

group protopathw
  lod {expr $visw}
  instance beamw 
    rotate(0 0 1)({expr 90*( $shw + $shw / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shw + $shw / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shw + $shw / 6 )}) 
  endinstance
  instance beamw 
    rotate(0 0 1)({expr 90*( $shw + $shw / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shw + $shw / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shw + $shw / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shw / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shw / 6) -1) }) 
  endinstance 
endgroup

######################## SHELL r:  3-7 CONNECTION  #######################

polyline liner
  pointlist ( v54 v14 ) #4
endpolyline
sweep beamr
  path liner  endpath
  crosssection cs    endcrosssection
endsweep

group protopathr
  lod {expr $visr}
  instance beamr 
    rotate(0 0 1)({expr 90*( $shr + $shr / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shr + $shr / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shr + $shr / 6 )}) 
  endinstance
  instance beamr 
    rotate(0 0 1)({expr 90*( $shr + $shr / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shr + $shr / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shr + $shr / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shr / 6) ) })    rotate(0 1 0)({expr 90*( pow(-1, $shr / 6) -1) }) 
  endinstance
endgroup

######################## SHELL u:  4-8 CONNECTION  #######################

polyline lineu
  pointlist ( v26 v66 ) #34
endpolyline
sweep beamu
  path lineu  endpath
  crosssection cs    endcrosssection
endsweep

group protopathu
  lod {expr $visu}
  instance beamu 
    rotate(0 0 1)({expr 90*( $shu + $shu / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shu + $shu / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shu + $shu / 6 )}) 
  endinstance
  instance beamu 
    rotate(0 0 1)({expr 90*( $shu + $shu / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shu + $shu / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shu + $shu / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shu / 6) ) })    rotate(0 1 0)({expr 90*( pow(-1, $shu / 6) -1) }) 
  endinstance
endgroup

######################## SHELL v:  4-9 CONNECTION  #######################

polyline linev
  pointlist ( v70 v26 ) #23
endpolyline
sweep beamv
  path linev  endpath
  crosssection cs    endcrosssection
endsweep

group protopathv
  lod {expr $visv}
  instance beamv 
    rotate(0 0 1)({expr 90*( $shv + $shv / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shv + $shv / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shv + $shv / 6 )}) 
  endinstance
  instance beamv 
    rotate(0 0 1)({expr 90*( $shv + $shv / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shv + $shv / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shv + $shv / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shv / 6) ) })    rotate(0 1 0)({expr 90*( pow(-1, $shv / 6) -1) }) 
  endinstance
endgroup

######################## SHELL y:  6-7 CONNECTION  #######################

polyline liney
  pointlist ( v54 v50 ) #5
endpolyline
sweep beamy
  path liney  endpath
  crosssection cs    endcrosssection
endsweep

group protopathy
  lod {expr $visy}
  instance beamy 
    rotate(0 0 1)({expr 90*( $shy + $shy / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shy + $shy / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shy + $shy / 6 )}) 
  endinstance
  instance beamy 
    rotate(0 0 1)({expr 90*( $shy + $shy / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shy + $shy / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shy + $shy / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shy / 6) ) })    rotate(0 1 0)({expr 90*( pow(-1, $shy / 6) -1) }) 
  endinstance
endgroup

######################## SHELL Y:  7-8 CONNECTION  #######################

polyline lineY
#  pointlist ( v54 v66 ) #6
  pointlist ( v65 v69 ) #6
endpolyline
sweep beamY
  path lineY  endpath
  crosssection cs    endcrosssection
endsweep

group protopathY
  lod {expr $visy}
  instance beamY 
    rotate(0 0 1)({expr 90*( $shy + $shy / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shy + $shy / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shy + $shy / 6 )}) 
  endinstance
  instance beamY 
    rotate(0 0 1)({expr 90*( $shy + $shy / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shy + $shy / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shy + $shy / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shy / 6) ) })    rotate(0 1 0)({expr 90*( pow(-1, $shy / 6) -1) }) 
  endinstance
endgroup

######################## SHELL V:  5-10 CONNECTION  #######################

polyline lineV
#  pointlist ( v38 v82 ) #14
  pointlist ( v49 v93 ) #14
endpolyline
sweep beamV
  path lineV  endpath
  crosssection cs    endcrosssection
endsweep

group protopathV
  lod {expr $visv}
  instance beamV 
    rotate(0 0 1)({expr 90*( $shv + $shv / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shv + $shv / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shv + $shv / 6 )}) 
  endinstance
  instance beamV 
    rotate(0 0 1)({expr 90*( $shv + $shv / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shv + $shv / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shv + $shv / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shv / 6) ) })    rotate(0 1 0)({expr 90*( pow(-1, $shv / 6) -1) }) 
  endinstance
endgroup

######################## SHELL U:  6-10 CONNECTION  #######################

polyline lineU
#  pointlist ( v82 v50 ) #42
  pointlist ( v93 v53 ) #42
endpolyline
sweep beamU
  path lineU  endpath
  crosssection cs    endcrosssection
endsweep

group protopathU
  lod {expr $visu}
  instance beamU 
    rotate(0 0 1)({expr 90*( $shu + $shu / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shu + $shu / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shu + $shu / 6 )}) 
  endinstance
  instance beamU 
    rotate(0 0 1)({expr 90*( $shu + $shu / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shu + $shu / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shu + $shu / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shu / 6) ) })    rotate(0 1 0)({expr 90*( pow(-1, $shu / 6) -1) }) 
  endinstance
endgroup

######################## SHELL R:  7-11 CONNECTION  #######################

polyline lineR
#  pointlist ( v54 v94 ) #7
  pointlist ( v65 v105 ) #7
endpolyline
sweep beamR
  path lineR  endpath
  crosssection cs    endcrosssection
endsweep

group protopathR
  lod {expr $visr}
  instance beamR 
    rotate(0 0 1)({expr 90*( $shr + $shr / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shr + $shr / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shr + $shr / 6 )}) 
  endinstance
  instance beamR 
    rotate(0 0 1)({expr 90*( $shr + $shr / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shr + $shr / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shr + $shr / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shr / 6) ) })    rotate(0 1 0)({expr 90*( pow(-1, $shr / 6) -1) }) 
  endinstance
endgroup


######### SHELL t1/t2:  4-7 CONNECTIONS  #############################

polyline linet1
  pointlist ( v54 v26 ) #2
endpolyline
sweep beamt1
  path linet1  endpath
  crosssection cs    endcrosssection
endsweep

polyline linet2
  pointlist ( v54 v27 ) #8
endpolyline
sweep beamt2
  path linet2  endpath
  crosssection cs    endcrosssection
endsweep

group protopatht1
  lod {expr $vist1}
  instance beamt1 
    rotate(0 0 1)({expr 90*( $sht1 + $sht1 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $sht1 + $sht1 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $sht1 + $sht1 / 6 )}) 
  endinstance
  instance beamt1 
    rotate(0 0 1)({expr 90*( $sht1 + $sht1 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $sht1 + $sht1 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $sht1 + $sht1 / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $sht1 / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $sht1 / 6) -1) }) 
  endinstance 
endgroup

group protopatht2
  lod {expr $vist2}
  instance beamt2 
    rotate(0 0 1)({expr 90*( $sht2 + $sht2 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $sht2 + $sht2 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $sht2 + $sht2 / 6 )}) 
  endinstance
  instance beamt2 
    rotate(0 0 1)({expr 90*( $sht2 + $sht2 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $sht2 + $sht2 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $sht2 + $sht2 / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $sht2 / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $sht2 / 6) -1) }) 
  endinstance 
endgroup

######### SHELL x1/x2:  5-7 CONNECTIONS  #############################

polyline linex1
  pointlist ( v54 v38 ) #0
endpolyline
sweep beamx1
  path linex1  endpath
  crosssection cs    endcrosssection
endsweep

polyline linex2
  pointlist ( v54 v39 ) #10
endpolyline
sweep beamx2
  path linex2  endpath
  crosssection cs    endcrosssection
endsweep

group protopathx1
  lod {expr $visx1}
  instance beamx1 
    rotate(0 0 1)({expr 90*( $shx1 + $shx1 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shx1 + $shx1 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shx1 + $shx1 / 6 )}) 
  endinstance
  instance beamx1 
    rotate(0 0 1)({expr 90*( $shx1 + $shx1 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shx1 + $shx1 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shx1 + $shx1 / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shx1 / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shx1 / 6) -1) }) 
  endinstance 
endgroup

group protopathx2
  lod {expr $visx2}
  instance beamx2 
    rotate(0 0 1)({expr 90*( $shx2 + $shx2 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shx2 + $shx2 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shx2 + $shx2 / 6 )}) 
  endinstance
  instance beamx2 
    rotate(0 0 1)({expr 90*( $shx2 + $shx2 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shx2 + $shx2 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shx2 + $shx2 / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shx2 / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shx2 / 6) -1) }) 
  endinstance 
endgroup

######### SHELL z1/z2:  5-9 CONNECTIONS  #############################

polyline linez1
  pointlist ( v43 v74 ) 
endpolyline
sweep beamz1
  path linez1  endpath
  crosssection cs    endcrosssection
endsweep

polyline linez2
  pointlist ( v43 v77 ) 
endpolyline
sweep beamz2
  path linez2  endpath
  crosssection cs    endcrosssection
endsweep

polyline linez1opp
  pointlist ( v45 v76 )  
endpolyline
sweep beamz1opp
  path linez1opp  endpath
  crosssection cs    endcrosssection
endsweep

polyline linez2opp
  pointlist ( v42 v76 )  
endpolyline
sweep beamz2opp
  path linez2opp  endpath
  crosssection cs    endcrosssection
endsweep

group protopathz1z2
  lod {expr $visz1}
  instance beamz1 
    rotate(0 0 1)({expr -90*( $shz1 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, $shz1) -1) }) 
    rotate(1 1 1)({expr 180*$shz1}) 
  endinstance
  instance beamz2 
    rotate(0 0 1)({expr -90*( $shz1 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, $shz1) -1) }) 
    rotate(1 1 1)({expr 180*$shz1}) 
  endinstance
endgroup

group protopathz1z2opp
  lod {expr $visz1}
  instance beamz1opp
    rotate(0 0 1)({expr -90*( $shz1 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, $shz1) -1) }) 
    rotate(1 1 1)({expr 180*$shz1}) 
  endinstance 
  instance beamz2opp
    rotate(0 0 1)({expr -90*( $shz1 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, $shz1) -1) }) 
    rotate(1 1 1)({expr 180*$shz1}) 
  endinstance 
endgroup


polyline pl12 pointlist ( v38 v70 ) endpolyline
polyline pl18 pointlist ( v38 v72 ) endpolyline
polyline pl27 pointlist ( v70 v40 ) endpolyline
polyline pl101 pointlist ( v39 v71 ) endpolyline
polyline pl106 pointlist ( v39 v73 ) endpolyline
polyline pl111 pointlist ( v71 v41 ) endpolyline
polyline pl114 pointlist ( v40 v72 ) endpolyline
polyline pl251 pointlist ( v41 v73 ) endpolyline
polyline pl295 pointlist ( v42 v75 ) endpolyline
polyline pl297 pointlist ( v42 v76 ) endpolyline
polyline pl301 pointlist ( v74 v43 ) endpolyline
polyline pl303 pointlist ( v74 v44 ) endpolyline
polyline pl405 pointlist ( v75 v45 ) endpolyline
polyline pl411 pointlist ( v43 v77 ) endpolyline
polyline pl452 pointlist ( v76 v45 ) endpolyline
polyline pl458 pointlist ( v44 v77 ) endpolyline
polyline pl588 pointlist ( v46 v78 ) endpolyline
polyline pl592 pointlist ( v46 v80 ) endpolyline
polyline pl596 pointlist ( v78 v48 ) endpolyline
polyline pl671 pointlist ( v47 v79 ) endpolyline
polyline pl674 pointlist ( v47 v81 ) endpolyline
polyline pl676 pointlist ( v79 v49 ) endpolyline
polyline pl678 pointlist ( v48 v80 ) endpolyline
polyline pl717 pointlist ( v49 v81 ) endpolyline

group wiresZ
instance pl12 	  endinstance
instance pl18 	  endinstance
instance pl27 	  endinstance
instance pl101 	  endinstance
instance pl106 	  endinstance
instance pl111 	  endinstance
instance pl114 	  endinstance
instance pl251 	  endinstance
instance pl295 	  endinstance
instance pl297 	  endinstance
instance pl301 	  endinstance
instance pl303 	  endinstance
instance pl405 	  endinstance
instance pl411 	  endinstance
instance pl452 	  endinstance
instance pl458 	  endinstance
instance pl588 	  endinstance
instance pl592 	  endinstance
instance pl596 	  endinstance
instance pl671 	  endinstance
instance pl674 	  endinstance
instance pl676 	  endinstance
instance pl678 	  endinstance
instance pl717 	  endinstance
endgroup

######### SHELL X1/X2:  7-9 CONNECTIONS  #############################

polyline lineX1
#  pointlist ( v54 v70 ) #1
  pointlist ( v65 v81 ) #1
endpolyline
sweep beamX1
  path lineX1  endpath
  crosssection cs    endcrosssection
endsweep

polyline lineX2
#  pointlist ( v54 v71 ) #11
  pointlist ( v65 v80 ) #11
endpolyline
sweep beamX2
  path lineX2  endpath
  crosssection cs    endcrosssection
endsweep

group protopathX1
  lod {expr $visx1}
  instance beamX1 
    rotate(0 0 1)({expr 90*( $shx1 + $shx1 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shx1 + $shx1 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shx1 + $shx1 / 6 )}) 
  endinstance
  instance beamX1 
    rotate(0 0 1)({expr 90*( $shx1 + $shx1 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shx1 + $shx1 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shx1 + $shx1 / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shx1 / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shx1 / 6) -1) }) 
  endinstance 
endgroup

group protopathX2
  lod {expr $visx2}
  instance beamX2 
    rotate(0 0 1)({expr 90*( $shx2 + $shx2 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shx2 + $shx2 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shx2 + $shx2 / 6 )}) 
  endinstance
  instance beamX2 
    rotate(0 0 1)({expr 90*( $shx2 + $shx2 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $shx2 + $shx2 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $shx2 + $shx2 / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $shx2 / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $shx2 / 6) -1) }) 
  endinstance 
endgroup

######### SHELL T1/T2:  7-10 CONNECTIONS  #############################

polyline lineT1
#  pointlist ( v54 v82 ) #3
  pointlist ( v65 v93 ) #3
endpolyline
sweep beamT1
  path lineT1  endpath
  crosssection cs    endcrosssection
endsweep

polyline lineT2
#  pointlist ( v54 v83 ) #9
  pointlist ( v65 v92 ) #9
endpolyline
sweep beamT2
  path lineT2  endpath
  crosssection cs    endcrosssection
endsweep

group protopathT1
  lod {expr $vist1}
  instance beamT1 
    rotate(0 0 1)({expr 90*( $sht1 + $sht1 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $sht1 + $sht1 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $sht1 + $sht1 / 6 )}) 
  endinstance
  instance beamT1 
    rotate(0 0 1)({expr 90*( $sht1 + $sht1 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $sht1 + $sht1 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $sht1 + $sht1 / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $sht1 / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $sht1 / 6) -1) }) 
  endinstance 
endgroup

group protopathT2
  lod {expr $vist2}
  instance beamT2 
    rotate(0 0 1)({expr 90*( $sht2 + $sht2 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $sht2 + $sht2 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $sht2 + $sht2 / 6 )}) 
  endinstance
  instance beamT2 
    rotate(0 0 1)({expr 90*( $sht2 + $sht2 / 6 )}) 
    rotate(1 -1 0)({expr -35.26*( pow(-1, ( $sht2 + $sht2 / 6 )) -1) }) 
    rotate(1 1 1)({expr 60*( $sht2 + $sht2 / 6 )}) 
    rotate(1 0 0)({expr 90*( 1 + pow(-1, $sht2 / 6) ) })   rotate(0 1 0)({expr 90*( pow(-1, $sht2 / 6) -1) }) 
  endinstance 
endgroup


###############################################################
group protogroupO
  instance protopathA  endinstance
  instance protopathB  endinstance
  instance protopathC  endinstance
  instance protopathD  endinstance
  instance protopathE  endinstance
  instance protopathF  endinstance
  instance protopathG  endinstance
  instance protopathH  endinstance
  instance protopathI  endinstance
  instance protopathK  endinstance
  instance protopathL1  endinstance
  instance protopathL2  endinstance
  instance protopathM  endinstance
  instance protopathN  endinstance
  instance protopathO1  endinstance
  instance protopathO2  endinstance
  instance protopathP1  endinstance
  instance protopathP2  endinstance
  instance protopathQ  endinstance
  instance protopathR  endinstance
  instance protopathS1  endinstance
  instance protopathS2  endinstance
  instance protopathT1  endinstance
  instance protopathT2  endinstance
  instance protopathU  endinstance
  instance protopathV  endinstance
  instance protopathW  endinstance
  instance protopathX1  endinstance
  instance protopathX2  endinstance
  instance protopathY  endinstance
endgroup
group protogroupZ
  instance protopathz1z2  surface Y endinstance
  instance protopathz1z2opp  surface G scale (-1.01 -1.01 -1.01) endinstance
endgroup
group protogroupI
  instance protopatha  endinstance
  instance protopathb  endinstance
  instance protopathc  endinstance
  instance protopathd  endinstance
  instance protopathe  endinstance
  instance protopathf  endinstance
  instance protopathg  endinstance
  instance protopathh  endinstance
  instance protopathi  endinstance
  instance protopathk  endinstance
  instance protopathl1  endinstance
  instance protopathl2  endinstance
  instance protopathm  endinstance
  instance protopathn  endinstance
  instance protopatho1  endinstance
  instance protopatho2  endinstance
  instance protopathp1  endinstance
  instance protopathp2  endinstance
  instance protopathq  endinstance
  instance protopathr  endinstance
  instance protopaths1  endinstance
  instance protopaths2  endinstance
  instance protopatht1  endinstance
  instance protopatht2  endinstance
  instance protopathu  endinstance
  instance protopathv  endinstance
  instance protopathw  endinstance
  instance protopathx1  endinstance
  instance protopathx2  endinstance
  instance protopathy  endinstance
endgroup

group protopath
  instance protogroupO   surface R  lod {expr $vispR}    endinstance
  instance protogroupI   surface B  lod {expr $visALL}  scale (-1.01 -1.01 -1.01)  endinstance
  instance protogroupZ     endinstance
endgroup


# VERTEX COLORS
surface S14 color (0.5 0.5 0.5) endsurface

# EDGE COLORS -- INTRASHELLS
surface SA color (0.2 0.2 0.2) endsurface
surface SB color (0.5 0.1 0.1) endsurface
surface SC color (0.1 0.5 0.1) endsurface
surface SD color (0.1 0.1 0.5) endsurface
surface Sa color (0.4 0.4 0.4) endsurface
surface Sb color (0.9 0.2 0.2) endsurface
surface Sc color (0.2 0.9 0.2) endsurface
surface Sd color (0.2 0.2 0.9) endsurface

# COLORS for PATH COPIES
surface R color (1.0 0.2 0.0) endsurface #= prototype
surface Y color (1.0 1.0 0.0) endsurface
surface C color (0.0 1.0 1.0) endsurface
surface B color (0 0 1.0) endsurface
surface G color (0 1 0) endsurface
surface M color (0.8 0.0 1.0) endsurface

group assembly
##  instance balls  endinstance
(*
  instance wiresA  endinstance
  instance wiresB  endinstance 
  instance wiresC  endinstance 
  instance wiresD  endinstance 
  instance wiresa  endinstance
  instance wiresb  endinstance 
  instance wiresc  endinstance 
  instance wiresd  endinstance 
*)
  instance wiresZ  endinstance 

  instance protopath  endinstance

##  These transformations are not valid with this projection !
(*
  instance protopath  surface G  lod {expr $vispG}  rotate(1 1 1)(120)  endinstance
  instance protopath  surface B  lod {expr $vispB}  rotate(1 1 1)(-120) endinstance
  instance protopath  surface C  lod {expr $vispC}  rotate(0 0 1)(180)  endinstance
  instance protopath  surface M  lod {expr $vispG}  rotate(0 0 1)(180) rotate(1 1 1)(120) endinstance
  instance protopath  surface Y  lod {expr $vispB}  rotate(0 0 1)(180) rotate(1 1 1)(-120) endinstance 
*)
endgroup


################ ILLUMINATION, VIEWING, RENDERING ###################################
group World
  instance assembly
    scale (0.04 0.04 0.04)
  endinstance
endgroup

camera cam
  projection SLF_PARALLEL
  #projection SLF_PERSPECTIVE
  frustum (-0.1 -0.1 -2) (0.1 0.1 -0.1)
endcamera

group gCamera
  instance cam
    id instCam
    translate (0.0 0.0 1.0)
  endinstance
endgroup

#### LIGHT
light lite
  type SLF_DIRECTIONAL
endlight

group gLight0
  instance lite
    id instLite0
    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

group gLight1
  instance lite
    id instLite1
    lookat
      eye (-1.0 -1.0 0.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.3 0.3 0.3)
endlight

group gLight2
  instance lite2
    id instLite2
  endinstance
endgroup

#### RENDER

window WINDOW
  background (1 1 1)
endwindow

viewport VIEWPORT WINDOW
  origin (0.0 0.0)
  size (1.0 1.0)
endviewport

render VIEWPORT gCamera.instCam.cam World
  light gLight0.instLite0.lite
  light gLight1.instLite1.lite
  light gLight2.instLite2.lite2
endrender

######################################################################