Ë
    ¨ehiJ  ã                   óú   — d Z ddlmZ ddlZddlZddlZddlmZ ej                   ed¬«      d„ «       «       Z
 G d„ d	e«      Zd
„ Zd„ Zd„ Zd„ Z	 dd„Z G d„ d«      Z	 dd„Zdd„Zd„ Zd„ Zdd„Zd„ Zd„ Zdd„Zy)uP   
A module providing some utility functions regarding BÃ©zier path manipulation.
é    )Ú	lru_cacheN)Ú_apié€   )Úmaxsizec                 óÀ   — || kD  ryt        || |z
  «      }t        j                  d|dz   «      }t        j                  | dz   |z
  |z  «      j	                  t
        «      S )Nr   é   )ÚminÚnpÚarangeÚprodÚastypeÚint)ÚnÚkÚis      úO/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/matplotlib/bezier.pyÚ_combr      sW   € ð 	ˆ1‚uØÜˆAˆq�1‰u‹€AÜ
�	‰	�!�Q˜‘UÓ€AÜ�7‰7�A˜‘E˜A‘I˜q‘=Ó!×(Ñ(¬Ó-Ð-ó    c                   ó   — e Zd Zy)ÚNonIntersectingPathExceptionN)Ú__name__Ú
__module__Ú__qualname__© r   r   r   r      s   „ Ør   r   c                 óü   ‡— || z  ||z  z
  }||z  ||z  z
  }	|| }}
|| }}|
|z  ||z  z
  Št        ‰«      dk  rt        d«      ‚|| }}| |
}}ˆfd„||||fD «       \  }}}}||z  ||	z  z   }||z  ||	z  z   }||fS )zŽ
    Return the intersection between the line through (*cx1*, *cy1*) at angle
    *t1* and the line through (*cx2*, *cy2*) at angle *t2*.
    gê-�™—q=zcGiven lines do not intersect. Please verify that the angles are not equal or differ by 180 degrees.c              3   ó(   •K  — | ]	  }|‰z  –— Œ y ­w)Nr   )Ú.0r   Úad_bcs     €r   ú	<genexpr>z#get_intersection.<locals>.<genexpr>9   s   øè ø€ Ò: A�a˜%•iÑ:ùs   ƒ)ÚabsÚ
ValueError)Úcx1Úcy1Úcos_t1Úsin_t1Úcx2Úcy2Úcos_t2Úsin_t2Ú	line1_rhsÚ	line2_rhsÚaÚbÚcÚdÚa_Úb_Úc_Úd_ÚxÚyr   s                       @r   Úget_intersectionr6       sÓ   ø€ ð ˜‘˜v¨™|Ñ+€IØ˜‘˜v¨™|Ñ+€Ið �F�7€q€AØ�F�7€q€Aà�‰E�A˜‘E‰M€EÜ
ˆ5ƒz�EÒÜð Nó Oð 	Oð ��ˆ€BØˆR�ˆ€BÛ:¨"¨b°"°bÐ)9Ô:�N€BˆˆB�à
ˆY‰˜˜i™Ñ'€AØ
ˆY‰˜˜i™Ñ'€Aàˆaˆ4€Kr   c                 óx   — |dk(  r| || |fS || }}| |}}||z  | z   ||z  |z   }
}	||z  | z   ||z  |z   }}|	|
||fS )z·
    For a line passing through (*cx*, *cy*) and having an angle *t*, return
    locations of the two points located along its perpendicular line at the
    distance of *length*.
    ç        r   )ÚcxÚcyÚcos_tÚsin_tÚlengthr$   r%   r(   r)   Úx1Úy1Úx2Úy2s                r   Úget_normal_pointsrB   A   ss   € ð �‚|Ø�2�r˜2ˆ~Ðà˜U˜FˆF€FØ�V˜UˆF€Fà�f‰_˜rÑ! 6¨F¡?°RÑ#7ˆ€BØ�f‰_˜rÑ! 6¨F¡?°RÑ#7ˆ€Bàˆr�2�rˆ>Ðr   c                 ó.   — | d d d|z
  z  | dd  |z  z   }|S )Néÿÿÿÿr   r   )ÚbetaÚtÚ	next_betas      r   Ú_de_casteljau1rH   Z   s+   € Ø�S�b�	˜Q ™UÑ# d¨1¨2 h°¡lÑ2€IØÐr   c                 ó  — t        j                  | «      } | g}	 t        | |«      } |j                  | «       t	        | «      dk(  rnŒ-|D � cg c]  } | d   ‘Œ	 }} t        |«      D � cg c]  } | d   ‘Œ	 }} ||fS c c} w c c} w )u•   
    Split a BÃ©zier segment defined by its control points *beta* into two
    separate segments divided at *t* and return their control points.
    r   r   rD   )r
   ÚasarrayrH   ÚappendÚlenÚreversed)rE   rF   Ú	beta_listÚ	left_betaÚ
right_betas        r   Úsplit_de_casteljaurQ   _   s‘   € ô
 �:‰:�dÓ€DØ�€IØ
Ü˜d AÓ&ˆØ×Ñ˜ÔÜˆt‹9˜Š>Øð	 ð
 &/Ö/˜T��a“Ð/€IÐ/Ü'/°	Ó':Ö;˜t�$�r“(Ð;€JÐ;à�jÐ Ð ùò 0ùÚ;s   ÁA8Á&A=c                 óB  —  | |«      } | |«      } ||«      } ||«      }||k(  r||k7  rt        d«      ‚	 t        j                  |d   |d   z
  |d   |d   z
  «      |k  r||fS d||z   z  }	 | |	«      }
 ||
«      }||z  r|	}||
k(  r||fS |
}n|	}||
k(  r||fS |
}|}Œj)uŒ  
    Find the intersection of the BÃ©zier curve with a closed path.

    The intersection point *t* is approximated by two parameters *t0*, *t1*
    such that *t0* <= *t* <= *t1*.

    Search starts from *t0* and *t1* and uses a simple bisecting algorithm
    therefore one of the end points must be inside the path while the other
    doesn't. The search stops when the distance of the points parametrized by
    *t0* and *t1* gets smaller than the given *tolerance*.

    Parameters
    ----------
    bezier_point_at_t : callable
        A function returning x, y coordinates of the BÃ©zier at parameter *t*.
        It must have the signature::

            bezier_point_at_t(t: float) -> tuple[float, float]

    inside_closedpath : callable
        A function returning True if a given point (x, y) is inside the
        closed path. It must have the signature::

            inside_closedpath(point: tuple[float, float]) -> bool

    t0, t1 : float
        Start parameters for the search.

    tolerance : float
        Maximal allowed distance between the final points.

    Returns
    -------
    t0, t1 : float
        The BÃ©zier path parameters.
    z3Both points are on the same side of the closed pathr   r   ç      à?)r   r
   Úhypot)Úbezier_point_at_tÚinside_closedpathÚt0Út1Ú	toleranceÚstartÚendÚstart_insideÚ
end_insideÚmiddle_tÚmiddleÚmiddle_insides               r   Ú*find_bezier_t_intersecting_with_closedpathra   q   s÷   € ñL ˜bÓ!€EÙ
˜BÓ
€Cá$ UÓ+€LÙ" 3Ó'€Jà�zÒ! e¨s¢lÜ*ØAóCð 	Cð ô �8‰8�E˜!‘H˜s 1™vÑ% u¨Q¡x°#°a±&Ñ'8Ó9¸IÒEØ�r�6ˆMð ˜"˜r™'‘?ˆÙ" 8Ó,ˆÙ)¨&Ó1ˆà˜-Ò'ØˆBØ�fŠ}ð ˜2�v�Ø‰CàˆBØ˜Šð ˜2�v�ØˆEØ(ˆLð3 r   c                   óh   — e Zd ZdZd„ Zd„ Zd„ Zed„ «       Zed„ «       Z	ed„ «       Z
ed„ «       Zd	„ Zy
)ÚBezierSegmentu—   
    A d-dimensional BÃ©zier segment.

    Parameters
    ----------
    control_points : (N, d) array
        Location of the *N* control points.
    c           	      ó  — t        j                  |«      | _        | j                  j                  \  | _        | _        t        j                  | j                  «      | _        t        | j                  «      D �cg c]`  }t        j                  | j                  dz
  «      t        j                  |«      t        j                  | j                  dz
  |z
  «      z  z  ‘Œb }}| j                  j                  |z  j                  | _        y c c}w )Nr   )r
   rJ   Ú_cpointsÚshapeÚ_NÚ_dr   Ú_ordersÚrangeÚmathÚ	factorialÚTÚ_px)ÚselfÚcontrol_pointsr   Úcoeffs       r   Ú__init__zBezierSegment.__init__Ç   sÃ   € ÜŸ
™
 >Ó2ˆŒØŸ=™=×.Ñ.ÑˆŒ�”Ü—y‘y §¡Ó)ˆŒô   §¡›.ö*àô —‘ §¡¨!¡Ó,Ü—^‘^ AÓ&¬¯©¸¿¹À!¹Àa¹Ó)HÑHóJð *ˆð *ð —M‘M—O‘O eÑ+×.Ñ.ˆ�ùò*s   Á9A%D	c                 ó  — t        j                  |«      }t         j                  j                  d|z
  | j                  ddd…   «      t         j                  j                  || j                  «      z  | j
                  z  S )u)  
        Evaluate the BÃ©zier curve at point(s) *t* in [0, 1].

        Parameters
        ----------
        t : (k,) array-like
            Points at which to evaluate the curve.

        Returns
        -------
        (k, d) array
            Value of the curve for each point in *t*.
        r   NrD   )r
   rJ   ÚpowerÚouterri   rn   ©ro   rF   s     r   Ú__call__zBezierSegment.__call__Ð   s`   € ô �J‰J�q‹MˆÜ—‘—‘˜q 1™u d§l¡l±4°R°4Ñ&8Ó9Ü—(‘(—.‘.  D§L¡LÓ1ñ2Ø59·X±Xñ>ð 	>r   c                 ó$   — t         | |«      «      S )zX
        Evaluate the curve at a single point, returning a tuple of *d* floats.
        )Útuplerv   s     r   Ú
point_at_tzBezierSegment.point_at_tâ   s   € ô ‘T˜!“W‹~Ðr   c                 ó   — | j                   S )z The control points of the curve.)re   ©ro   s    r   rp   zBezierSegment.control_pointsè   s   € ð �}‰}Ðr   c                 ó   — | j                   S )zThe dimension of the curve.)rh   r|   s    r   Ú	dimensionzBezierSegment.dimensioní   s   € ð �w‰wˆr   c                 ó    — | j                   dz
  S )z@Degree of the polynomial. One less the number of control points.r   )rg   r|   s    r   ÚdegreezBezierSegment.degreeò   s   € ð �w‰w˜‰{Ðr   c                 ó:  — | j                   }|dkD  rt        j                  dt        «       | j                  }t        j                  |dz   «      dd…df   }t        j                  |dz   «      ddd…f   }d||z   z  t        ||«      z  }t        ||«      |z  |z  S )uº  
        The polynomial coefficients of the BÃ©zier curve.

        .. warning:: Follows opposite convention from `numpy.polyval`.

        Returns
        -------
        (n+1, d) array
            Coefficients after expanding in polynomial basis, where :math:`n`
            is the degree of the BÃ©zier curve and :math:`d` its dimension.
            These are the numbers (:math:`C_j`) such that the curve can be
            written :math:`\sum_{j=0}^n C_j t^j`.

        Notes
        -----
        The coefficients are calculated as

        .. math::

            {n \choose j} \sum_{i=0}^j (-1)^{i+j} {j \choose i} P_i

        where :math:`P_i` are the control points of the curve.
        é
   zFPolynomial coefficients formula unstable for high order Bezier curves!r   NrD   )r€   ÚwarningsÚwarnÚRuntimeWarningrp   r
   r   r   )ro   r   ÚPÚjr   Ú	prefactors         r   Úpolynomial_coefficientsz%BezierSegment.polynomial_coefficients÷   s–   € ð2 �K‰KˆàˆrŠ6Ü�M‰Mð 1Ü2@ôBà×ÑˆÜ�I‰I�a˜‘c‹Nš1˜d˜7Ñ#ˆÜ�I‰I�a˜‘c‹N˜4¢˜7Ñ#ˆØ˜1˜q™5‘M¤E¨!¨Q£KÑ/ˆ	Ü�Q˜‹{˜YÑ&¨Ñ*Ð*r   c                 ó�  — | j                   }|dk  r*t        j                  g «      t        j                  g «      fS | j                  }t        j                  d|dz   «      dd…df   |dd z  }g }g }t        |j                  «      D ]V  \  }}t        j                  |ddd…   «      }|j                  |«       |j                  t        j                  ||«      «       ŒX t        j                  |«      }t        j                  |«      }t        j                  |«      |dk\  z  |dk  z  }	||	   t        j                  |«      |	   fS )aã  
        Return the dimension and location of the curve's interior extrema.

        The extrema are the points along the curve where one of its partial
        derivatives is zero.

        Returns
        -------
        dims : array of int
            Index :math:`i` of the partial derivative which is zero at each
            interior extrema.
        dzeros : array of float
            Of same size as dims. The :math:`t` such that :math:`d/dx_i B(t) =
            0`
        r   NrD   r   )r€   r
   Úarrayr‰   r   Ú	enumeraterm   ÚrootsrK   Ú	full_likeÚconcatenateÚisrealÚreal)
ro   r   ÚCjÚdCjÚdimsr�   r   ÚpiÚrÚin_ranges
             r   Úaxis_aligned_extremaz"BezierSegment.axis_aligned_extrema  s  € ð  �K‰KˆØ�Š6Ü—8‘8˜B“<¤§¡¨"£Ð-Ð-Ø×)Ñ)ˆÜ�i‰i˜˜1˜Q™3Ó¢ 4 Ñ(¨2¨a¨b¨6Ñ1ˆØˆØˆÜ˜sŸu™uÓ%ò 	,‰EˆAˆrÜ—‘˜™D˜b˜D™Ó"ˆAØ�L‰L˜ŒOØ�K‰KœŸ™ Q¨Ó*Õ+ð	,ô —‘˜uÓ%ˆÜ�~‰~˜dÓ#ˆÜ—9‘9˜UÓ# u°¡zÑ2°e¸q±jÑAˆØ�H‰~œrŸw™w u›~¨hÑ7Ð7Ð7r   N)r   r   r   Ú__doc__rr   rw   rz   Úpropertyrp   r~   r€   r‰   r˜   r   r   r   rc   rc   ½   sl   „ ñò/ò>ò$ð ñó ðð ñó ðð ñó ðð ñ!+ó ð!+óF8r   rc   c                 ó„   — t        | «      }|j                  }t        |||¬«      \  }}t        | ||z   dz  «      \  }}||fS )ur  
    Split a BÃ©zier curve into two at the intersection with a closed path.

    Parameters
    ----------
    bezier : (N, 2) array-like
        Control points of the BÃ©zier segment. See `.BezierSegment`.
    inside_closedpath : callable
        A function returning True if a given point (x, y) is inside the
        closed path. See also `.find_bezier_t_intersecting_with_closedpath`.
    tolerance : float
        The tolerance for the intersection. See also
        `.find_bezier_t_intersecting_with_closedpath`.

    Returns
    -------
    left, right
        Lists of control points for the two BÃ©zier segments.
    )rY   g       @)rc   rz   ra   rQ   )	ÚbezierrV   rY   ÚbzrU   rW   rX   Ú_leftÚ_rights	            r   Ú)split_bezier_intersecting_with_closedpathr    <  sS   € ô, 
�vÓ	€BØŸ™Ðä7ØÐ,¸	ôC�F€Bˆô ' v°°R±¸2©~Ó>�M€Eˆ6Ø�&ˆ=Ðr   c           	      óJ  — ddl m} | j                  «       }t        |«      \  }} ||dd «      }|}	d}
d}|D ]D  \  }}|}
|t	        |«      dz  z  } ||dd «      |k7  rt        j                  |	dd |g«      } n|}	ŒF t        d«      ‚|j                  d«      }t        |||«      \  }}t	        |«      dk(  r&|j                  g}|j                  |j                  g}nµt	        |«      d	k(  r<|j                  |j                  g}|j                  |j                  |j                  g}nkt	        |«      d
k(  rR|j                  |j                  |j                  g}|j                  |j                  |j                  |j                  g}nt        d«      ‚|dd }|dd }| j                  €U |t        j                  | j                   d| |g«      «      } |t        j                  || j                   |d g«      «      }nš |t        j                  | j                   d|
 |g«      t        j                  | j                  d|
 |g«      «      } |t        j                  || j                   |d g«      t        j                  || j                  |d g«      «      }|r|s||}}||fS )z`
    Divide a path into two segments at the point where ``inside(x, y)`` becomes
    False.
    r   )ÚPathéþÿÿÿNr   é   z*The path does not intersect with the patch)rD   r¤   é   é   zThis should never be reached)Úpathr¢   Úiter_segmentsÚnextrL   r
   r�   r!   Úreshaper    ÚLINETOÚMOVETOÚCURVE3ÚCURVE4ÚAssertionErrorÚcodesÚvertices)r§   ÚinsiderY   Úreorder_inoutr¢   Ú	path_iterÚ
ctl_pointsÚcommandÚbegin_insideÚctl_points_oldÚioldr   Úbezier_pathÚbpÚleftÚrightÚ
codes_leftÚcodes_rightÚ
verts_leftÚverts_rightÚpath_inÚpath_outs                         r   Úsplit_path_inoutrÄ   _  sˆ  € õ
 Ø×"Ñ"Ó$€Iä˜y›/Ñ€J�Ù˜* R S˜/Ó*€Là€Nà€DØ	€Aà(ò GÑˆ
�GØˆØ	ŒS�‹_ Ñ!Ñ!ˆÙ�*˜R˜S�/Ó" lÒ2ÜŸ.™.¨.¸¸Ð*=¸zÐ)JÓKˆKÙØ#‰ðGô ÐEÓFÐFà	×	Ñ	˜WÓ	%€BÜ;Ø
ˆF�Ió�K€Dˆ%ä
ˆ4ƒy�A‚~Ø—k‘k�]ˆ
Ø—{‘{ D§K¡KÐ0‰Ü	ˆT‹�aŠØ—k‘k 4§;¡;Ð/ˆ
Ø—{‘{ D§K¡K°·±Ð=‰Ü	ˆT‹�aŠØ—k‘k 4§;¡;°·±Ð<ˆ
Ø—{‘{ D§K¡K°·±¸d¿k¹kÐJ‰äÐ;Ó<Ð<à�a�b�€JØ™�(€Kà‡z�zÐÙ”r—~‘~ t§}¡}°R°aÐ'8¸*Ð&EÓFÓGˆÙœŸ™¨°T·]±]À1À2Ð5FÐ'GÓHÓI‰ñ ”r—~‘~ t§}¡}°U°dÐ';¸ZÐ&HÓIÜ—~‘~ t§z¡z°%°4Ð'8¸*Ð&EÓFóHˆñ œŸ™¨°T·]±]À1À2Ð5FÐ'GÓHÜŸ™¨°T·Z±ZÀÀ°^Ð'DÓEóGˆñ ™\Ø$ g�ˆà�HÐÐr   c                 ó$   ‡ ‡‡— |dz  Šˆ ˆˆfd„}|S )zÎ
    Return a function that checks whether a point is in a circle with center
    (*cx*, *cy*) and radius *r*.

    The returned function has the signature::

        f(xy: tuple[float, float]) -> bool
    r¤   c                 ó6   •— | \  }}|‰z
  dz  |‰z
  dz  z   ‰k  S )Nr¤   r   )Úxyr4   r5   r9   r:   Úr2s      €€€r   Ú_fzinside_circle.<locals>._f§  s,   ø€ Ø‰ˆˆ1Ø�B‘˜1‰}  B¡¨1™}Ñ,¨rÑ1Ð1r   r   )r9   r:   r–   rÉ   rÈ   s   ``  @r   Úinside_circlerÊ   œ  s   ú€ ð 
ˆa‰€Bö2ð €Ir   c                 óR   — || z
  ||z
  }}||z  ||z  z   dz  }|dk(  ry||z  ||z  fS )NrS   r   )r8   r8   r   )Úx0Úy0r>   r?   ÚdxÚdyr/   s          r   Úget_cos_sinrÐ   ¯  sF   € Ø�"‰W�b˜2‘gˆ€BØ	ˆb‰�2˜‘7Ñ	˜rÑ!€AàˆA‚vØØ�‰6�2˜‘6ˆ>Ðr   c                 óÄ   — t        j                  | |«      }t        j                  ||«      }t        ||z
  «      }||k  ryt        |t         j                  z
  «      |k  ryy)aË  
    Check if two lines are parallel.

    Parameters
    ----------
    dx1, dy1, dx2, dy2 : float
        The gradients *dy*/*dx* of the two lines.
    tolerance : float
        The angular tolerance in radians up to which the lines are considered
        parallel.

    Returns
    -------
    is_parallel
        - 1 if two lines are parallel in same direction.
        - -1 if two lines are parallel in opposite direction.
        - False otherwise.
    r   rD   F)r
   Úarctan2r    r•   )Údx1Údy1Údx2Údy2rY   Útheta1Útheta2Údthetas           r   Úcheck_if_parallelrÚ   ¸  sX   € ô& �Z‰Z˜˜SÓ!€FÜ�Z‰Z˜˜SÓ!€FÜ�˜&‘Ó!€FØ�	ÒØÜ	ˆV”b—e‘e‰^Ó	˜yÒ	(Øàr   c           
      óB  — | d   \  }}| d   \  }}| d   \  }}t        ||z
  ||z
  ||z
  ||z
  «      }|dk(  r+t        j                  d«       t        ||||«      \  }	}
|	|
}}n"t        ||||«      \  }	}
t        ||||«      \  }}t	        |||	|
|«      \  }}}}t	        |||||«      \  }}}}	 t        |||	|
||||«      \  }}t        |||	|
||||«      \  }}||f||f||fg}||f||f||fg}||fS # t        $ r# d||z   z  d||z   z  }}d||z   z  d||z   z  }}Y ŒEw xY w)u­   
    Given the quadratic BÃ©zier control points *bezier2*, returns
    control points of quadratic BÃ©zier lines roughly parallel to given
    one separated by *width*.
    r   r   r¤   rD   z8Lines do not intersect. A straight line is used instead.rS   )rÚ   r   Úwarn_externalrÐ   rB   r6   r!   )Úbezier2ÚwidthÚc1xÚc1yÚcmxÚcmyÚc2xÚc2yÚparallel_testr$   r%   r(   r)   Úc1x_leftÚc1y_leftÚ	c1x_rightÚ	c1y_rightÚc2x_leftÚc2y_leftÚ	c2x_rightÚ	c2y_rightÚcmx_leftÚcmy_leftÚ	cmx_rightÚ	cmy_rightÚ	path_leftÚ
path_rights                              r   Úget_parallelsrô   Ö  sÝ  € ð �q‰z�H€CˆØ�q‰z�H€CˆØ�q‰z�H€Cˆä% c¨C¡i°°s±Ø&)¨C¡i°°s±ó<€Mð ˜ÒÜ×ÑØFô	Hä$ S¨#¨s°CÓ8‰ˆ�Ø �‰ô % S¨#¨s°CÓ8‰ˆ�Ü$ S¨#¨s°CÓ8‰ˆ�ô 	˜#˜s F¨F°EÓ:ñ -€Hˆh˜	 9ô 	˜#˜s F¨F°EÓ:ñ -€Hˆh˜	 9ð
Ü-¨h¸À&Ø.4°hÀØ.4°fó>Ñˆ�(ô  0°	¸9ÀfØ06¸	À9Ø06¸ó @Ñˆ	�9ð  ˜HÐ%Ø˜HÐ%Ø˜HÐ%ð'€Ið ˜iÐ(Ø˜iÐ(Ø˜iÐ(ð*€Jð �jÐ Ð øô) ò 	
ð
 �8˜hÑ&Ñ'¨°¸8Ñ0CÑ)Dð ˆð �9˜yÑ(Ñ)¨3°)¸iÑ2GÑ+Hð Š	ð	
ús   Â.*C2 Ã2)DÄDc                 óP   — dd|z  | |z   z
  z  }dd|z  ||z   z
  z  }| |f||f||fgS )už   
    Find control points of the BÃ©zier curve passing through (*c1x*, *c1y*),
    (*mmx*, *mmy*), and (*c2x*, *c2y*), at parametric values 0, 0.5, and 1.
    rS   r¦   r   )rß   rà   ÚmmxÚmmyrã   rä   rá   râ   s           r   Úfind_control_pointsrø      sK   € ð
 ��C‘˜3 ™9Ñ%Ñ
&€CØ
��C‘˜3 ™9Ñ%Ñ
&€CØ�#ˆJ˜˜c˜
 S¨# JÐ/Ð/r   c                 óÊ  — | d   \  }}| d   \  }}| d   \  }	}
t        ||||«      \  }}t        |||	|
«      \  }}t        ||||||z  «      \  }}}}t        |	|
||||z  «      \  }}}}||z   dz  ||z   dz  }}||	z   dz  ||
z   dz  }}||z   dz  ||z   dz  }}t        ||||«      \  }}t        ||||||z  «      \  }} }!}"t        |||| ||«      }#t        |||!|"||«      }$|#|$fS )u¬   
    Being similar to `get_parallels`, returns control points of two quadratic
    BÃ©zier lines having a width roughly parallel to given one separated by
    *width*.
    r   r   r¤   rS   )rÐ   rB   rø   )%rÝ   rÞ   Úw1ÚwmÚw2rß   rà   rá   râ   Úc3xÚc3yr$   r%   r(   r)   ræ   rç   rè   ré   Úc3x_leftÚc3y_leftÚ	c3x_rightÚ	c3y_rightÚc12xÚc12yÚc23xÚc23yÚc123xÚc123yÚcos_t123Úsin_t123Ú
c123x_leftÚ
c123y_leftÚc123x_rightÚc123y_rightrò   ró   s%                                        r   Úmake_wedged_bezier2r  *  si  € ð �q‰z�H€CˆØ�q‰z�H€CˆØ�q‰z�H€Cˆô !  c¨3°Ó4�N€FˆFÜ   c¨3°Ó4�N€FˆFô 	˜#˜s F¨F°E¸B±JÓ?ñ -€Hˆh˜	 9ô 	˜#˜s F¨F°E¸B±JÓ?ñ -€Hˆh˜	 9ð ˜‘)˜rÑ! C¨#¡I°Ñ#3ˆ$€DØ˜‘)˜rÑ! C¨#¡I°Ñ#3ˆ$€DØ˜4‘K 2Ñ%¨¨t©°rÑ'9ˆ5€Eô % T¨4°°tÓ<Ñ€Hˆhô 	˜% ¨°(¸EÀB¹JÓGñ 5€J�
˜K¨ô $ H¨hØ$.°
Ø$,¨hó8€Iô % Y°	Ø%0°+Ø%.°	ó;€Jð �jÐ Ð r   )r8   ç      ð?ç{®Gáz„?)r  )r  F)gñhãˆµøä>)r  rS   r8   )r™   Ú	functoolsr   rk   rƒ   Únumpyr
   Ú
matplotlibr   Ú	vectorizer   r!   r   r6   rB   rH   rQ   ra   rc   r    rÄ   rÊ   rÐ   rÚ   rô   rø   r  r   r   r   ú<module>r     s­   ðñõ  Û Û ã å ð ‡�Ù
�3Ôñ.ó ó ð.ô	 :ô 	òòBò2ò
!ð& GKóI)÷X|8ñ |8ð@ .2óóF:òzò&óò<G!òT0ô0!r   