#225 Support for complex polygons in canvas

open
Jeffrey Hobbs
5
2009-12-11
2009-12-11
Donal K. Fellows
No

[This was originally Tcl FRQ #1266238]
This is a request for support of complex polygons in canvases.

RATIONALE:
Such grapic items are common in computer graphics.

SUGGESTED IMPLEMENTATION

Alternative 1: Extend the current polygon item.

The current "create polygon" command is extended so the coordinates can be specified as a list of lists of coordinates, each list comprise a part of the polygon, with the outer polygin first. This alternative requieres that the current command determines what kind of list it has as parameter, and takes the appropriate action.

Aternative 2: New compound item.

New command "create compond <list> <options>...", with syntax as "create polygon" as above where <list> is a list of list of coordinates.

Alternative 3: New complex item

New command "create complex <ti1> <ti2> ..." where <ti?> is a tag or identifier identifying existing items in the canvas. These items may now be considered as a 'group', with a single identity. It may then be possible to specify as an option "-eofill 1" to specify that polygons in the group is to be painted with even-odd fill.

Discussion