Lines a, b are connected if they share end point, i. e. lastDot of a equals firstDot of b. Not coordinate values but object IDs are meant.
obj method line chainedList {} {
set line $self
while true {
set prev [$line prevLine]
if {$prev eq ""} break
if {$prev eq $self} break
if {[incr i] > 999} then {
return -code error "$i steps. Something went wrong!"
}
set line $prev
}
set end $line
while true {
lappend lineSet $line
set next [$line nextLine]
if {$next eq ""} break
if {$next eq $end} break
set line $next
}
set lineSet
}
© Wolf-Dieter Busch | Home | Sitemap | Urheber | A-Z