My task is to emulate HP-GL/2 polygon buffer rendering to PDF. A list of render commands define the polygon. Then an EP (Edge Polygon) will create an outline of the area. Or an FP will create a solid filled area. The area being defined by a series of render sub-commands; the polygon buffer.
I do have logic to implement various plot commands, Pen-Up, Pen-Down, Arcs, Lines, etc. My thought was to organize EP and FP as 1) CreateGroupBegin, 2) PathBegin, 3) render all commands in the polygon buffer, 4) ClosePath, 5) PathEnd, and finally 6) Apply fill or edge properties to the PathEnd element, and write it, 7) CreateGroupEnd.
I see nothing rendered from this. I suspect there may be something about how I have implemented various command renderings that stand well on their own, but for whatever reason do not propagate to the group to which I am trying to treat in aggregate as a single polygon shape.
In the example I am debugging the polygon buffer consists of 7 HP-GL/2 commands;
- PU - PEN UP
- PD - PEN DOWN
- AA - ABSOLUTE ARC
4, 5, 6) PD - PEN DOWN - AA - ABSOLUTE ARC
As in the example of sequential PD, I render line segments wrapped as a group, path begin, and then render the line segments starting with a MOVETO and then a series of LINETO. Line attributes are applied to the path/group and we end with a CreateGroupEnd.