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

Deprecate point_at_t and document that a BezierSegment can be called#30070

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
oscargus wants to merge1 commit intomatplotlib:main
base:main
Choose a base branch
Loading
fromoscargus:bezierdep
Open
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletionsdoc/api/bezier_api.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,4 +5,5 @@
.. automodule:: matplotlib.bezier
:members:
:undoc-members:
:special-members: __call__
:show-inheritance:
4 changes: 4 additions & 0 deletionsdoc/api/next_api_changes/deprecations/30070-OG.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
``BezierSegment.point_at_t``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

... is deprecated. Instead, it is possible to call the BezierSegment with an argument.
8 changes: 6 additions & 2 deletionslib/matplotlib/bezier.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -190,6 +190,9 @@ class BezierSegment:
"""
A d-dimensional Bézier segment.

A BezierSegment can be called with an argument, either a scalar or an array-like
object, to evaluate the curve at that/those location(s).

Parameters
----------
control_points : (N, d) array
Expand DownExpand Up@@ -223,6 +226,8 @@ def __call__(self, t):
return (np.power.outer(1 - t, self._orders[::-1])
* np.power.outer(t, self._orders)) @ self._px

@_api.deprecated(
"3.11", alternative="Call the BezierSegment object with an argument.")
def point_at_t(self, t):
"""
Evaluate the curve at a single point, returning a tuple of *d* floats.
Expand DownExpand Up@@ -336,10 +341,9 @@ def split_bezier_intersecting_with_closedpath(
"""

bz = BezierSegment(bezier)
bezier_point_at_t = bz.point_at_t

t0, t1 = find_bezier_t_intersecting_with_closedpath(
bezier_point_at_t, inside_closedpath, tolerance=tolerance)
lambda t: tuple(bz(t)), inside_closedpath, tolerance=tolerance)

_left, _right = split_de_casteljau(bezier, (t0 + t1) / 2.)
return _left, _right
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp