aboutsummaryrefslogtreecommitdiff
path: root/sandbox/contours.tcl
diff options
context:
space:
mode:
authorlecoanet2000-05-11 13:37:04 +0000
committerlecoanet2000-05-11 13:37:04 +0000
commit65b6856dc74bf2ea55f86784e4b76734a88c8771 (patch)
tree90f75c131b6ca3819439b87070079a48543965bf /sandbox/contours.tcl
parent3e92dee11f03f4b03511c85f46dece0b8760d253 (diff)
downloadtkzinc-65b6856dc74bf2ea55f86784e4b76734a88c8771.zip
tkzinc-65b6856dc74bf2ea55f86784e4b76734a88c8771.tar.gz
tkzinc-65b6856dc74bf2ea55f86784e4b76734a88c8771.tar.bz2
tkzinc-65b6856dc74bf2ea55f86784e4b76734a88c8771.tar.xz
*** empty log message ***
Diffstat (limited to 'sandbox/contours.tcl')
-rw-r--r--sandbox/contours.tcl44
1 files changed, 44 insertions, 0 deletions
diff --git a/sandbox/contours.tcl b/sandbox/contours.tcl
new file mode 100644
index 0000000..c4e3466
--- /dev/null
+++ b/sandbox/contours.tcl
@@ -0,0 +1,44 @@
+#!/usr/bin/wish -f
+
+load tkzinc3.1.so
+package require Img
+
+set top 1
+set lw 8
+
+set r [zinc .r -backcolor gray -relief sunken]
+pack .r -expand t -fill both
+.r configure -width 800 -height 500
+.r scale $top 1 -1
+#.r configure -drawbboxes t
+set view [.r add group $top -tags controls]
+
+#set poly [.r add curve $view "50 -150 300 -150 300 -300 50 -300 50 -150" \
+# -closed t -fillcolor tan]
+set poly [.r add curve $view "50 -150 50 -300 300 -300 300 -150 50 -150" \
+ -closed t -fillcolor tan]
+.r scale $poly 2.0 2.0
+.r translate $poly -60 150
+set rect [.r add rectangle $view "50 -200 100 -50"]
+set ellipse [.r add arc $view "150 -200 300 -350"]
+set arc [.r add arc $view "-25 -150 125 -300"]
+.r scale $arc 2.0 2.0
+.r translate $arc -60 150
+
+set mp [.r add curve $view "" \
+ -linecolor yellow -fillcolor tan -fillpattern AlphaStipple8 \
+ -markercolor red -tags "poly" -linewidth $lw -filled t -closed t]
+
+.r contour $mp union $poly
+.r contour $mp diff $ellipse
+.r contour $mp union $arc
+.r contour $mp diff $rect
+
+.r itemconfigure $mp -relief raised -visible t
+
+.r remove $arc $ellipse $rect $poly
+
+#.r itemconfigure $poly -relief raised -linewidth 8
+
+# "50 -200 100 -200 100 -50 50 -50 50 -200"
+source "controls.tcl"