linesToBezierCoords

linesToBezierCoords lines
returns coords intended to apply to canvas item

Resulting item effectively realizes xor-wise intersection of separated figures.


obj inscope fill proc linesToBezierCoords lines {
  set lineSets [linesToSets $lines]
  set dotSets [lmap lineSet $lineSets {lineSetToDotSet $lineSet}]
  lassign $dotSets dots
  foreach dotSet [lrange $dotSets 1 end] {
    lappend dots\
      [lindex $dots 0] [lindex $dots 0] [lindex $dotSet 0]\
      {*}$dotSet\
      [lindex $dotSet 0] [lindex $dotSet 0] [lindex $dots 0]
  }
  concat {*}[lmap dot $dots {$dot xy false}]
}

© Wolf-Dieter Busch | Home | Sitemap | Urheber | A-Z