| 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 : |
o
0�a; � @ sT d Z ddlZddlmZmZmZ ddlZG dd� dej�Zedkr(e� � � dS dS )a
An Inkscape effect for adding CAD style dimensions to selected objects
in a drawing.
It uses the selection's bounding box, so if the bounding box has empty
space in the x- or y-direction (such as with some stars) the results
will look strange. Strokes might also overlap the edge of the
bounding box.
The dimension arrows aren't measured: use the "Visualize Path/Measure
Path" effect to add measurements.
This code contains snippets from existing effects in the Inkscape
extensions library, and marker data from markers.svg.
� N)�Group�Marker�PathElementc @ s8 e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
d� ZdS )
� Dimensionz!Add dimensions as a path modifierc C s8 |j dtddd� |j dtddd� |j ddd d
� d S )Nz --xoffsetg Y@z(x offset of the vertical dimension arrow)�type�default�helpz --yoffsetz*y offset of the horizontal dimension arrowz--type� geometriczBounding box type)r r )�add_argument�float)�self�pars� r �+/usr/share/inkscape/extensions/dimension.py�
add_arguments+ s
�
�zDimension.add_argumentsc C s� t � }|�d|� |�dd� |�dd� |�dd� |�dd� |�d |� | jj�|� td
d�}|r<|�dd
� n|�dd� |�dd� |�|� dS )z&Create a marker in the defs of the svg�id�orient�auto�refXz0.0�refY�stylezoverflow:visiblezinkscape:stockidz7M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z )�d� transformz(scale(0.8) rotate(180) translate(12.5,0)zscale(0.8) translate(12.5,0)zEfill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:noneN)r �set�svg�defs�appendr )r �name�rotate�marker�arrowr r r �
add_marker2 s
zDimension.add_markerc C sP t � }|j|d | jj }|j}||d | jj }|�dd|||f � |S )zCreate a horzontal liner � r zM %f %f H %f)r �left�options�xoffset�right�yoffsetr )r �y�xlat�bbox�line�x1�x2�y1r r r � horz_lineE s zDimension.horz_linec C sP t � }||d | jj }|j|d | jj }|j}|�dd|||f � |S )zCreate a vertical liner r"