[cairo] Adding polygons

cairouser at yahoo.com cairouser at yahoo.com
Tue May 29 01:53:37 UTC 2018


Hello all!

I've encountered what seems like a simple use case, that for some reason I am unable to solve within my knowledge of Cairo.

I am trying to "add" (in polygon terms) two shapes. Each shape is drawn using a thick outline and a fill color. What should be drawn is a polygon that is a sum of both provided polygons.
In the attached sample the shapes are - a rectangle, and a pointed arrow with origin at rectangle center.

The sample is created using external polygon clipper. That's an acceptable solution for a simpler shape, but for shapes that include arcs, for example, external clipper is not very helpful
Is there a way to achieve the same effect using only Cairo functionality?

Help greatly appreciated!
--
CU
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2018-05-28 at 9.48.41 PM.png
Type: image/png
Size: 18863 bytes
Desc: not available
URL: <https://lists.cairographics.org/archives/cairo/attachments/20180528/07975377/attachment-0001.png>


More information about the cairo mailing list