Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12229
Modified Files: Tag: devel_0_39 desire.tk Log Message: hehehe
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.505 retrieving revision 1.1.2.506 diff -C2 -d -r1.1.2.505 -r1.1.2.506 *** desire.tk 14 Oct 2006 11:10:30 -0000 1.1.2.505 --- desire.tk 14 Oct 2006 14:00:32 -0000 1.1.2.506 *************** *** 2600,2604 **** } def FutureWire draw {} { ! $self item WIRE line [list $@x1 $@y1 $@x2 $@y2] -dash {4 4 4 4} -fill [$self look dash] }
--- 2600,2604 ---- } def FutureWire draw {} { ! $self item WIRE line [xys $@x1 $@y1 $@x2 $@y2] -dash {4 4 4 4} -fill [$self look dash] -smooth yes }
*************** *** 3393,3396 **** --- 3393,3412 ---- def Wire report {} {list $@obj1 $@port1 $@obj2 $@port2}
+ proc xys {x1 y1 x2 y2} { + set r {} + lappend r $x1 $y1 + set dx [expr $x2-$x1] + set dy [expr $y2-$y1] + set d [expr sqrt($dx*$dx+$dy*$dy)] + set n [expr 1+$d/10] + for {set i 1} {$i<$n} {incr i} { + set w $i*($n-$i)/(0.0+$n*$n) + lappend r [expr $x1 + $dx*$i/$n + $dy*(rand()-0.5)*$w] + lappend r [expr $y1 + $dy*$i/$n - $dx*(rand()-0.5)*$w] + } + lappend r $x2 $y2 + return $r + } + def Wire draw {} { set zoom [$@canvas zoom] *************** *** 3412,3416 **** #mset {x1 y1} [l/2 [l+ [lrange $bbox1 0 1] [lrange $bbox1 2 3]]] #mset {x2 y2} [l/2 [l+ [lrange $bbox2 0 1] [lrange $bbox2 2 3]]] ! set xys [list $x1 $y1 $x2 $y2] set length [expr sqrt(pow($x2-$x1,2)+pow($y2-$y1,2))] # how to customise the arrow size/shape? --- 3428,3432 ---- #mset {x1 y1} [l/2 [l+ [lrange $bbox1 0 1] [lrange $bbox1 2 3]]] #mset {x2 y2} [l/2 [l+ [lrange $bbox2 0 1] [lrange $bbox2 2 3]]] ! set xys [xys $x1 $y1 $x2 $y2] set length [expr sqrt(pow($x2-$x1,2)+pow($y2-$y1,2))] # how to customise the arrow size/shape?