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/edge3d.pyc
�
��Yc@s�dZddlZddlZddlZddlZddlmZmZdejfd��YZ	e
dkr�e	�Zej�ndS(s�
Copyright (C) 2007 Terry Brown, terry_n_brown@yahoo.com

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����N(tdegreestatan2tEdge3dcBs5eZd�Zd�Zd�Zd�Zd�ZRS(cCs�tjj|�d1d2d3d4d5ddddtdfd6g}xW|D]O}|jj|d%|d&d'd(d)|dd*|d+d,|d-d.|d/�qDWd0|_dS(7Ns-as--angletfloattangleg�F@s2angle of illumination, clockwise, 45 = upper rights-ds--stddevtstddevg@sstdDeviation for Gaussian Blurs-Hs--blurheightt
blurheightg@sheight for Gaussian Blurs-Ws--blurwidtht	blurwidthswidth for Gaussian Blurs-ss--shadestinttshadesis9shades, 2 = black and white, 3 = black, grey, white, etc.s-bs--bwtinkbooltbws=black and white, create only the fully black and white wedgess-ps--thicktthickg$@sstroke-width for path piecesiitactiontstorettypetdestitdefaultithelpit(s-as--anglesfloatsangleg�F@s2angle of illumination, clockwise, 45 = upper right(s-ds--stddevsfloatsstddevg@sstdDeviation for Gaussian Blur(s-Hs--blurheightsfloats
blurheightg@sheight for Gaussian Blur(s-Ws--blurwidthsfloats	blurwidthg@swidth for Gaussian Blur(s-ss--shadessintsshadesis9shades, 2 = black and white, 3 = black, grey, white, etc.(s-ps--thicksfloatRg$@sstroke-width for path pieces(tinkextEffectt__init__tFalsetOptionParsert
add_optiontfiltId(tselftoptsto((s(/usr/share/inkscape/extensions/edge3d.pyRs&	
*#cCsKd�}|||�||��}|||�||��}||kS(sbReturn true if angle (degrees, clockwise, 0 = up/north) is between
           angles start and endcSs|dkr|dS|S(sMaybe add 360 to xig�v@((tx((s(/usr/share/inkscape/extensions/edge3d.pytf0s((RtstarttendRRtate((s(/usr/share/inkscape/extensions/edge3d.pytangleBetween-s	cCsd|jjd}x�td|jj�D]�}|jjrd|dkrd||jjdkrdq*n|jj||dg|_|jj||g|_|jj|jj||�|jj|jj||d�|jt	|�t	|jjd��q*WdS(Ng�v@g@ii(
toptionsR	trangeRRR R!tappendt	makeShadeR(Rtdeltatshade((s(/usr/share/inkscape/extensions/edge3d.pyteffectX9s."cCs�d|jjd}x�|jj�D]�\}}|jtjdd�kr$|jd�}tj	|�}d}xytd|jj�D]_}|jjr�|dkr�||jjdkr�q�n|jj
||dg|_|jj
||g|_|jj|jj
||�|jj|jj
||d�t|�t|jjd�}g}	g}
x�|D]�\}}|dkr�g}	qjn|	r;tt|d	d|	d|d	d|	d��}
|j|jd|jd|
�s|j|jd|jd|
�r;|
jd
|	f�|
j||f�q;n|d	}	qjW|
r�|dkrm|j|�}ntj|�}|jdtj|
��dtd|�}d
|fd|jf}
|jd|
�|j|�q�q�Wq$q$WdS(s�Check each internode to see if it's in one of the wedges
           for the current shade.  shade is a floating point 0-1 white-blackg�v@g@tpathtsvgtdiitZi����tMi�g�o@sBfill:none;stroke:#%02x%02x%02x;stroke-opacity:1;stroke-width:10;%sitstyleN(R%R	tselectedt	iteritemsttagRtaddNStgett
simplepatht	parsePathtNoneR&RRR R!R'RRRR$tgetGrouptcopytdeepcopytsett
formatPathRR(RR)tidtnodeR.tptgR*tleveltlasttresulttcmdtparamsR"tnntcol((s(/usr/share/inkscape/extensions/edge3d.pyteffectFsL" ##cCs�|jj�jddtj�}|r�|d}tjj|tjdd��}|jt	j
|��|jd�}|jd|�tjj|j
�tjdd��}tjj|tjdd��}|jdd	|d
�tjj|tjdd��}|jd�}d||_x]d|fd
t|jj�fdt|jj�fddgD]\}	}
|j|	|
�qdWtjj|tjdd��}|jdt|jj��n4tjj|j
�tjdd��}|j|�|S(Ns
//svg:defst
namespacesitclipPathR-R?RBs	clip-pathsurl(#t)tfiltersfilter:url(#%s);theighttwidthRs-0.5tytfeGaussianBlurtstdDeviation(Rs-0.5(RQs-0.5(tdocumenttgetroottxpathRtNSStetreet
SubElementR5R'R;R<tuniqueIdR=t	getparentRtstrR%RRR(RR@tdefstcliptclipIdtclipGRBtfiltRtktvtfe((s(/usr/share/inkscape/extensions/edge3d.pyR:rs,!
!'!!
!!'
(t__name__t
__module__RR$R+RJR:(((s(/usr/share/inkscape/extensions/edge3d.pyRs
			
	,t__main__(
t__doc__RR7tsysR;tmathRRRRReR#taffect(((s(/usr/share/inkscape/extensions/edge3d.pyt<module>s0z