Files
intellecton/venv/lib/python3.12/site-packages/matplotlib/__pycache__/path.cpython-312.pyc
T

597 lines
48 KiB
Plaintext
Raw Normal View History

Ë
†Rj©ãó~dZddlZddlmZddlmZddlZddlZ ddl
m Z m Z ddl
mZmZddlmZGd „d
«Zd Zy) a…
A module for dealing with the polylines used throughout Matplotlib.
The primary class for polyline handling in Matplotlib is `Path`. Almost all
vector drawing makes use of `Path`\s somewhere in the drawing pipeline.
Whilst a `Path` instance itself cannot be drawn, some `.Artist` subclasses,
such as `.PathPatch` and `.PathCollection`, can be used for convenient `Path`
visualisation.
éN)Ú lru_cache)ÚWeakValueDictionaryé)Ú_apiÚ_path)Ú_to_unmasked_float_arrayÚsimple_linear_interpolation)Ú
BezierSegmentc ó\eZdZdZej
Zed«Zed«Zed«Z ed«Z
ed«Z ed«Z edede de
de de diZ
d9d
Zed:d «Zed «Zd
Zed«Zej*d«Zed«Zej*d«Zed«Zej*d«Zed«Zej*d«Zed«ZdZdZd:dZed«Zed«ZdZdZ d;dZ!d „Z"d!„Z#d<d d dd dd"œd#„Z$d$„Z%d=d%„Z&d=d&„Z'd:d'„Z(d:d(„Z)d>d)„Z*d>d*„Z+d+„Z,d?d,„Z-dZ.ed-„«Z/e0«Z1ed.„«Z2e0«Z3ed@d/„«Z4ed0„«Z5dZ6ed1„«Z7edAd2„«Z8dZ9ed3„«Z:edBd4„«Z;ed:d5„«Z<e=e>d6«dCd7„««Z?d>d8„Z@y)DÚPathu¸
A series of possibly disconnected, possibly closed, line and curve
segments.
The underlying storage is made up of two parallel numpy arrays:
- *vertices*: an (N, 2) float array of vertices
- *codes*: an N-length `numpy.uint8` array of path codes, or None
These two arrays always have the same length in the first
dimension. For example, to represent a cubic curve, you must
provide three vertices and three `CURVE4` codes.
The code types are:
- `STOP` : 1 vertex (ignored)
A marker for the end of the entire path (currently not required and
ignored)
- `MOVETO` : 1 vertex
Pick up the pen and move to the given vertex.
- `LINETO` : 1 vertex
Draw a line from the current position to the given vertex.
- `CURVE3` : 1 control point, 1 endpoint
Draw a quadratic Bézier curve from the current position, with the given
control point, to the given end point.
- `CURVE4` : 2 control points, 1 endpoint
Draw a cubic Bézier curve from the current position, with the given
control points, to the given end point.
- `CLOSEPOLY` : 1 vertex (ignored)
Draw a line segment to the start point of the current polyline.
If *codes* is None, it is interpreted as a `MOVETO` followed by a series
of `LINETO`.
Users of Path objects should not access the vertices and codes arrays
directly. Instead, they should use `iter_segments` or `cleaned` to get the
vertex/code pairs. This helps, in particular, to consistently handle the
case of *codes* being None.
Some behavior of Path objects can be controlled by rcParams. See the
rcParams whose keys start with 'path.'.
.. note::
The vertices and codes arrays should be treated as
immutable -- there are a number of optimizations and assumptions
made up front in the constructor that will not change when the
data changes.
rrééééONFcóft|«}tjd|¬«|±t|«r¦t j
||j «}|jdk7st|«t|«k7r%td|jd|j«t|«r”|d|jk7rtd|jd |d«|rbt|«rWt jt|«|j ¬
«}|j|d<|j|dd |j|d <||_||_||_|j#«|rJd |jj$_|jd |jj$_d
|_yd |_y)
Create a new path with the given vertices and codes.
Parameters
----------
vertices : (N, 2) array-like
The path vertices, as an array, masked array or sequence of pairs.
Masked values, if any, will be converted to NaNs, which are then
handled correctly by the Agg PathIterator and other consumers of
path data, such as :meth:`iter_segments`.
codes : array-like or None, optional
N-length array of integers representing the codes of the path.
If not None, codes must be the same length as vertices.
If None, *vertices* will be treated as a series of line segments.
_interpolation_steps : int, optional
Used as a hint to certain projections, such as Polar, that this
path should be linearly interpolated immediately before drawing.
This attribute is primarily an implementation detail and is not
intended for public use.
closed : bool, optional
If *codes* is None and closed is True, vertices will be treated as
line segments of a closed polygon. Note that the last vertex will
then be ignored (as the corresponding code will be set to
`CLOSEPOLY`).
readonly : bool, optional
Makes the path behave in an immutable way and sets the vertices
and codes as read-only arrays.
)Nr
)ÚverticesNrz`'codes' must be a 1D list or array with the same length of 'vertices'. Your vertices have shape z but your codes have shape rz7The first element of 'code' must be equal to 'MOVETO' (z). Your first code is ©ÚdtypeéÿÿÿÿFT)rrÚ check_shapeÚlenÚnpÚasarrayÚ code_typeÚndimÚ
ValueErrorÚshapeÚMOVETOÚemptyÚLINETOÚ CLOSEPOLYÚ _verticesÚ_codesÚ_interpolation_stepsÚ_update_valuesÚflagsÚ writeableÚ _readonly)ÚselfrÚcodesr$ÚclosedÚreadonlys úR/home/antigravity/intellecton/venv/lib/python3.12/site-packages/matplotlib/path.pyÚ__init__z
Path.__init__csô<,¨HÓÜ ×ј¨XÕ Ð ¤ X¤Ü—J‘J˜u d§n¡nÓ5ˆEØz‰z˜QФ# e£*´°H³
Ò"=Ü ð"=à=E¿^¹^Ð<LðM>Ø>C¿k¹k¸"LóMðMô5Œz˜e A™h¨$¯+©+Ò ð"1Ø15·±°
ð>7Ø7<¸Q±x°jð"BóCðCñœ˜Hœ
Ü—H‘HœS ›]°$·.±.ÔAˆEØ—{‘{ˆE!‰HØŸ+™+ˆE!BˆŸˆE"‰IàŒØˆŒ Ø$8ˆÔ ×ÑÔá Ø-2ˆDN‰N× Ñ Ô {‰{Ð&Ø.3 ×!ˆD"ˆDcó|j|«}t|«|_||_d|_|5|j
|_|j |_|j|_|Sd|_tjd|_d|_|S)
Create a Path instance without the expense of calling the constructor.
Parameters
----------
verts : array-like
codes : array
internals_from : Path or None
If not None, another `Path` from which the attributes
``should_simplify``, ``simplify_threshold``, and
``interpolation_steps`` will be copied. Note that ``readonly`` is
never copied, and always set to ``False`` by this constructor.
FTúpath.simplify_thresholdr)
Ú__new__rr"r#r(Ú_should_simplifyÚ_simplify_thresholdr$ÚmplÚrcParams)ÚclsÚvertsr*Úinternals_fromÚpths r-Ú_fast_from_codes_and_vertszPath._fast_from_codes_and_verts¢ðk‰k˜#ÓˆÜÓŒ
؈Œ
؈Œ
Ø Ð %Ø#1×#BÑ#Bˆ Ø&4×&HÑ&Hˆ #Ø'5×'JÑ'Jˆ
ˆ
ð$(ˆ Ü&)§l¡lÐ3LÑ&Mˆ #Ø'(ˆ ˆ
r/có\t|«}|tj||ddg«d¬«S)
Create a closed polygonal path going through *vertices*.
Unlike ``Path(..., closed=True)``, *vertices* should **not** end with
an entry for the CLOSEPATH; this entry is added by `._create_closed`.
NrT)r+)rrÚ concatenate)r7rÚvs r-Ú_create_closedzPath._create_closed¿s.ô
%  .ˆÙ”2—>> 1 ¨ e -°dÔ;r/có>tjd|_|jdkDxrotjdxrZt|j«dk\xr@|j
duxs0t
j|j
tjk«|_
y)Nr1rz
path.simplifyé€) r5r6r4rr"r#rÚallr r r3©r)s r-r%zPath._update_valuesÊsÜ#&§<¡<Ð0IÑ#JˆÔ à × $ qÑ 
HÜ L‰L˜Ñ 
Hä Ó   
Hð[‰[˜
Ò
F¤B§F¡F¨4¯;©;¼$¿+¹+Ñ+EÓ$Fð
Õr/có|jS)z.The vertices of the `Path` as an (N, 2) array.)r"rCs r-rz
Path.verticesÓsð~‰~Ðr/có`|jr td«||_|j«y)Nz%Can't set vertices on a readonly Path)r(ÚAttributeErrorr"r%)r)rs r-rz
Path.verticesØs(à >Š>Ü Ð!HÓ ŒØ ×ÑÕr/có|jS)a\
The list of codes in the `Path` as a 1D array.
Each code is one of `STOP`, `MOVETO`, `LINETO`, `CURVE3`, `CURVE4` or
`CLOSEPOLY`. For codes that correspond to more than one vertex
(`CURVE3` and `CURVE4`), that code will be repeated so that the length
of `vertices` and `codes` is always the same.
)r#rCs r-r*z
Path.codesßsð{‰{Ðr/có`|jr td«||_|j«y)Nz"Can't set codes on a readonly Path)r(rFr#r%)r)r*s r-r*z
Path.codesës(à >Š>Ü Ð!EÓ ˆŒ Ø ×ÑÕr/có|jS)zi
The fraction of a pixel difference below which vertices will
be simplified out.
©r4rCs r-Úsimplify_thresholdzPath.simplify_thresholdòsð ×'r/có||_y©NrJ)r)Ú thresholds r-rKzPath.simplify_thresholdús
à#,ˆÕ r/có|jS)zD
`True` if the vertices array should be simplified.
©r3rCs r-Úshould_simplifyzPath.should_simplifyþsð
×$r/có||_yrMrP)r)rQs r-rQzPath.should_simplifys
à /ˆÕr/có|jS)z4
`True` if the `Path` is read-only.
)r(rCs r-r,z
Path.readonly sð
~‰~Ðr/có,tj|«S)z~
Return a shallow copy of the `Path`, which will share the
vertices and codes with the source `Path`.
)ÚcopyrCs r-rUz Path.copysô
y‰y˜Ðr/c óît|«}|j|«x|t|«<}|jj «D]&\}}t ||t
j||««Œ(d|_|S)zz
Return a deepcopy of the `Path`. The `Path` will not be
readonly, even if the source `Path` is.
F) Útyper2ÚidÚ__dict__ÚitemsÚsetattrrUÚdeepcopyr()r)Úmemor7Úkr>s r-Ú __deepcopy__zPath.__deepcopy__smô 4‹jˆØ Ÿ[™[¨ÓŒR‹X‰˜à—MM× 2‰DˆAˆ Aqœ$Ÿ-™-¨¨4Ó ˆŒ ؈r/có.tj||«S)aq
Return a deep copy of the `Path`. The `Path` will not be readonly,
even if the source `Path` is.
Parameters
----------
memo : dict, optional
A dictionary to use for memoizing, passed to `copy.deepcopy`.
Returns
-------
Path
A deep copy of the `Path`, but not readonly.
)rUr\)r)r]s r-r\z
Path.deepcopy&sô}‰}˜T (r/cót|j\}}}|dk7r td«|dz}||z}tj|df«}tj||j
|j ¬«}|j|dd|<|j||d|<t|«D]} |dd| f|| d|<Œ|||«S)
Make a compound `Path` object to draw a number of polygons with equal
numbers of sides.
.. plot:: gallery/misc/histogram_path.py
Parameters
----------
XY : (numpolys, numsides, 2) array
r
z%The third dimension of 'XY' must be 2rrrN)
rrrÚzerosÚfullr rrr!Úrange)
r7ÚXYÚnumpolysÚnumsidesÚtwoÚstrideÚnvertsr8r*Úis
r-Úmake_compound_path_from_polysz"Path.make_compound_path_from_polys7ð#%§(¡(ш(˜CØ !Š8ÜÐ ˜A‘ˆØ˜FÑܘ& !˜Óܘ §
¡
°#·-±-ÔØŸ:™:ˆˆaˆiˆiÑØ"%§-¡-ˆˆhИÐÑÜx“ò (ˆ!¢! Q $™xˆE!)V ð5˜ Ð r/có*|s0ttjddgtj¬««Stj|Dcgc]}|j
Œc}«}tjt
|«|j¬«}d}|D]a}t
|j
«}|j€'|r7|j||<|j||dz||zn|j||||z||z
}Œc||jk7}|||||«Scc}w)z]
Concatenate a list of `Path`\s into a single `Path`, removing all `STOP`\s.
rr
rr) r rrÚfloat32r=rrrr*rr ÚSTOP)r7ÚargsÚpathrr*rlÚsizeÚ
not_stop_masks r-Úmake_compound_pathzPath.make_compound_pathSñ
ÜœŸ ! Q ¬r¯z©zÔ —>>¸TÖ"B°T 4§=£=Ò"BÓCˆÜœ˜X›¨c¯m©mÔØ
ˆØò ˆDÜt—}‘}Ó%ˆz‰zÐØ"Ÿz™zE˜!HØ(+¯
©
E˜!˜A™#˜a ™fÑ%à"&§*¡*a˜˜$™Ø
‰I‰Að ð §¡Ñ
Ù8˜MÑ*¨E°-Ñ,@ÓAùò#CsÁDcó<d|jd|jdS)NzPath(z, ú))rr*rCs r-Ú__repr__z
Path.__repr__is Øt—}' r¨$¯*©*¨°qÐ9r/có,t|j«SrM)rrrCs r-Ú__len__z Path.__len__lsÜ4—=!r/çð?c
#ó¤Kt|«sy|j||||||||¬«} |j}
|j} t | j
«} t | j «}
t| |
«D]V\}}|| k(ry|
|dz
}|r:t|«D],}t|
«tj|t| ««}Œ.||fŒXy­w)aN
Iterate over all curve segments in the path.
Each iteration returns a pair ``(vertices, code)``, where ``vertices``
is a sequence of 1-3 coordinate pairs, and ``code`` is a `Path` code.
Additionally, this method can provide a number of standard cleanups and
conversions to the path.
Parameters
----------
transform : None or :class:`~matplotlib.transforms.Transform`
If not None, the given affine transformation will be applied to the
path.
remove_nans : bool, optional
Whether to remove all NaNs from the path and skip over them using
MOVETO commands.
clip : None or (float, float, float, float), optional
If not None, must be a four-tuple (x1, y1, x2, y2)
defining a rectangle in which to clip the path.
snap : None or bool, optional
If True, snap all nodes to pixels; if False, don't snap them.
If None, snap if the path contains only segments
parallel to the x or y axes, and no more than 1024 of them.
stroke_width : float, optional
The width of the stroke being drawn (used for path snapping).
simplify : None or bool, optional
Whether to simplify the path by removing vertices
that do not affect its appearance. If None, use the
:attr:`should_simplify` attribute. See also :rc:`path.simplify`
and :rc:`path.simplify_threshold`.
curves : bool, optional
If True, curve segments will be returned as curve segments.
If False, all curves will be converted to line segments.
sketch : None or sequence, optional
If not None, must be a 3-tuple of the form
(scale, length, randomness), representing the sketch parameters.
N)Ú transformÚ remove_nansÚclipÚsnapÚ stroke_widthÚsimplifyÚcurvesÚsketchr) rÚcleanedÚNUM_VERTICES_FOR_CODErpÚiterrr*ÚzipreÚnextrÚappend)r)r}r~rr€rrr„r…r†rprr*Ú
curr_verticesÚcodeÚextra_verticesrls r-Ú
iter_segmentszPath.iter_segmentsoèø€ôR4ŒyØ à—,‘,¨Ø+6¸TØ$(°|Ø(0¸Ø&,ð ó.ˆð!%× :Ñ :ÐØy‰yˆä˜×ÜW—]#ˆÜ#& Ó#7ò ˆM˜tŠ|ÙØ2°4Ñ8¸1Ñ<ˆÜ˜M˜”KÜ$&§I¡I¨m¼TÀ(»^Ó$LMð  Ð  &ùsCCc +ó4Kd}d}|jdi|¤ŽD]z\}}||tjk7r td«|tjk(r'|}t t j |g««|fn|tjk(r%t t j ||g««|fnÝ|tjk(r,t t j ||dd|ddg««|fnž|tjk(r0t t j ||dd|dd|ddg««|fn[|tjk(r%t t j ||g««|fn#|tjk(rytd|«|dd}Œ}y­w)u~
Iterate over each Bézier curve (lines included) in a `Path`.
Parameters
----------
**kwargs
Forwarded to `.iter_segments`.
Yields
------
B : `~matplotlib.bezier.BezierSegment`
The Bézier curves that make up the current path. Note in particular
that freestanding points are Bézier curves of order 0, and lines
are Bézier curves of order 1 (with two control points).
code : `~matplotlib.path.Path.code_type`
The code describing what kind of curve is being returned.
`MOVETO`, `LINETO`, `CURVE3`, and `CURVE4` correspond to
Bézier curves with 1, 2, 3, and 4 control points (respectively).
`CLOSEPOLY` is a `LINETO` with the control points correctly
chosen based on the start/end points of the current stroke.
Nz'Malformed path, must start with MOVETO.r
rzInvalid Path.code_type: éþÿÿÿ©) r rrr
rÚarrayr ÚCURVE3ÚCURVE4r!rp)r)ÚkwargsÚ
first_vertÚ prev_vertr8s r-Ú iter_bezierzPath.iter_bezier±s—èø€ð,ˆ
؈ Ø-˜4×Ñ #‰KˆEМ4Ÿ;™;Ò$Ð%NÓ”t—{"
Ü#¤B§H¡H¨j¨\Ó$:Ó;¸TМŸÒ#¤B§H¡H¨i¸Ð-?Ó$@ÓAÀ4МŸÒ#¤B§H¡H¨i¸¸rÀ¸Ø.3°A°B¨ið.9ó%:ó;Ø<@ðAóAàœŸÒ#¤B§H¡H¨i¸¸rÀ¸Ø.3°A°a¨j¸%ÀÀ¸)ð.Eó%FóGØHLðMóMàœŸÒ#¤B§H¡H¨i¸Ð-DÓ$EÓМŸÒä Ð#;¸D¸6Ð!BÓ˜b˜
ŠIñ+ #ùsFFc#ópK|j|ytj|jtjk(j «dt
|j««}tt||dd«D]5}tj|j||j||«Œ7y­w)z!Return subpaths split at MOVETOs.Nrr) r*rr rÚnonzerorÚmapÚslicer;r)r)ÚidxsÚsls r-Ú_iter_connected_componentszPath._iter_connected_componentsàsèø€à :‰:Ð Ø‹Jä—9‘9˜dŸj™j¬D¯K©KÑBÀ1ÑEÄsÈ4Ï:É:ÃÓWˆœ%  t¨A¨B xÓ
=Ü×—MM % t§z¡z°"¡~°tó
=ùsB4B6)rrr€r„c ó†tj|||||||||« \} }
tj| |
|«} |sd| _| S)
Return a new `Path` with vertices and codes cleaned according to the
parameters.
See Also
--------
Path.iter_segments : for details of the keyword arguments.
F)rÚ cleanup_pathr r;r3) r)r}r~rrrr€r„rr*r:s r-r…z Path.cleanedêsRô × )˜[¨$°°lÀHØ ˆ×-¨h¸¸tÓÙØ#(ˆCÔ Øˆ
r/cóvt|j|j«|j|j«S)a
Return a transformed copy of the path.
See Also
--------
matplotlib.transforms.TransformedPath
A specialized path class that will cache the transformed result and
automatically update when the transform changes.
)r r}rr*r$)r)r}s r-Ú transformedzPath.transformedýs1ôIׯ
©
Ó6¸¿
¹
Ø× /r/có¦||j«}|r|js|j|«}d}tj|d|d|||«S)aZ
Return whether the area enclosed by the path contains the given point.
The path is always treated as closed; i.e. if the last code is not
`CLOSEPOLY` an implicit segment connecting the last vertex to the first
vertex is assumed.
Parameters
----------
point : (float, float)
The point (x, y) to check.
transform : `~matplotlib.transforms.Transform`, optional
If not ``None``, *point* will be compared to ``self`` transformed
by *transform*; i.e. for a correct check, *transform* should
transform the path into the coordinate system of *point*.
radius : float, default: 0
Additional margin on the path in coordinates of *point*.
The path is extended tangentially by *radius/2*; i.e. if you would
draw the path with a linewidth of *radius*, all points on the line
would still be considered to be contained in the area. Conversely,
negative values shrink the area: Points on the imaginary line
will be considered outside the area.
Returns
-------
bool
Notes
-----
The current algorithm has some limitations:
- The result is undefined for points exactly at the boundary
(i.e. at the path shifted by *radius/2*).
- The result is undefined if there is no enclosed area, i.e. all
vertices are on a straight line.
- If bounding lines start to cross each other due to *radius* shift,
the result is not guaranteed to be correct.
Nrr)ÚfrozenÚ is_affineÚtransform_pathrÚ
point_in_path)r)Úpointr}Úradiuss r-Úcontains_pointzPath.contains_point
s\ðN Ð Ø*ˆIñ
˜Y××+¨DÓ1ˆˆ×" ¡8¨U°1©X°v¸tÀYÓOr/cóx||j«}tj||||«}|jd«S)a†
Return whether the area enclosed by the path contains the given points.
The path is always treated as closed; i.e. if the last code is not
`CLOSEPOLY` an implicit segment connecting the last vertex to the first
vertex is assumed.
Parameters
----------
points : (N, 2) array
The points to check. Columns contain x and y values.
transform : `~matplotlib.transforms.Transform`, optional
If not ``None``, *points* will be compared to ``self`` transformed
by *transform*; i.e. for a correct check, *transform* should
transform the path into the coordinate system of *points*.
radius : float, default: 0
Additional margin on the path in coordinates of *points*.
The path is extended tangentially by *radius/2*; i.e. if you would
draw the path with a linewidth of *radius*, all points on the line
would still be considered to be contained in the area. Conversely,
negative values shrink the area: Points on the imaginary line
will be considered outside the area.
Returns
-------
length-N bool array
Notes
-----
The current algorithm has some limitations:
- The result is undefined for points exactly at the boundary
(i.e. at the path shifted by *radius/2*).
- The result is undefined if there is no enclosed area, i.e. all
vertices are on a straight line.
- If bounding lines start to cross each other due to *radius* shift,
the result is not guaranteed to be correct.
Úbool)rÚpoints_in_pathÚastype)r)Úpointsr}Úresults r-Úcontains_pointszPath.contains_points<s>ðN Ð Ø*ˆIÜ×% f¨f°d¸IÓFˆØ}‰}˜$r/cóV||j«}tj|d||«S)
Return whether this (closed) path completely contains the given path.
If *transform* is not ``None``, the path will be transformed before
checking for containment.
N)rÚ path_in_path)r)rrr}s r-Ú
contains_pathzPath.contains_pathhs/ð Ð Ø*ˆIÜ×! ¨d°IÓ>r/c óÜddlm}||j|«}|j
|j}nöt t
j|jtjtjg««dk(rL|jt
j|jtjtjg«}n`g}|jdi|¤ŽD]4\}}|j«\}}|j!|dg|¢d««Œ6t
j"|«}t |«r*||j%d¬«|j'd¬«g«S|j)«S)a
Get Bbox of the path.
Parameters
----------
transform : `~matplotlib.transforms.Transform`, optional
Transform to apply to path before computing extents, if any.
**kwargs
Forwarded to `.iter_bezier`.
Returns
-------
matplotlib.transforms.Bbox
The extents of the path Bbox([[xmin, ymin], [xmax, ymax]])
r©ÚBboxr)Úaxisr)Ú
transformsr¸r*rrrÚ intersect1dr r“r”Úisinrr r˜Úaxis_aligned_extremarŠr=ÚminÚmaxÚnull) r)r}r•r¸ÚxysÚcurverŒÚdzeross r-Ú get_extentszPath.get_extentsss*õ Ð Ø×+¨DÓ1ˆDØ :‰:Ð Ø—-‘-‰CÜ
 §
¡
¬T¯[©[¼$¿+¹+Ð,FÓ
HÈAÒ
—-§¡¨¯
©
Ü)-¯©´d·k±kÐ(Bó!DñE‰Cðˆ/˜t×9°&Ñ
3 !×8 
™5 !  f ¨a Ó
—.‘. Ó%ˆCÜ ˆsŒ8Ù˜Ÿ a˜¨#¯'©'°q¨'«/Ð —99“;Ð r/có0tj|||«S)
Return whether if this path intersects another given path.
If *filled* is True, then this also returns True if one path completely
encloses the other (i.e., the paths are treated as filled).
)rÚpath_intersects_path)r)ÚotherÚfilleds r-Úintersects_pathzPath.intersects_pathœsô×)¨$°°vÓ>r/có†tj||j|j|j|j
|«S)a
Return whether this path intersects a given `~.transforms.Bbox`.
If *filled* is True, then this also returns True if the path completely
encloses the `.Bbox` (i.e., the path is treated as filled).
The bounding box is always considered filled.
)rÚpath_intersects_rectangleÚx0Úy0Úx1Úy1)r)ÚbboxrÉs r-Úintersects_bboxzPath.intersects_bbox¥s4ô× $—''˜4Ÿ7™7 D§G¡G¨T¯W©W°fó >r/códk(st|«dk(r|S|jA|j|jddvr&|jˆfd|j «D«ŽS|j|j
|jvrƒt
j|j|j|j
k(|jdk(«s:|jj«}|d||j|j
k(<n |j}t|«}|j}|Kt
jt|«dz
zdztj|j¬«}||dd<nd}t||«S)
Return a new path with each segment divided into *steps* parts.
Codes other than `LINETO`, `MOVETO`, and `CLOSEPOLY` are not handled correctly.
Parameters
----------
steps : int
The number of segments in the new path for each in the original.
Returns
-------
Path
The interpolated path.
rrNc3ó@K|]}|j«Œy­wrM)Ú interpolated)Ú.0r^Ústepss €r-ú <genexpr>z$Path.interpolated.<locals>.<genexpr>Æsøèø€ÒS¨A!—.×Sùsƒr)rr*rrur!rrBrrUr rdr r r)r)r×rr*Ú new_codess ` r-zPath.interpolated±sSø€ð AŠ:œ˜T› ašØˆKà :‰:Ð ! d§k¡k°T·Z±ZÀÀ°^Ñ&CØ*4××1PÑ1PÓ1RÔUð
Uð :‰:Ð ! d§n¡n¸¿
¹
Ñ&BÌ2Ï6É6Ø
˜dŸj™j¨D¯N©NÑ;¸t¿}¹}ÈQÑ?OÑLQà—}}×+ˆHØ5=¸a±[ˆHT—ZZ 4§>¡>Ñ —}}ˆ.¨x¸ÓØ
ˆØ Ð ÜŸ¤ U£¨a¡°5Ñ 8¸1Ñ <¼d¿k¹kØ&*§n¡nô6ˆIà"'ˆIah˜ àˆH˜(r/cópt|j«dk(rgS||j«}|j€f|dk(s|dk(r\|j}|r7t|«dkrgSt j
|d|dk7«r g|¢|d}||gS|j
|«gStj|||||«S)uH
Convert this path to a list of polygons or polylines. Each
polygon/polyline is an (N, 2) array of vertices. In other words,
each polygon has no `MOVETO` instructions or curves. This
is useful for displaying in backends that do not support
compound paths or Bézier curves.
If *width* and *height* are both non-zero then the lines will
be simplified so that vertices outside of (0, 0), (width,
height) will be clipped.
The resulting polygons will be simplified if the
:attr:`Path.should_simplify` attribute of the path is `True`.
If *closed_only* is `True` (default), only closed polygons,
with the last point being the same as the first point, will be
returned. Any unclosed polylines in the path will be
explicitly closed. If *closed_only* is `False`, any unclosed
polygons in the path will be returned as unclosed polygons,
and the closed polygons will be returned explicitly closed by
setting the last point to the same as the first point.
rrr) rrr*rÚanyr}rÚconvert_path_to_polygons)r)r}ÚwidthÚheightÚ closed_onlyrs r-Ú to_polygonszPath.to_polygonsÙô. ˆt}‰}Ó  Ò ˆ Ð Ø!×*ˆIà :‰:Ð  5¨A¢:°¸1²Ø—}‘}ˆHÙÜx“= 1Ò—VV˜H Q™K¨8°B©<Ñ7 Ð7¨8°A©;Ð7Ð Ø +¨HÓ× )˜U F¨Kó 9r/cóp|j|ddgddgddgddgddggdd¬«|_|jS)zW
Return a `Path` instance of the unit rectangle from (0, 0) to (1, 1).
rrr+r,)Ú_unit_rectangle©r7s r-Úunit_rectanglezPath.unit_rectangle
sPð
× Ñ Ð &Ù"%¨¨1 °1¨v¸¸1°vÀÀ1¸È1ÀvÐ&NØ-1¸#Bˆ à×"r/cóŽ|dkr|jj|«}nd}|€Ÿdtjz|z tj|dz«ztjdz z}tj
tj |«tj|«f«}||dd¬«}|dkr||j|<|S)
Return a :class:`Path` instance for a unit regular polygon with the
given *numVertices* such that the circumscribing circle has radius 1.0,
centered at (0, 0).
éNr
rTrâ)Ú_unit_regular_polygonsÚgetrÚpiÚarangeÚ column_stackÚcosÚsin)r7Ú numVerticesrrÚthetar8s r-Úunit_regular_polygonzPath.unit_regular_polygonð ˜ Ø×-×1°+Ó>‰Dàˆ ˆœ"Ÿ%™%i ·±¸;ȹ?Ó1KÑ—u‘u˜q‘yñ!ˆEô—O‘O¤R§V¡V¨E£]´B·F±F¸5³MÐ$BÓCˆEÙu T°DÔ9ˆ˜ Ø:>×*¨;ш r/cóþ|dkr|jj||f«}nd}|€Õ|dz}dtjz|z tj|dz«z}|tjdz z
}tj
|dz«}||ddd<|tj tj|«tj|«f«zj}||dd¬«}|dkr||j||f<|S)
Return a :class:`Path` for a unit regular star with the given
numVertices and radius of 1.0, centered at (0, 0).
Nr
rg@Trâ)
Ú_unit_regular_starsrérÚonesÚvstackríÚT)r7Ú innerCirclerrÚns2rðÚrr8s r-Úunit_regular_starzPath.unit_regular_star.ð ˜ Ø×*× ¸[Ð/IÓJ‰DàˆDØ ˆ<Ø ‘/ˆCØ”r—uu‘W˜S‘[¤2§9¡9¨S°1©WÓ#5Ñ5ˆ
”R—U‘U˜S‘[Ñ ˆEܘ˜a™Ó ˆAØ!ˆAˆaˆdˆd‰GØœŸ¤B§F¡F¨5£M´2·6±6¸%³=Ð#AÓB×Eˆu T°DÔ9ˆ˜ ØFJ×°kÐ(Bш r/có&|j|d«S)
Return a :class:`Path` for a unit regular asterisk with the given
numVertices and radius of 1.0, centered at (0, 0).
ç))r7s r-Úunit_regular_asteriskzPath.unit_regular_asteriskFsð ×$ [°#Ó6r/cód|j|jddd¬«|_|jS)z
Return the readonly :class:`Path` of the unit circle.
For most cases, :func:`Path.circle` will be what you want.
)rrrT)Úcenterrªr,)Ú _unit_circleÚcircleräs r-Ú unit_circlezPath.unit_circlePs9ð × Ñ Ð "Ÿz™z°ÀØ37ð 9ˆCÔ à×ÑÐr/cód}tjd«}||z}tjddg|dg||z
| |z
g|| g||z| |zgd| gddgd|g||z||z
g||g||z
||zg|dgddg| dg| |z||zg| |g| |z
||z
gd|gddgd| g| |z
| |zg| | g| |z| |z
g| dgddgddggt¬«}|jgdz}|j
|d<|j |d <t||z|z||¬
«S) 
Return a `Path` representing a circle of a given radius and center.
Parameters
----------
center : (float, float), default: (0, 0)
The center of the circle.
radius : float, default: 1
The radius of the circle.
readonly : bool
Whether the created path should have the "readonly" argument
set when creating the Path instance.
Notes
-----
The circle is approximated using 8 cubic Bézier curves, as described in
Lancaster, Don. `Approximating a Circle or an Ellipse Using Four
Bezier Cubic Splines <https://www.tinaja.com/glib/ellipse4.pdf>`_.
çrSlùÐ?çà?rüçð¿r{rérr©r,)rÚsqrtrÚfloatr”rr!r ) r7rÿr,ÚMAGICÚSQRTHALFÚMAGIC45rr*s r-rz Path.circle\ð,ˆÜ—7‘7˜3“<ˆØ˜"ˆä—88˜c 4˜# T˜& ° ¸'Ñ0AШ Ð& ° ¸'Ñ0AÐ! E 6˜! 3˜! 5˜& ¸Ñ0@ÐÐ& ¸Ñ0@Ð# S˜! 3˜$˜f c˜'˜Ñ¸'Ñ1AÐ'˜Ð'˜Ñ¸'Ñ1AÐ" E˜" C˜" U F˜'˜Ñ/°(°¸7Ñ1BÐ'˜i¨(¨Ð'˜Ñ/°(°¸7Ñ1BÐ$˜f d˜! 4˜! 4˜[ðE"*ôF#(ôG#)ˆðJ ˜rÑØ—:‘:ˆˆa‰Ø—M‘Mˆˆb‰ ÜH˜vÑÑÀÔIr/cóÞ|j€Öd}tjd«}||z}tjddg|dg||z
| |z
g|| g||z| |zgd| gddgd|g||z||z
g||g||z
||zg|dgddgddggt«}tj
d|j |j¬«}|j|d<|j|d <|||d
¬ «|_|jS) z
Return a `Path` of the right half of a unit circle.
See `Path.circle` for the reference on the approximation used.
rrrr{érrrTr)
Ú_unit_circle_righthalfrr rr
rdr”rrr!)r7r r r
rr*s r-Úunit_circle_righthalfzPath.unit_circle_righthalf¢s/ð × ˆEÜ—ww˜s“|ˆHØ Ñ&ˆGä—x‘xØtà˜Ø˜" X I¨gÑ$5ИX˜˜" X I¨gÑ$5ИvØsàuؘ" H¨WÑ$4И˜" H¨WÑ$4ИØsàtð%ô(ó+ˆHô.—G‘G˜§
¡
°#·-±-Ô@ˆEØ—z‘zˆE!‰HØŸ
ˆE"‰Iá),¨X°uÀtÔ)Lˆ ×)r/cóœtjdz}|}|dtj||z
dz «zz
}||k7r
||kr|dz
}tj||g«\}}|€'t dtj
||z
|z «z«}|dkr t
d«||z
|z }tjd|z«} tj|«tjdd| z| zz«dz
zdz }
tj|||dzd «} tj| «} tj| «}
| dd
}|
dd
}| }|}| dd}|
dd}| }|}|r|d zd z}tj|dft«}tj||j|j ¬
«}|d|dg|d<|j"|j$g|dd|j$|j&g|ddd}|dz
}np|d zdz}tj(|dft«}tj||j|j ¬
«}|d|dg|d<|j"|d<d}|}||
|zz|||d df<||
|zz|||d df<||
|zz
||dz|d df<||
|zz
||dz|d df<|||dz|d df<|||dz|d df<|||d ¬«S)a
Return a `Path` for the unit circle arc from angles *theta1* to
*theta2* (in degrees).