
    p"h                         S SK Jr  S SKJrJrJr   " S S\\\\5      r " S S\\\5      r " S S\\\5      r " S	 S
\\\5      r	 " S S\\\\5      r
 " S S\
5      rg)    )BaseElement)PresentationMarkers	Transformc                   4   ^  \ rS rSrSrSrSU 4S jjrSrU =r$ )Line   zZThe **line** element defines a line segment that starts at one point
and ends at another.
linec                 ^   > [         [        U ]
  " S0 UD6  Uu  pEUu  pgX@S'   XPS'   X`S'   XpS'   g)z
:param 2-tuple start: start point (**x1**, **y1**)
:param 2-tuple end: end point (**x2**, **y2**)
:param extra: additional SVG attributes as keyword-arguments

x1y1x2y2N )superr   __init__)	selfstartendextrar   r   r   r   	__class__s	           A/var/www/html/env/lib/python3.13/site-packages/svgwrite/shapes.pyr   Line.__init__   sA     	dD"+U+T
T
T
T
    r   )r   r   r   	__name__
__module____qualname____firstlineno____doc__elementnamer   __static_attributes____classcell__r   s   @r   r   r      s     K r   r   c                   4   ^  \ rS rSrSrSrSU 4S jjrSrU =r$ )Rect#   zThe **rect** element defines a rectangle which is axis-aligned with the current
user coordinate system. Rounded rectangles can be achieved by setting appropriate
values for attributes **rx** and **ry**.
rectc                 |   > [         [        U ]
  " S0 UD6  Uu  pgUu  pX`S'   XpS'   XS'   XS'   Ub  X0S'   Ub  X@S'   gg)	z
:param 2-tuple insert: insert point (**x**, **y**), left-upper point
:param 2-tuple size: (**width**, **height**)
:param <length> rx: corner x-radius
:param <length> ry: corner y-radius
:param extra: additional SVG attributes as keyword-arguments

xywidthheightNrxryr   )r   r'   r   )r   insertsizer/   r0   r   r+   r,   r-   r.   r   s             r   r   Rect.__init__*   s^     	dD"+U+S	S	WX>J>J r   r   )r      r5   NNr   r%   s   @r   r'   r'   #   s     K r   r'   c                   4   ^  \ rS rSrSrSrSU 4S jjrSrU =r$ )Circle@   zRThe **circle** element defines a circle based on a center point and a radius.
    circlec                 N   > [         [        U ]
  " S0 UD6  Uu  pEX@S'   XPS'   X S'   g)z
:param 2-tuple center: circle center point (**cx**, **cy**)
:param length r: circle-radius **r**
:param extra: additional SVG attributes as keyword-arguments

cxcyrNr   )r   r7   r   )r   centerr=   r   r;   r<   r   s         r   r   Circle.__init__E   s3     	fd$-u-T
T
S	r   r   )r   r5   r   r%   s   @r   r7   r7   @   s    K r   r7   c                   4   ^  \ rS rSrSrSrSU 4S jjrSrU =r$ )EllipseS   zThe **ellipse** element defines an ellipse which is axis-aligned with the
current user coordinate system based on a center point and two radii.
ellipsec                 ^   > [         [        U ]
  " S0 UD6  Uu  pEUu  pgX@S'   XPS'   X`S'   XpS'   g)z
:param 2-tuple center: ellipse center point (**cx**, **cy**)
:param 2-tuple r: ellipse radii (**rx**, **ry**)
:param extra: additional SVG attributes as keyword-arguments

r;   r<   r/   r0   Nr   )r   rA   r   )	r   r>   r=   r   r;   r<   r/   r0   r   s	           r   r   Ellipse.__init__Y   sA     	gt%..T
T
T
T
r   r   )r   r4   r   r%   s   @r   rA   rA   S   s     K r   rA   c                   H   ^  \ rS rSrSrSr/ 4U 4S jjrU 4S jrS rSr	U =r
$ )Polylinei   zThe **polyline** element defines a set of connected straight line
segments. Typically, **polyline** elements define open shapes.
polylinec                   > [         [        U ]
  " S0 UD6  [        U5      U l        U R
                  (       aP  U R                   H?  nUu  pEU R                  R                  US5        U R                  R                  US5        MA     gg)z
:param `iterable` points: `iterable` of points (points are `2-tuples`)
:param extra: additional SVG attributes as keyword-arguments


coordinateNr   )r   rG   r   listpointsdebug	validatorcheck_svg_type)r   rM   r   pointr+   r,   r   s         r   r   Polyline.__init__o   sk     	h&//6l::--a>--a> % r   c                 x   > U R                  U R                  5      U R                  S'   [        [        U ]  5       $ )NrM   )points_to_stringrM   attribsr   rG   get_xml)r   r   s    r   rV   Polyline.get_xml}   s0    !%!6!6t{{!CXXt,..r   c                    / nU H  n[        U5      S:w  a  [        S[        U5      -  5      eUu  pEU R                  (       a8  U R                  R	                  US5        U R                  R	                  US5        U R
                  S:X  aB  [        U[        5      (       a  [        US5      n[        U[        5      (       a  [        US5      nU< SU< 3nUR                  U5        M     SR                  U5      $ )zQ
Convert a `list` of points `2-tuples` to a `string` ``'p1x,p1y p2x,p2y ...'``.

   z%got %s values, but expected 2 values.rK   tiny   , )len	TypeErrorrN   rO   rP   profile
isinstancefloatroundappendjoin)r   rM   stringsrQ   r+   r,   s         r   rT   Polyline.points_to_string   s    
 E5zQ G#e* TUUDAzz--a>--a>||v%a''aAa''aA !$ENN5!  xx  r   )rM   )r   r   r   r    r!   r"   r   rV   rT   r#   r$   r%   s   @r   rG   rG   i   s&     K  ?/! !r   rG   c                       \ rS rSrSrSrSrg)Polygon   zThe **polygon** element defines a closed shape consisting of a set of
connected straight line segments.

Same as :class:`~svgwrite.shapes.Polyline` but closed.
polygonr   N)r   r   r   r    r!   r"   r#   r   r   r   ri   ri      s    
 Kr   ri   N)svgwrite.baser   svgwrite.mixinsr   r   r   r   r'   r7   rA   rG   ri   r   r   r   <module>rn      sq    & < <;	< ,;	< :[)\ &k9l ,,!{I|W ,!^h r   