diff options
| author | Omar Rizwan <omar@omar.website> | 2022-11-07 22:42:04 +0000 |
|---|---|---|
| committer | Omar Rizwan <omar@omar.website> | 2022-11-07 22:42:04 +0000 |
| commit | ab8ab7b489dc1f144648f1bccc7ebef53e9f96eb (patch) | |
| tree | dcd1a4ff3af213a9203d9b6da4cc4224ae76720c /virtual-programs | |
| parent | Fix label positioning (diff) | |
| download | folk-ab8ab7b489dc1f144648f1bccc7ebef53e9f96eb.tar.gz folk-ab8ab7b489dc1f144648f1bccc7ebef53e9f96eb.zip | |
Outline page regions
Diffstat (limited to 'virtual-programs')
| -rw-r--r-- | virtual-programs/outline.folk | 2 | ||||
| -rw-r--r-- | virtual-programs/tags-and-calibration.folk | 12 |
2 files changed, 10 insertions, 4 deletions
diff --git a/virtual-programs/outline.folk b/virtual-programs/outline.folk index a4ca20a5..999fe2f0 100644 --- a/virtual-programs/outline.folk +++ b/virtual-programs/outline.folk @@ -7,7 +7,7 @@ When /someone/ wishes /thing/ is outlined /color/ { foreach edge $edges { set from [lindex $vertices [lindex $edge 0]] set to [lindex $vertices [lindex $edge 1]] - Display::stroke [list $from $to] 2 $color + Display::stroke [list $from $to] 4 $color } } } diff --git a/virtual-programs/tags-and-calibration.folk b/virtual-programs/tags-and-calibration.folk index 03f3eeaa..645be989 100644 --- a/virtual-programs/tags-and-calibration.folk +++ b/virtual-programs/tags-and-calibration.folk @@ -66,12 +66,18 @@ When tag /tag/ is a tag { Claim $tag has program code $code } + +namespace import ::math::linearalgebra::{sub,add} ::math::linearalgebra::matmul ::math::linearalgebra::scale When tag /tag/ has corners /corners/ { - set corners [lmap p $corners {cameraToProjector $p}] + set tagcorners [lmap p $corners {cameraToProjector $p}] + foreach tagcorner $tagcorners { Display::text fb {*}$tagcorner 10 "$tag" } + set tagbottom [sub [lindex $tagcorners 1] [lindex $tagcorners 0]] + set tagright [sub [lindex $tagcorners 2] [lindex $tagcorners 1]] + + set offsets {{-4.7 -3.5} {1 -3.5} {1 0.8} {-4.7 0.8}} + set corners [add $tagcorners [matmul $offsets [list $tagbottom $tagright]]] set edges [list] for {set i 0} {$i < [llength $corners]} {incr i} { - lassign [lindex $corners $i] x y - Display::text fb $x $y 10 $tag if {$i > 0} { lappend edges [list [expr {$i - 1}] $i] } } lappend edges [list [expr {[llength $corners] - 1}] 0] |
