-
I want to draw a circle with a given radius, is there a function or constant available for use? Currently I"m using this: def as_dist(v, unit="mm"):
p0 = fitz.Point(0,0)
p1 = fitz.Point(1,0)
unitary_dist = 1/(p0.distance_to(p1, unit))
return v*unitary_dist
mm = as_dist(1, "mm") Is there some constant or function within pymupdf itself for this? from fitz import mm
Page.draw_circle(center, radius=2*mm)
# or
from fitz import as_dist
Page.draw_circle(center, radius=as_dist(2, "mm")) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
No, there is not. |
Beta Was this translation helpful? Give feedback.
-
PyMuPDF views these types of constants as parts of some general module. |
Beta Was this translation helpful? Give feedback.
-
But if you do have a PR that implements a function similar to |
Beta Was this translation helpful? Give feedback.
No, there is not.
Please simply use 1 inch = 72 points = 25.4 mm