home *** CD-ROM | disk | FTP | other *** search
- #SPEC -realnameid 0
-
- # messages table
- #@@%000@@FR@@Faire un cone@@
- #@@%000@@US@@Make a cone@@
- #@@%001@@FR@@nb tranches@@
- #@@%001@@US@@steps@@
- #@@%002@@FR@@hauteur@@
- #@@%002@@US@@height@@
- #@@%003@@FR@@rayon@@
- #@@%003@@US@@radius@@
-
- .amapi loadmsg Cone.tcl mymsg
- set res [getvalue \
- -type1 ''int'' -name1 ''[mymsg -ref 1]'' -value1 10 \
- -type2 ''world'' -name2 ''[mymsg -ref 2]'' -value2 5 \
- -type3 ''world'' -name3 ''[mymsg -ref 3]'' -value3 4]
- mymsg -free
- if {$res == ""} return
-
- set nbslices [.match $res result1 -int]
- set high [.match $res result2 -world]
- set radiu [.match $res result3 -world]
-
- set oldplane [.amapi plane]
- .amapi setplane -viewup
- set origin {0 0 0}
-
- set circ [.match [circle -radius [.world2unit $radiu] -numpts $nbslices -orig $origin] shape -shape]
- if {$circ == ""} return
-
- newshape mycircle $circ
-
- .amapi setplane -viewfront
-
- set pt1 [list [lindex $origin 0] [lindex $origin 1] [expr [lindex $origin 2] + $radiu]]
- set pt2 [list [lindex $origin 0] [expr [lindex $pt1 1] + $high] [lindex $origin 2]]
-
- newshape myprofil {
- addpoint $pt1
- addpoint $pt2
- }
- myprofil -status open
- myprofil -checkin
-
- set prof [myprofil -ref]
- set profil [smooth -shape $prof -range $nbslices]
-
- extrude -curve1 $circ -curve2 $profil -close
-
- set newplane [.match $oldplane plane -string]
- .amapi setplane $newplane
-
-