Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita055b24

Browse files
committed
FEATURE: Path.get_stroked_extents
1 parentd3eaffd commita055b24

File tree

7 files changed

+712
-4
lines changed

7 files changed

+712
-4
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
New function to get Path's *stroked* Bbox
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
A Path is typically drawn by stroking it (with some ``markeredgewidth``), an
5+
operation which changes its bounding box in a nontrivial way, depending on the
6+
Path's joinstyle, capstyle, miterlimit, and shape.
7+
8+
`~.path.Path.get_stroked_extents` was added to allow computation of the final
9+
bounding box in pixel/points coordinates of the line, after it has been drawn
10+
(and accounting for the joinstyle, capstyle, and miterlimit).

‎lib/matplotlib/bezier.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,20 @@ def degree(self):
235235
"""Degree of the polynomial. One less the number of control points."""
236236
returnself._N-1
237237

238+
@property
239+
deftan_in(self):
240+
ifself._N<2:
241+
raiseValueError("Need at least two control points to get tangent "
242+
"vector!")
243+
returnself.control_points[1]-self.control_points[0]
244+
245+
@property
246+
deftan_out(self):
247+
ifself._N<2:
248+
raiseValueError("Need at least two control points to get tangent "
249+
"vector!")
250+
returnself.control_points[-1]-self.control_points[-2]
251+
238252
@property
239253
defpolynomial_coefficients(self):
240254
r"""

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp