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/perspective.pyo
�
��Yc@sdZddlZddlZddlZy ddlmZmZeZWn
e	ZnXddl
Z
ddlZddlZddl
Z
ddlTyddlTddlTWn+e
j�e
jed��e�nXde
jfd��YZedkre�Zej�ndS(	s&
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.

Perspective approach & math by Dmitry Platonov, shadowjack@mail.ru, 2006
i����N(tPopentPIPE(t*s�Failed to import the numpy or numpy.linalg modules. These modules are required by this extension. Please install them and try again.  On a Debian-like system this can be done with the command, sudo apt-get install python-numpy.tProjectcBs5eZd�Zd�Zd�Zd�Zd�ZRS(cCstjj|�dS(N(tinkextEffectt__init__(tself((s-/usr/share/inkscape/extensions/perspective.pyR0scCs=t|jj�dkr5tjtd��t�n|jd�}|j|jjd}|j|jjd}|j	tj
dd��r�tjtd|j	tj
dd����t�n|jtj
d	d
�ks�|jtj
dd
�kr�|jtj
d	d
�kr�tj
|dd
d
gd
dd
gg�}tj|j	d��}t|�dks~t|d�dkr�tjtd��t�ntj||�td#dt�}xPtd�D]B}|d|dd||d<|d|dd||d<q�Widd6dd6dd6dd6}|jd}	|jjd}
x�|j�D]�}tr�td||
|	fdtdtdt�}|j�}
|t|jj��||<|jj�}q\tj d||
|	f�d\}}|t|j��||<|j!�|j!�q\Wt"|d|d|dg|d|dg|d|d|dg|d|d|d|dggdt�}q|jtj
dd
�kr�tjtd��ntjtd��t�ntjtd��t�td$dt�}tddt�}xJd%D]B}||d||d<||d||d<d||d<||d||d||d <||d||d||d!<||d||dd<||d||dd<d||dd"<||d||d||dd <||d||d||dd!<||d||<||d||d<q2Wt#||�}t"|d|d|dg|d|d|d"g|d |d!dggdt�}|jtj
d	d
�kr|j$||�n|jtj
dd
�kr9|j%||�ndS(&Nis+This extension requires two selected paths.t1pxiittypetsodipodisXThe first selected object is of type '%s'.
Try using the procedure Path->Object to Path.tpathtsvgtgg�?gtdisIThis extension requires that the second selected path be four nodes long.tdtypetxtytwidththeighti����s&inkscape --query-%s --query-id=%s "%s"tshelltstdouttstderrs[The second selected object is a group, not a path.
Try using the procedure Object->Ungroup.sWThe second selected object is not a path.
Try using the procedure Path->Object to Path.sVThe first selected object is not a path.
Try using the procedure Path->Object to Path.iiiii(ii(ii(iiii(&tlentoptionstidsRterrormsgt_texittunittouutselectedtgettaddNSttagtsimpletransformtcomposeParentstcubicsuperpatht	parsePathtapplyTransformToPathtzerostfloat64trangetargstkeystbsubprocessRtTrueRtwaittfloatRtreadRtostpopen3tclosetarraytsolvetprocess_patht
process_group(RtscaletobjtenvelopetmatRtdptitqtfiletidtquerytptrcterrtftspt	solmatrixt	free_termtrest
projmatrix((s-/usr/share/inkscape/extensions/perspective.pyteffect2s|
,
6*(
""
+&
y

##''VcCsqxj|D]b}|jtjdd�kr;|j||�n|jtjdd�kr|j||�qqWdS(NRRR
(R!RR R6R7(Rtgrouptmtnode((s-/usr/share/inkscape/extensions/perspective.pyR7|s

cCstj|dddgdddgg�}|jd�}tj|�}tj||�xm|D]e}x\|D]T}|j|d|�|d<|j|d|�|d<|j|d|�|d<qlWq_Wtj|�}tj||�|jdtj	|��dS(Ng�?gRiii(
R"R#RR$R%R&t
project_pointtinvertTransformtsett
formatPath(RRRMR;RRBtsubstcsp((s-/usr/share/inkscape/extensions/perspective.pyR6�s*

"cCs�|d}|d}||dd||dd|dd||dd||dd|dd||dd||dd|dd||dd||dd|ddgS(Niii((RRBRMRR((s-/usr/share/inkscape/extensions/perspective.pyRO�s

(t__name__t
__module__RRKR7R6RO(((s-/usr/share/inkscape/extensions/perspective.pyR/s
		J		t__main__(t__doc__tsysR1tret
subprocessRRR-R,tFalseRt
simplepathR$R"tffgeomtnumpytnumpy.linalgtlocalizeRRRRRRUtetaffect(((s-/usr/share/inkscape/extensions/perspective.pyt<module>s0




g