HEX
Server: Apache
System: Linux opal14.opalstack.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User: curbgloabal_opal (1234)
PHP: 8.1.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/share/inkscape/extensions/simplepath.pyc
�
��Yc@s�dZddlZddlZd�Zi
ddeegddggd6ddeegddggd6d	d
egdggd	6dd
egdggd6dd
eeeeeegddddddggd6ddeeeegddddggd6ddeeeegddddggd6ddeegddggd6ddeeeeeeegdddddddggd6ddgggd6Zd�Zd�Zd�Z	d�Z
ddd�ZdS(s'
simplepath.py
functions for digesting paths into a simple list structure

Copyright (C) 2005 Aaron Spike, aaron@ekips.org

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

i����Nccs
d}t|�}tjd�}tjd�}tjd�}x�|j||�}|ri|j�}n||kryPn|j||�}|r�|||j�!tgV|j�}qBn|j||�}|r�|||j�!tgV|j�}qBntd�qBdS(sa
    returns and iterator that breaks path data 
    identifies command and parameter tokens
    is[ \t\r\n,]+s[MLHVCSQTAZmlhvcsqtaz]s:(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)sInvalid path data!N(tlentretcompiletmatchtendtTruetFalset	Exception(tdtoffsettlengthtdelimtcommandt	parametertm((s,/usr/share/inkscape/extensions/simplepath.pytlexPaths,tLitxtytMtHitVtCitSitQtTtAitrtaitstZcCs�g}t|�}d}|}|}d}xVy|j�\}}Wntk
rWPnXg}	t}
|r�|r�|j�dkr�td�q�|}nOt}
|r�|j�r�t|d}q�t|j�dj	�}n	td�t|j�d}x|dkr|
rXy(|j�\}}|r7td�nWqXtk
rTtd	�qXXnt|j�d
|}
|
|�}|j
�r�t|j�d|dkr�||d7}q�t|j�d|d
kr�||d7}q�n|	j|�t}
|d8}q�W|j�}|dkrq|dkrE|	j|d�n|dkrh|	jd|d�nd}n|dkr�|	jd|d|d|d�|	jd|d|d|d�|dkr�d}n|dkr�d}q�n|dkrt
|	dd
!�}|}n|dkr/|}nt
|	d�}|dkrat
|	dd!�}n|}|}|j||	g�q-|S(s�
    Parse SVG path and return an array of segments.
    Removes all shorthand notation.
    Converts coordinates to absolute.
    gtRs%Invalid path, must begin with moveto.is!Invalid path, no initial command.isInvalid number of parameterssUnexpected end of pathiiRRRRRRRRRRi����i����(gg(RR(RR(RR(Rtnextt
StopIterationRtupperRRtisuppertpathdefstlowertislowertappendtinsertttuple(RtretvaltlexertpentsubPathStarttlastControltlastCommandttokent	isCommandtparamst	needParamRt	numParamstcasttparamt
outputCommand((s,/usr/share/inkscape/extensions/simplepath.pyt	parsePathIs�
		

	$$			c	CsLdjg|D]8\}}|djg|D]}t|�^q)�^q
�S(s"Format SVG path data from an arrayRt (tjointstr(RtcmdR2tp((s,/usr/share/inkscape/extensions/simplepath.pyt
formatPath�scCs�x�|D]\}}t|}xft|d�D]T}|d|dkr[||c|7<q.|d|dkr.||c|7<q.q.WqWdS(NiiRR(R$trange(R=RRR<R2tdefsti((s,/usr/share/inkscape/extensions/simplepath.pyt
translatePath�s
cCs&x|D]\}}t|}x�t|d�D]�}|d|dkr[||c|9<q.|d|dkr�||c|9<q.|d|dkr�||c|9<q.|d|dkr�||dkrd||||<qq.|d|dkr.|dkr||||<qq.q.WqWdS(	NiiRRRRiR(R$R?(R=RRR<R2R@RA((s,/usr/share/inkscape/extensions/simplepath.pyt	scalePath�s
cCs|dkr|Sx�|D]�\}}t|}x�t|d�D]�}|d|dkr>|||}||d|}	tj|d|	d�}
|
dkr�tj|	|�|}|
tj|�|||<|
tj|�|||d<q�q>q>WqWdS(NiiiRi(R$R?tmathtsqrttatan2tcostsin(R=RtcxtcyR<R2R@RARRRttheta((s,/usr/share/inkscape/extensions/simplepath.pyt
rotatePath�s
(t__doc__RRDRtfloattintR$R8R>RBRCRL(((s,/usr/share/inkscape/extensions/simplepath.pyt<module>s$	%7++=	\