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/generate_voronoi.pyo
�
��Yc@s�dZddlZddlZddlZddlZddlZyddlmZmZWnDej	e
d��ej	e
d�eejj
��e�nXd�Zdejfd��YZed	kr�e�Zej�ndS(
s�
Copyright (C) 2010 Alvin Penner, penner@vaxxine.com

- Voronoi Diagram algorithm and C code by Steven Fortune, 1987, http://ect.bell-labs.com/who/sjf/
- Python translation to file voronoi.py by Bill Simons, 2005, http://www.oxfish.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(tPopentPIPEslFailed to import the subprocess module. Please report this as a bug at: https://bugs.launchpad.net/inkscape.sPython version is: c	Cs`|dkr(|dkr(ddddgS||krP||krPddddgS|dkr||||||}d}n|dkr�||||||}d}n||kr�|||||||}|}n||kr|||||||}|}n|dkr<|dkr<ddddgS||krd||krdddddgS||kr�||kr�ddddgS|dkr�||||||}d}n|dkr�||||||}d}n||kr|||||||}|}n||krP|||||||}|}n||||gS(Ni((tx1ty1tx2ty2twth((s2/usr/share/inkscape/extensions/generate_voronoi.pyt	clip_line%sF								tPatterncBseZd�Zd�ZRS(cCs�tjj|�|jjddddddddd	d
d�|jjddddddd
ddd
d�|jjdddddddd
d�dS(Ns--sizetactiontstorettypetinttdesttsizetdefaulti
thelpsAverage size of cell (px)s--bordertborderisSize of Border (px)s--tabtstringttabs'The selected UI-tab when OK was pressed(tinkextEffectt__init__tOptionParsert
add_option(tself((s2/usr/share/inkscape/extensions/generate_voronoi.pyRKscCs�	|jjs)tjtd��t�n|jd�}|jj|9_|jj|9_idd6dd6dd6dd6}xy|j	�D]k}t
d||jjd|jd	fd
tdt
dt
�}|j�}|t|jj��||<q�Wtj|j|jjdd
ddgdd
dgg�}|jd�}tjj|tjdd��}|jddttjdd���|jdt|d��|jdt|d��|jdd|d|dd|d|ddf�|jdd�tj�}	g}
t|jj�}x�tt |d|d|jj|jj��D]t}tj�|d}
tj�|d}|dkrv|
j!tj"|
|��|
|kr[|
j!tj"|
|d|��||kr|
j!tj"|
|d||d��n||d|kr[|
j!tj"|
|d||d��q[n|
|d|kr|
j!tj"|
|d|��||kr�|
j!tj"|
|d||d��n||d|kr|
j!tj"|
|d||d��qn||kr;|
j!tj"|
||d��n||d|kr�|
j!tj"|
||d��q�q`|
|kr`||kr`|
|d|kr`||d|kr`|
j!tj"|
|��q`q`Wt#|
�dkrtjd�t�ntj$|
�}tj||	�d}x|	j%D]�}|ddkr�|ddkr�t&|	j'|dd|	j'|dd|	j'|dd|	j'|dd|d|d�\}}}}n3|ddkr�|	j(|dddkrP|	j(|dd|	j(|dd}|	j'|dd|ddkrG|d}q�d}nM|d}|	j(|dd|d|	j(|dd|	j(|dd}t&|	j'|dd|	j'|dd|||d|d�\}}}}n
|ddkr�|	j(|dddkry|	j(|dd|	j(|dd}|	j'|dd|ddkrp|d}q�d}n.d}|	j(|dd|	j(|dd}t&|||	j'|dd|	j'|dd|d|d�\}}}}n|s|s|s|r0|d||||f7}q0q0Widd 6t|�d!6}i|d"6t)j*|�d#6}tjj|tjd$d�|�|j|jjd}i}|j+j,d#�r�t)j-|j+d#�}nd%|j.d�|d&<t)j*|�|j+d#<|j/tjd'd�kr�	xo|D]d}i}|j+j,d#�rW	t)j-|j+d#�}nd%|j.d�|d&<t)j*|�|j+d#<q 	WndS((NsPlease select an objectt1pxitxtytwidththeights&inkscape --query-%s --query-id=%s "%s"i����tshelltstdouttstderrg�?gs/svg:svg//svg:defstpatterntsvgtidtVoronoiii'tpatternTransformstranslate(%s,%s)itpatternUnitstuserSpaceOnUseis3Please choose a larger object, or smaller cell sizetsM %.3f,%.3f %.3f,%.3f s#000000tstrokesstroke-widthtdtstyletpathsurl(#%s)tfilltg(0toptionstidsRterrormsgt_texittunittouuRRtkeysRtargstTrueRtwaittfloatR!treadtsimpletransformtcomposeParentstselectedtxpathSingletetreet
SubElementtaddNStsettstrtrandomtrandinttvoronoitContexttrangeR
tappendtSitetlentSiteListtedgesRtverticestlinestsimplestyletformatStyletattribthas_keyt
parseStyletgetttag(RtscaletqtquerytptrctmattdefsR#tctptstbtiRRtslR.tedgeRRRRtxtemptytemptpatternstyletattribstobjR-tnode((s2/usr/share/inkscape/extensions/generate_voronoi.pyteffectZs�
"<!;!&:9!,/!,/$'B 

 n(#
	
CP(#
	(P!"
(t__name__t
__module__RRl(((s2/usr/share/inkscape/extensions/generate_voronoi.pyR	Js	t__main__(t__doc__RFRRRR=RHt
subprocessRRR3R4REtsystversion_infoR5RRR	Rmtetaffect(((s2/usr/share/inkscape/extensions/generate_voronoi.pyt<module>s#	%|