From ab8ab7b489dc1f144648f1bccc7ebef53e9f96eb Mon Sep 17 00:00:00 2001 From: Omar Rizwan Date: Mon, 7 Nov 2022 17:42:04 -0500 Subject: Outline page regions --- virtual-programs/outline.folk | 2 +- virtual-programs/tags-and-calibration.folk | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'virtual-programs') 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] -- cgit v1.2.3