aboutsummaryrefslogtreecommitdiff
path: root/virtual-programs/outline.folk
blob: 13f060b17db007c99c2555abd61e41d355532376 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
proc loopRegion {edges vertices width color} {
    set instances [list]
    set color [getColor $color]
    foreach edge $edges {
        set from [lindex $vertices [lindex $edge 0]]
        set to [lindex $vertices [lindex $edge 1]]
        lappend instances [list $from $to $width $color]
    }
    Wish the GPU draws pipeline "line" with instances $instances
}

When /someone/ wishes /thing/ is outlined /color/ & /thing/ has region /region/ {
    lassign $region vertices edges
    loopRegion $edges $vertices 3 $color
}

When /someone/ wishes /thing/ is outlined thick /color/ & /thing/ has region /region/ {
	# FIXME: assumes path
	lassign $region vertices edges
	loopRegion $edges $vertices 6 $color
}