From 43cd75eff9be56a6ca4e6286b9031ed4670be391 Mon Sep 17 00:00:00 2001 From: Charles Chamberlain Date: Wed, 16 Aug 2023 14:45:33 -0400 Subject: Add bottomright, topleft, region functions etc --- lib/math.tcl | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib') diff --git a/lib/math.tcl b/lib/math.tcl index 9fc6839a..f688a465 100644 --- a/lib/math.tcl +++ b/lib/math.tcl @@ -139,6 +139,18 @@ namespace eval ::region { set bottomEdgeIndex [lindex [lsort -indices -real -index 1 $edgeMidpoints] end] vec2 midpoint {*}[edgeToLineSegment $r [lindex [edges $r] $bottomEdgeIndex]] } + proc bottomleft {r} { + lindex [vertices $r] 0 + } + proc bottomright {r} { + lindex [vertices $r] 1 + } + proc topright {r} { + lindex [vertices $r] 2 + } + proc topleft {r} { + lindex [vertices $r] 3 + } proc mapVertices {varname r body} { lreplace $r 0 0 [uplevel [list lmap $varname [vertices $r] $body]] -- cgit v1.2.3