In PostScript, once a path is defined, one can stroke it with the current linewidth. I imagine a pen of that width drawn along the path to create the line, the "ink" from this pen is painted on both sides of the path, a half-linewidth each side. Is it possible to have a "one-sided pen" which paints on only one side of the path, a "half stroke" if you will? There is no such primitive in the language, but having seen Denis Moskowitz's Alternate line styles in PostScript, it occurs to me that something similar might achieve this effect.
Motivation: I have an application which plots a geometric figure defined by a path which is a sequence of lines (i.e., piecewise linear), fills and strokes it. The resulting bounding box of the figure is slightly larger than that of the lines which define it (the half linewidth of the stroke on the exterior of the figure). I later compose this image with others, and this slight discrepancy make correct alignment complicated. Were I able to have a half-stroke on the interior of the figure, the thickness of the stroke would not affect the bounding box and my composition would be much simpler.
I’m not aware of a "half-stroke" operator, but it might work to clip
(or eoclip
) before you stroke
.