403Webshell
Server IP : 93.86.61.54  /  Your IP : 216.73.216.60
Web Server : Apache/2.4.62 (Ubuntu)
System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64
User : www-data ( 33)
PHP Version : 8.4.22
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/inkscape/extensions/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/inkscape/extensions/__pycache__/pathmodifier.cpython-310.pyc
o

0�a,!�@sbdZddlZddlmZmZmZddlmZmZddlm	Z	Gdd�dej
�ZGdd	�d	e�ZdS)
a{
This code defines a basic class (PathModifier) of effects whose purpose is
to somehow deform given objects: one common tasks for all such effect is to
convert shapes, groups, clones to paths. The class has several functions to
make this (more or less!) easy.
As an example, a second class (Diffeo) is derived from it,
to implement deformations of the form X=f(x,y), Y=g(x,y)...
�N)�PathElement�Group�Use)�
pointdistance�beziersplitatt)�zSortc@s~eZdZdZddd�Zddd�Zddd�Zd	d
�Zedd��Z	ed
d��Z
edd��Zedd��Zeddd��Z
ddd�ZdS)�PathModifierzSelect list manipulationTc	Cs�t|���D]7\}}t|tj�r=|j}|D]}|r||j|_|�|�|�d�|i��q|r8|�d�r8|j	d=|�
|�q|S)N�id�	transform)�list�items�
isinstance�inkexrr
�update�
expand_groups�get�attrib�pop)�self�elements�transferTransform�node_id�node�mat�child�r�./usr/share/inkscape/extensions/pathmodifier.pyr(s
�zPathModifier.expand_groupscCs~t|���D]6\}}t|t�r|�||�|�|||�qt|t�r<|��}|�|�|�	d�}|�
|�||i||��q|S)Nr	)rrr
rr�
expand_clonesr�unlinkrrr)rrr�replacerr�newnode�newidrrrr6s



�zPathModifier.expand_clonescCsLt|���D]}|��}|r|�|�|�d|�d��|||�d�<qdS)z'Replace all non-paths with path objectsr	N)r�values�to_path_element�replace_with�setr)rrrr�elemrrr�objects_to_pathsDs
�zPathModifier.objects_to_pathscCstd��)Nz#overwrite this method in subclasses)�NotImplementedErrorr'�svg�selected�	selection�bounding_box�bbox�filterr�path�to_superpath)rrr/rrr�effectMszPathModifier.effectcCs�|r|t|�}|dkrd||dfSd}|t|�kr8|||kr8|||8}|d7}|t|�kr8|||ks"||t|t|�d�}||fS)a
        Receives an arc length l, and returns the index of the segment in skelcomp
        containing the corresponding point, to gether with the position of the point on this segment.

        If the deformer is closed, do computations modulo the toal length.
        r�)�sum�len�min)�l�lengths�isclosed�i�trrr�lengthtotimeVs�zPathModifier.lengthtotimecCsB|D]}|D]}|D]}|d}|d|d<||d<q
qqdS)z-Swaps x and y coordinate of all path verticesrr2Nr)r/�pathcomp�ctl�pt�tmprrr�flipxyis���zPathModifier.flipxycCs8|D]}|D]}|d|7<|d|7<qqdS)zShifts a subpath by (dx, dy)rr2Nr)r<�dx�dyr=r>rrr�offsetss��zPathModifier.offsetcCsX|D]'}|D]"}|d|d|d||d<|d|d|d||d<qqdS)z>Stretches a subpath by (xscale, yscale) relative to origin orgrr2Nr)r<�xscale�yscale�orgr=r>rrr�stretch{s "��zPathModifier.stretch���MbP?c	sd�d}d}g�|t��dkr�t�|d�|d�}|t�|d�|dd�7}|t�|dd�|dd�7}t�|d�|dd�}|||kr�t�|d�|d�|dd�|ddgd�\}}|d\�|dd<�|dd<|d\�|ddd<�|ddd<��|d|dd|ddg|dd|ddg|dd|ddgg�n||d}��|�|d7}|t��dks���fdd�tdt��d�D�}|��d	d��fd
d��D��|�fS)a�
        This function receives a component of a 'cubicsuperpath' and returns two things:
        The path subdivided in many straight segments, and an array containing the length of each segment.

        We could work with bezier path as well, but bezier arc lengths are (re)computed for each point
        in the deformed object. For complex paths, this might take a while.
        g���ư>rr2�g�?�cs$g|]}�|�kr�|d�qS)r2r)�.0r9�r7�p�zerorr�
<listcomp>�s$z*PathModifier.linearize.<locals>.<listcomp>���csg|]}|�kr|�qSrr)rKr6)rNrrrO�s)r4rr�insert�append�range)	rM�	tolerancer9�d�box�chord�b1�b2�newrrLr�	linearize�s,	"&>$,T
�$zPathModifier.linearizeFcCsr|jj��}|��}|r|��}|r%|��|i}|�|dd�|�|�n|}|�|dd�|�|�||��fS)zKGets the pattern node and skeleton (with applied transforms) from selectionTF)	r)r+�paint_orderr�	duplicate�get_idrr'�id_dict)r�expand_patternsr]�	skeletonsr&�patternsrrr�get_patterns_and_skeletons�s
z'PathModifier.get_patterns_and_skeletonsN)T)TT)rH)FF)�__name__�
__module__�__qualname__�__doc__rrr'r1�staticmethodr;r@rCrGr[rcrrrrr&s"


		

	

rc@seZdZddd�Zdd�ZdS)�DiffeorcCsh|D]}|d|d8<|d|d8<q|D]}|d|d7<|d|d7<qdS)Nrr2r)r�bpt�vects�vrrr�applyDiffeo�s
�zDiffeo.applyDiffeoc	Cs�|�|jjd�|�|jjd�|�|jjd�|jj��|_|jj�t	�D]"}|j
��}|D]}|D]}|�|d|d|df�q3q/||_
q&dS)NTr2rrI)
rr)r*rr'r+r,r-r.rr/r0rm)rrr/�sub�ctlptrrrr1�s
��z
Diffeo.effectN)r)rdrerfrmr1rrrrri�s
ri)
rgrrrr�inkex.bezierrr�inkex.deprecatedr�EffectExtensionrrirrrr�<module>s	

Youez - 2016 - github.com/yon3zu
LinuXploit