-
Hey, Is there any option to draw such polygons? I once saw a different approach of generating an SVG string with interior and creating a pdf from that with something like whtmltopdf, but I want a direct approach. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Beta Was this translation helpful? Give feedback.
-
For a better understanding or details, please read the documentation and also maybe consult information sources like Wikipedia. |
Beta Was this translation helpful? Give feedback.
-
Another example: r1 = fitz.Rect(100,100,200,200)
shape=page.new_shape()
shape.draw_polyline((r1.tl, r1.tr, r1.br, r1.bl, r1.tl))
shape.draw_circle((r1.tl+r1.br)/2, 50)
shape.finish(fill=(1,1,0))
shape.commit()
doc.save("y.pdf") |
Beta Was this translation helpful? Give feedback.
-
@JorjMcKie Thay you that indeed helped! |
Beta Was this translation helpful? Give feedback.
Yes, this is possible using one of the non-zero-winding or even-odd rules. Example:
Gives you this:
Important:
The graphic elements you want to include in such a reglement must belong to the scope of the same
Shape.finish()
method - like shown above.If letting
even_odd
default toFalse
, non-zero-winding is used as the rule. In that case, the above effect will not occur if drawing happens in this way, because both figures are drawn in the same dir…