Frusta

Check-in [ad37e479e2]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Started machine exercise code generator
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:ad37e479e2b308941e9bbab844e173cdb7f60ada
User & Date: rmelton 2013-10-22 00:19:40
Context
2013-10-22
00:27
Added circle exercise check-in: d5150d3425 user: rmelton tags: trunk
00:19
Started machine exercise code generator check-in: ad37e479e2 user: rmelton tags: trunk
2013-10-21
19:44
Started version based code organization check-in: 0500cfac44 user: rmelton tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added kits/Canvas3d/libCanvas3d1.0_x86_64.so.

cannot compute difference between binary files

Changes to kits/Canvas3d/pkgIndex.tcl.

4
5
6
7
8
9
10












11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
##

if {![package vsatisfies [package provide Tcl] 8.4]} return

package ifneeded Canvas3d 1.0 [string map [list @ $dir] {
  switch -glob -- $::tcl_platform(os) {
    Lin* {












      load [file join {@} libCanvas3d1.0.so] Canvas3d
      source [file join {@} c3dshapes.tcl]
    }
    Win* {
      load [file join {@} Canvas3d10.dll] Canvas3d
      source [file join {@} c3dshapes.tcl]
    }
   Darwin {
      load [file join {@} libCanvas3d1.0.dylib] Canvas3d
      source [file join {@} c3dshapes.tcl]
   }
    default {
      error "ERROR: I do not have a canvas3d library for the '$::tcl_platform(os)' platform"
    }
  }
}]

## Local Variables:
## mode: tcl
## tcl-indent-level: 2
## indent-tabs-mode: nil
## End:







>
>
>
>
>
>
>
>
>
>
>
>







|


|











4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
##

if {![package vsatisfies [package provide Tcl] 8.4]} return

package ifneeded Canvas3d 1.0 [string map [list @ $dir] {
  switch -glob -- $::tcl_platform(os) {
    Lin* {
      switch -glob -- $::tcl_platform(machine) {
        x86_64 {
          #load [file join {@} libCanvas3d1.0_x86_64.so] Canvas3d
          #source [file join {@} c3dshapes.tcl]
        }
        unknown_32 {
          #load [file join {@} libCanvas3d1.0.so] Canvas3d
          #source [file join {@} c3dshapes.tcl]
        }
        default {error "ERROR: I do not have an sqlite3 library for the linux '$::tcl_platform(machine)' machine"}
      }
      # ugh, runing a 32-bit on a 64-machine is broken...  (assume 32 for now)
      load [file join {@} libCanvas3d1.0.so] Canvas3d
      source [file join {@} c3dshapes.tcl]
    }
    Win* {
      load [file join {@} Canvas3d10.dll] Canvas3d
      source [file join {@} c3dshapes.tcl]
    }
    Darwin {
      load [file join {@} libCanvas3d1.0.dylib] Canvas3d
      source [file join {@} c3dshapes.tcl]
    }
    default {
      error "ERROR: I do not have a canvas3d library for the '$::tcl_platform(os)' platform"
    }
  }
}]

## Local Variables:
## mode: tcl
## tcl-indent-level: 2
## indent-tabs-mode: nil
## End:

Added kits/sqlite3/libsqlite3.7.9_x86_64.so.

cannot compute difference between binary files

Changes to kits/sqlite3/pkgIndex.tcl.

6
7
8
9
10
11
12












13
14
15
16
17
18
19
if {![package vsatisfies [package provide Tcl] 8.4]} return

package ifneeded sqlite3 3.7.9 [string map [list @ $dir] {
  package require Tcl 8.4
  puts stderr "loading library..."
  switch -glob -- $::tcl_platform(os) {
    Lin* {












      puts stderr "loading library [file join {@} libsqlite3.7.9.so] Sqlite3"
      load [file join {@} libsqlite3.7.9.so] Sqlite3
    }
    Win* {
      load [file join {@} sqlite379.dll] Sqlite3
    }
    Darwin {







>
>
>
>
>
>
>
>
>
>
>
>







6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
if {![package vsatisfies [package provide Tcl] 8.4]} return

package ifneeded sqlite3 3.7.9 [string map [list @ $dir] {
  package require Tcl 8.4
  puts stderr "loading library..."
  switch -glob -- $::tcl_platform(os) {
    Lin* {
      switch -glob -- $::tcl_platform(machine) {
        x86_64 {
          #puts stderr "loading library [file join {@} libsqlite3.7.9_x86_64.so] Sqlite3"
          #load [file join {@} libsqlite3.7.9_x86_64.so] Sqlite3
        }
        unknown_32 {
          #puts stderr "loading library [file join {@} libsqlite3.7.9.so] Sqlite3"
          #load [file join {@} libsqlite3.7.9.so] Sqlite3
        }
        default {error "ERROR: I do not have an sqlite3 library for the linux '$::tcl_platform(machine)' machine"}
      }
      # ugh, runing a 32-bit on a 64-machine is broken...  (assume 32 for now)
      puts stderr "loading library [file join {@} libsqlite3.7.9.so] Sqlite3"
      load [file join {@} libsqlite3.7.9.so] Sqlite3
    }
    Win* {
      load [file join {@} sqlite379.dll] Sqlite3
    }
    Darwin {

Name change from lib/gui.tcl to lib/gui/gui_0.1.tcl.

40
41
42
43
44
45
46



47
48
49
50
51
52
53
...
146
147
148
149
150
151
152


153
154
155
156
157
158
159
        {cascade -label "Style" -dynamicMenu gui::StyleMenu}
      }}
      {Tools -menu {
        {cascade -label "Obj Info" -dynamicMenu Geom::ObjInfoMenu}
        {cascade -label "View Obj" -dynamicMenu Geom::DrawObjMenu}
        {cascade -label "Slice Obj" -dynamicMenu Geom::SliceObjMenu}
      }}



    }

    ## mainframe
    ttk::notebook .nb
    .nb add [log::Frame .nb.log] -text "Log"
    ttk::notebook::enableTraversal .nb

................................................................................
    tk_messageBox \
        -type ok\
        -title "About Frusta/Frustum"\
        -message "Frusta version $::cfg(frustaVersion)"\
        -detail "$::cfg(frustaAbout)"
  }
}




## Local Variables:
## mode: tcl
## tcl-indent-level: 2
## indent-tabs-mode: nil
## End:







>
>
>







 







>
>







40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
...
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
        {cascade -label "Style" -dynamicMenu gui::StyleMenu}
      }}
      {Tools -menu {
        {cascade -label "Obj Info" -dynamicMenu Geom::ObjInfoMenu}
        {cascade -label "View Obj" -dynamicMenu Geom::DrawObjMenu}
        {cascade -label "Slice Obj" -dynamicMenu Geom::SliceObjMenu}
      }}
      {Machine -menu {
        {command -label "Exercise..." -command Machine::ExerciseFrame}
      }}
    }

    ## mainframe
    ttk::notebook .nb
    .nb add [log::Frame .nb.log] -text "Log"
    ttk::notebook::enableTraversal .nb

................................................................................
    tk_messageBox \
        -type ok\
        -title "About Frusta/Frustum"\
        -message "Frusta version $::cfg(frustaVersion)"\
        -detail "$::cfg(frustaAbout)"
  }
}

package provide frusta::gui 0.1


## Local Variables:
## mode: tcl
## tcl-indent-level: 2
## indent-tabs-mode: nil
## End:

Added lib/gui/pkgIndex.tcl.













>
>
>
>
>
>
1
2
3
4
5
6
##
## frusta package index file (hand created)
##

package ifneeded frusta::gui 0.1 [list source [file join $dir gui_0.1.tcl]]

Added lib/machine/machine_0.1.tcl.











































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
namespace eval Machine {
  variable w  .exersiseFrame
  variable v
  set v(x0) 0
  set v(x1) 200
  set v(y0) 0
  set v(y1) 200

  proc ExerciseFrame {} {
    variable w
    catch {destroy $w}
    toplevel $w
    wm title $w "Printer Exercise Frame"

    checkbutton $w.homming -text "Initial X/Y homming"
    scale $w.xMax -orient horizontal -label "xMax"  -bd 2 -relief sunken -from 0 -to 200
    scale $w.yMax -orient horizontal -label "yMax"  -bd 2 -relief sunken -from 0 -to 200
    scale $w.loops -orient vertical  -label "loops" -bd 2 -relief sunken -from 1 -to 200

    label $w.stlFileLabel -text "Output STL File:"
    entry $w.stlFileName

    canvas $w.view
    button $w.preview -text "Preview" -command [namespace code Preview]
    button $w.write -text "Write"

    grid $w.homming       -              $w.view
    grid $w.loops         $w.xMax        ^        -sticky ew
    grid ^                $w.yMax        ^        -sticky ew
    grid x                x              $w.preview
    grid $w.stlFileLabel  $w.stlFileName $w.write
  }

  proc Preview {} {
    variable w
    variable v
    $w.view delete all
    lassign {0 0 200 200} X0 Y0 X1 Y1
    $w.view create rect $X0 $Y0 $X1 $Y1 -fill red
    update
    for {set i 0} {$i < 12} {incr i} {
      set x0 [expr {$i*($v(x1)-$v(x0))/12.0+$v(x0)}]
      set x1 [expr {$i*($v(x0)-$v(x1))/12.0+$v(x1)}]
      $w.view create line $x0 $Y0 $x1 $Y1 -fill blue
      update idletasks
      after 100
    }
    for {set i 0} {$i < 12} {incr i} {
      set y0 [expr {$i*($v(y0)-$v(y1))/12.0+$v(y1)}]
      set y1 [expr {$i*($v(y1)-$v(y0))/12.0+$v(y0)}]
      $w.view create line $X0 $y0 $X1 $y1 -fill blue
      update idletasks
      after 100
    }
    
  }
  proc buildExercise {} {
    
  }

}

package provide frusta::machine 0.1

## Local Variables:
## mode: tcl
## tcl-indent-level: 2
## indent-tabs-mode: nil
## End:

Added lib/machine/pkgIndex.tcl.













>
>
>
>
>
>
1
2
3
4
5
6
##
## frusta package index file (hand created)
##

package ifneeded frusta::machine 0.1 [list source [file join $dir machine_0.1.tcl]]

Added lib/settings/pkgIndex.tcl.













>
>
>
>
>
>
1
2
3
4
5
6
##
## frusta package index file (hand created)
##

package ifneeded frusta::settings 0.1 [list source [file join $dir settings_0.1.tcl]]

Name change from lib/settings.tcl to lib/settings/settings_0.1.tcl.

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27


28
29
30
31
32
33
34
35
36
37
38
39
40
41

42
43
44
45
46
47
    set cfg(frame) [frame $w]
    foreach option $cfg(options) {
      label $w.label_$option -text $option -anchor w
      entry $w.value_$option -textvariable [namespace current]::cfg($option) -width 6
      label $w.description_$option -text $cfg(description,$option) -anchor w
      grid $w.label_$option $w.value_$option $w.description_$option -sticky new
    }
    grid rowconfigure $w 0 -weight 1
    grid columnconfigure $w 2 -weight 1
    return $w
  }

  proc Get {name} {
    variable cfg
    return $cfg($name)
  }

  proc Init {} {
    variable cfg
    set cfg(options) {}
    AddFloat layerHeight 0.25 "Height in mm of each slice layer"


  }

  proc AddFloat {name default description} {
    variable cfg
    set cfg($name) $default
    set cfg(description,$name) $description
    lappend cfg(options) $name
    if {[info exists cfg(frame)]} {
      
    }
  }


}


## Local Variables:
## mode: tcl
## tcl-indent-level: 2
## indent-tabs-mode: nil
## End:







|













>
>











|

<
>






7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42

43
44
45
46
47
48
49
    set cfg(frame) [frame $w]
    foreach option $cfg(options) {
      label $w.label_$option -text $option -anchor w
      entry $w.value_$option -textvariable [namespace current]::cfg($option) -width 6
      label $w.description_$option -text $cfg(description,$option) -anchor w
      grid $w.label_$option $w.value_$option $w.description_$option -sticky new
    }
    #grid rowconfigure $w 0 -weight 1
    grid columnconfigure $w 2 -weight 1
    return $w
  }

  proc Get {name} {
    variable cfg
    return $cfg($name)
  }

  proc Init {} {
    variable cfg
    set cfg(options) {}
    AddFloat layerHeight 0.25 "Height in mm of each slice layer"
    AddFloat buildWidth 180 "Width of build volume in mm"
    AddFloat buildHeight 180 "Heigth of build volume in mm"
  }

  proc AddFloat {name default description} {
    variable cfg
    set cfg($name) $default
    set cfg(description,$name) $description
    lappend cfg(options) $name
    if {[info exists cfg(frame)]} {
      
    }
  }
}


package provide frusta::settings 0.1

## Local Variables:
## mode: tcl
## tcl-indent-level: 2
## indent-tabs-mode: nil
## End:

Changes to main.tcl.

18
19
20
21
22
23
24
25
26
27
28
29
30

31
32
33
34
35
36
37
  0.1 {
    ## hard code for now, autoload later...
    source [file join $cfg(frustaLib) commandLineArgs.tcl]
    source [file join $cfg(frustaLib) stl.tcl]
    package require -exact frusta::gcode 0.1
    source [file join $cfg(frustaLib) geom.tcl]
    source [file join $cfg(frustaLib) slice.tcl]
    source [file join $cfg(frustaLib) gui.tcl]
    source [file join $cfg(frustaLib) view.tcl]
    source [file join $cfg(frustaLib) view2d.tcl]
    source [file join $cfg(frustaLib) menu.tcl]
    source [file join $cfg(frustaLib) logging.tcl]
    source [file join $cfg(frustaLib) settings.tcl]

  }
  default {
    error "bad frust version=$version"
  }
}

##







|




|
>







18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
  0.1 {
    ## hard code for now, autoload later...
    source [file join $cfg(frustaLib) commandLineArgs.tcl]
    source [file join $cfg(frustaLib) stl.tcl]
    package require -exact frusta::gcode 0.1
    source [file join $cfg(frustaLib) geom.tcl]
    source [file join $cfg(frustaLib) slice.tcl]
    package require -exact frusta::gui 0.1
    source [file join $cfg(frustaLib) view.tcl]
    source [file join $cfg(frustaLib) view2d.tcl]
    source [file join $cfg(frustaLib) menu.tcl]
    source [file join $cfg(frustaLib) logging.tcl]
    package require -exact frusta::settings 0.1
    package require -exact frusta::machine 0.1
  }
  default {
    error "bad frust version=$version"
  }
}

##