MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / draw_curve

Method draw_curve

src_classic/utils.py:3221–3234  ·  view source on GitHub ↗

Draw a curve between points using one control point.

(
        self,
        p1: point_like,
        p2: point_like,
        p3: point_like,
    )

Source from the content-addressed store, hash-verified

3219 return self.draw_sector(center, p1, 360, fullSector=False)
3220
3221 def draw_curve(
3222 self,
3223 p1: point_like,
3224 p2: point_like,
3225 p3: point_like,
3226 ) -> Point:
3227 """Draw a curve between points using one control point."""
3228 kappa = 0.55228474983
3229 p1 = Point(p1)
3230 p2 = Point(p2)
3231 p3 = Point(p3)
3232 k1 = p1 + (p2 - p1) * kappa
3233 k2 = p3 + (p2 - p3) * kappa
3234 return self.draw_bezier(p1, k1, k2, p3)
3235
3236 def draw_sector(
3237 self,

Callers 4

draw_ovalMethod · 0.95
draw_rectMethod · 0.95
draw_squiggleMethod · 0.95
draw_curveFunction · 0.45

Calls 2

draw_bezierMethod · 0.95
PointClass · 0.85

Tested by

no test coverage detected