Tk Source Code

View Ticket
Login
Ticket UUID: 2912603
Title: Support for complex polygons in canvas
Type: RFE Version: None
Submitter: dkf Created on: 2009-12-11 11:34:45
Subsystem: 05. Canvas Items Assigned To: hobbs
Priority: 5 Medium Severity:
Status: Open Last Modified: 2009-12-11 11:34:45
Resolution: None Closed By:
    Closed on:
Description:
[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.