%!PS % -- 2022-07-16 GB % Our two shaps to intersect: /foo { matrix currentmatrix % Get CTM 130 80 translate 60 rotate 0.5 1 scale % x y r start end 0 0 80 0 360 arc setmatrix % Restore CTM } def /bar { newpath % x y r start end 100 100 80 0 360 arc } def % Show both shapes in gray for reference 0.75 setgray foo fill 0.75 setgray bar fill % Save the clipping region as we mess with it clipsave % Setup clipping as the intersection of both foo clip bar clip % Bring the current clipping to what is the current path clippath % Restore clipping region cliprestore % Now draw the contour of the region we got 0 setgray 2 setlinewidth stroke %% Orginal pathes as reference 1 0 0 setrgbcolor 0.5 setlinewidth foo stroke bar stroke % all done, ship page showpage