Skip to content

Commit ce38e8f

Browse files
committed
Merge pull request #3 from michaelfranzl/master
try/except different unittouu for different inkscape versions
2 parents 6f0dd84 + b3470ba commit ce38e8f

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

gcodetools-dev.inx

-2
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,6 @@ packets will be needed)">false</param>
325325
Inside corner:</_param>
326326
<param name="box-in-len-inside" type="string" _gui-text="In-going length formula (if &lt;0 will add some path):">-(boxa/tan(boxb)/sin(a) - boxa/sin(boxb)/tan(boxc))</param>
327327
<param name="box-out-len-inside" type="string" _gui-text="Out-going length formula (if &lt;0 will add some path):">-boxa/tan(boxb)/sin(a)</param>
328-
<_param name="help" type="description" xml:space="preserve">
329-
</_param>
330328

331329
<param name='box-prepare-a' type="string" _gui-text='Paramater boxa:'>50*3.14159265/180</param>
332330
<param name='box-prepare-b' type="string" _gui-text='Paramater boxb:'>50*3.14159265/180</param>

gcodetools-dev.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474

7575
import os
7676
from math import *
77+
import math
7778
import bezmisc
7879
import re
7980
import copy
@@ -6667,7 +6668,7 @@ def draw_point((x0,y0),(x,y),w,t):
66676668

66686669
for p in nlLT[-1]: #For last sub-path
66696670
if p[2]:
6670-
print_([ [ [p[0]]*3, [p[0][0]+p[1][0]*de10,p[0][1]+p[1][1]*10]*3] ])
6671+
#print_([ [ [p[0]]*3, [p[0][0]+p[1][0]*de10,p[0][1]+p[1][1]*10]*3] ])
66716672
self.draw_csp(
66726673
[ [ [p[0]]*3, [[p[0][0]+p[1][0]*10,p[0][1]+p[1][1]*10]]*3 ] ],
66736674
layer, engraving_group,
@@ -6798,7 +6799,7 @@ def draw_point((x0,y0),(x,y),w,t):
67986799
#LT3 for layers loop ends here
67996800
if gcode!='' :
68006801
self.header+="(Tool diameter should be at least "+str(2*wmax)+unit+ ")\n"
6801-
self.header+="(Depth, as a function of radius w, must be "+ self.tools[layer][0]['shape']+ ")\n"
6802+
#self.header+="(Depth, as a function of radius w, must be "+ self.tools[layer][0]['shape']+ ")\n"
68026803
self.header+="(Rapid feeds use safe Z="+ str(self.options.Zsafe) + unit + ")\n"
68036804
self.header+="(Material surface at Z="+ str(self.options.Zsurface) + unit + ")\n"
68046805
self.export_gcode(gcode)
@@ -6811,7 +6812,10 @@ def utouu(self, value):
68116812
if type(value) == list:
68126813
return map(self.utouu, value)
68136814
else:
6814-
return self.unittouu(str(value))
6815+
try:
6816+
return self.unittouu(str(value))
6817+
except:
6818+
return inkex.unittouu(str(value))
68156819

68166820
################################################################################
68176821
###

0 commit comments

Comments
 (0)