On 2021-02-16 05:55, Richard Gaskin via use-livecode wrote:
My expectation was almost beyond anything reasonable, but it would
seem useful if there was some way to make it happen:  imagine if each
segment within a list of discontiguous points was rendered as though
it's a separate object, back to front.

It's not going to kill me to use separate graphics to hide the
portions of the vertices I need covered, but it sure would have been
nifty if I'd found a way to have a single poly object render as though
it were many.

So the even-odd fill rule will not give you what you want - overlapping regions alternate.

The non-zero fill rule can give you what you want - but you need to make sure that all your sub-polygons go 'in the same direction'. (NB: Fixed width font ASCII art follows):

These two overlapping rects both go clock-wise so everything is filled.

  |--->---|
  |.......|
  |...|--->---|
  ^...|...|...|
  |...|...|...|
  |-- |---|...v
      |.......|
      |-------|

The left rect goes anti-clockwise and the right rect goes clockwise:

  |---<---|
  |.......|
  |...|--->---|
  v...|   |...|
  |...|   |...|
  |-- |---|...v
      |.......|
      |-------|

Notionally:
- the non-zero winding rule works by starting on the left of each scanline and scanning to the right
   - there is a winding counter which starts at 0.
- at any pixel, if the winding counter is non-zero the pixel is filled. - if an edge is crossed which goes 'down', the winding counter is decreased - if an edge is crossed which goes 'up', the winding counter is increased

Hope this helps!

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to