| Server IP : 93.86.61.54 / Your IP : 216.73.216.206 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<+ � @ sN d Z dZddlZddlZddlZddlZddlZddlZddlZddl m
Z
ddlZddlZddl
mZmZmZ ddlmZmZmZmZmZmZmZmZmZ ejd dkrYeZeZd�dd �Zej d Z!d
Z"d
Z#d
Z$dZ%dZ&i a'd
dd�Z(dZ)dZ*d�dd�Z+e+dd�de+dd�ie+d�e+d�e+d�e+ddd�d�e+d �e+d!�e+d"�e+d#d$d�d�e+d dd�e+d!dd�e+d"dd�e+d#d$d�d�e+d%�e+d&�e+d'�e+d(d$d�d�e+d)�e+d*�e+d+�e+d,d$d�d�e+d-d.d�e+d/d.d�e+d0d.d�e+d,d$d�d�e+d-d.d�e+d/d.d�e+d0d.d�e+d,d$d�d�e+d1d.d�e+d2d.d�e+d3d.d�e+d,d$d�d�ed4d5dd6�ed4d5dd6�ed4d4d7�d8�
Z,d�d:d;�Z-d<d=� Z.d�d>d?�Z/d�dAdB�Z0d�dDdE�Z1dFdG� Z2dHdI� Z3d�dKdL�Z4d�dNdO�Z5d�dQdR�Z6d�dSdT�Z7d�dVdW�Z8dXdY� Z9dZd[� Z:d\d]� Z;d�d_d`�Z<dadb� Z=d�ddde�Z>dfdg� Z?dhdi� Z@d�djdk�ZAd�dldm�ZBdndo� ZCdpdq� ZDdrds� ZEdtdu� ZFdvdw� ZGdxdy� ZHdzd{� ZId|d}� ZJd�d~d�ZKd�d�� ZLd�d�� ZMd�d�� ZNd�d�� ZOd�d�� ZPd�d�� ZQd�d�� ZRd�d�� ZSd�d�� ZTd�d�� ZUd�d�� ZVd�d�� ZWd�d�� ZXd�d�� ZYd�d�� ZZd�d�d��Z[d�d�� Z\d�d�� Z]d�d�� Z^d�d�� Z_d�d�� Z`d�d�� Zad�d�� Zbd�d�d��Zcd�d�� Zdd�d�� Zed�d�� Zfd�d�� Zgd�d�� Zhd�d�� Zid�d�� Zjd�d�� Zkd�d�� Zld�d�dÄZmd�d�dɄZnd�d�d̄Zod�d�d΄Zpd�dЄ Zqd�d҄ Zrd�dԄ Zsd�dք atG d�d d�eu�ZvG d�dڄ d�eu�Zwd�d܄ Zxd�d�dބZyG d�d� d�eu�ZzG d�d� d�eu�Z{G d�d� d�ej|�Z}e~d�k�r�e}� �� dS dS )�a�
Comments starting "#LT" or "#CLT" are by Chris Lusby Taylor who rewrote the engraving function in 2011.
History of CLT changes to engraving and other functions it uses:
9 May 2011 Changed test of tool diameter to square it
10 May Note that there are many unused functions, including:
bound_to_bound_distance, csp_curvature_radius_at_t,
csp_special_points, csplength, rebuild_csp, csp_slope,
csp_simple_bound_to_point_distance, csp_bound_to_point_distance,
bez_at_t, bez_to_point_distance, bez_normalized_slope, matrix_mul, transpose
Fixed csp_point_inside_bound() to work if x outside bounds
20 May Now encoding the bisectors of angles.
23 May Using r/cos(a) instead of normalised normals for bisectors of angles.
23 May Note that Z values generated for engraving are in pixels, not mm.
Removed the biarc curves - straight lines are better.
24 May Changed Bezier slope calculation to be less sensitive to tiny differences in points.
Added use of self.options.engraving_newton_iterations to control accuracy
25 May Big restructure and new recursive function.
Changed the way I treat corners - I now find if the centre of a proposed circle is
within the area bounded by the line being tested and the two angle bisectors at
its ends. See get_radius_to_line().
29 May Eliminating redundant points. If A,B,C colinear, drop B
30 May Eliminating redundant lines in divided Beziers. Changed subdivision of lines
7Jun Try to show engraving in 3D
8 Jun Displaying in stereo 3D.
Fixed a bug in bisect - it could go wrong due to rounding errors if
1+x1.x2+y1.y2<0 which should never happen. BTW, I spotted a non-normalised normal
returned by csp_normalized_normal. Need to check for that.
9 Jun Corrected spelling of 'definition' but still match previous 'defention' and 'defenition' if found in file
Changed get_tool to find 1.6.04 tools or new tools with corrected spelling
10 Jun Put 3D into a separate layer called 3D, created unless it already exists
Changed csp_normalized_slope to reject lines shorter than 1e-9.
10 Jun Changed all dimensions seen by user to be mm/inch, not pixels. This includes
tool diameter, maximum engraving distance, tool shape and all Z values.
12 Jun ver 208 Now scales correctly if orientation points moved or stretched.
12 Jun ver 209. Now detect if engraving toolshape not a function of radius
Graphics now indicate Gcode toolpath, limited by min(tool diameter/2,max-dist)
24 Jan 2017 Removed hard-coded scale values from orientation point calculation
TODO Change line division to be recursive, depending on what line is touched. See line_divide
z1.7� N)�partial)�bezierlength�bezierparameterize�beziertatlength) � Transform�PathElement�TextElement�Tspan�Group�Layer�Marker�CubicSuperPath�Style� c C s$ t �t �|�t j�}t �||| |�S �N)�re�compile�escape�I�sub)�self�old�new�count�pattern� r �,/usr/share/inkscape/extensions/gcodetools.py�ireplaceT s r �-C��6?�H�����z>��h㈵��>z�%
(Header)
(Generated by gcodetools from Inkscape.)
(Using default header. To add your own header create file "header" in the output dir.)
M3
(Header end.)
z�
(Footer)
M5
G00 X0.0000 Y0.0000
M2
(Using default footer. To add your own footer create file "footer" in the output dir.)
(end)
%)�header�footer�
�DrawCurveMarker� c C s t | d|d�|�d�S )z+Set a marker style with some basic defaults�nonezurl(#{}))�stroke�fill�stroke_width�
marker_end)r �format)r'