summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Wüst <sebi@timewaster.de>2013-07-27 15:18:36 +0000
committerSebastian Wüst <sebi@timewaster.de>2013-07-27 15:18:36 +0000
commitde3cd4c192b87660d348ca146b3a7409d8d05108 (patch)
treec5cc00fc9b25e522a9a4f7f6988d3e99bccd982e
parentminor stuff (diff)
downloadinkscape-de3cd4c192b87660d348ca146b3a7409d8d05108.tar.gz
inkscape-de3cd4c192b87660d348ca146b3a7409d8d05108.zip
small changes + fixes
(bzr r12417.1.13)
-rw-r--r--share/extensions/hpgl_encoder.py7
-rw-r--r--share/extensions/hpgl_output.inx14
-rwxr-xr-xshare/extensions/hpgl_output.py5
-rw-r--r--share/extensions/plotter.py1
4 files changed, 15 insertions, 12 deletions
diff --git a/share/extensions/hpgl_encoder.py b/share/extensions/hpgl_encoder.py
index 27d1bf755..026b839f4 100644
--- a/share/extensions/hpgl_encoder.py
+++ b/share/extensions/hpgl_encoder.py
@@ -45,7 +45,7 @@ class hpglEncoder:
'''
self.doc = doc
self.options = options
- self.divergenceX = 'False' # dirty hack: i need to know if this was set before, but since False is evaluated to 0 it can not be determined, therefore the string.
+ self.divergenceX = 'False' # dirty hack: i need to know if this was set to a number before, but since False is evaluated to 0 it can not be determined, therefore the string.
self.divergenceY = 'False'
self.sizeX = 'False'
self.sizeY = 'False'
@@ -97,7 +97,7 @@ class hpglEncoder:
# add precut
if self.options.useToolOffset and self.options.precut:
self.calcOffset('PU', 0, 0)
- self.calcOffset('PD', 0, self.options.toolOffset * self.options.toolOffsetReturn * 2)
+ self.calcOffset('PD', 0, self.options.toolOffset * 8)
# start conversion
self.process_group(self.doc, self.groupmat)
# shift an empty node in in order to process last node in cache
@@ -122,7 +122,8 @@ class hpglEncoder:
self.process_path(node, groupmat[-1])
if node.tag == inkex.addNS('g', 'svg'):
self.process_group(node, groupmat)
- groupmat.pop()
+ if trans:
+ groupmat.pop()
def process_path(self, node, mat):
# process path
diff --git a/share/extensions/hpgl_output.inx b/share/extensions/hpgl_output.inx
index a008c59e4..ac93ffe36 100644
--- a/share/extensions/hpgl_output.inx
+++ b/share/extensions/hpgl_output.inx
@@ -10,8 +10,10 @@
<param name="tab" type="notebook">
<page name="plotter" _gui-text="Plotter Settings">
<param name="pen" type="int" min="1" max="10" _gui-text="Pen number" _gui-description="The number of the pen (tool) to use, on most plotters 1 (Standard: '1')">1</param>
+ <param name="space" type="description"> </param>
<param name="resolutionX" type="float" min="1.0" max="4096.0" precision="1" _gui-text="Resolution X (dpi)" _gui-description="The amount of steps the cutter moves if it moves for 1 inch on the X axis - Try different settings to find the one that fits your plotter (Default: 1016.0)">1016.0</param>
<param name="resolutionY" type="float" min="1.0" max="4096.0" precision="1" _gui-text="Resolution Y (dpi)" _gui-description="The amount of steps the cutter moves if it moves for 1 inch on the Y axis - Try different settings to find the one that fits your plotter (Default: 1016.0)">1016.0</param>
+ <param name="space" type="description"> </param>
<param name="mirrorX" type="boolean" _gui-text="Mirror X-axis" _gui-description="Check this to mirror the X axis - Try different settings to find the one that fits your plotter (Default: Unchecked)">false</param>
<param name="mirrorY" type="boolean" _gui-text="Mirror Y-axis" _gui-description="Check this to mirror the Y axis - Try different settings to find the one that fits your plotter (Default: Unchecked)">false</param>
<param name="orientation" type="optiongroup" appearance="minimal" _gui-text="Orientation" _gui-description="Orientation of the plot - Try different settings to find the one that fits your plotter (Default: 90°)">
@@ -30,16 +32,20 @@
<param name="useToolOffset" type="boolean" _gui-text="Use tool offset correction" _gui-description="Check this to use the tool offset correction, if not checked the 'Tool offset', 'Return Factor' and 'Precut' parameters are unused (Default: Checked)">true</param>
<param name="toolOffset" type="float" min="0.0" max="20.0" precision="2" _gui-text="Tool offset (mm)" _gui-description="The offset from the tool tip to the tool axis in mm (Default: 0.25)">0.25</param>
<param name="toolOffsetReturn" type="float" min="1.0" max="10.0" precision="2" _gui-text="Return factor" _gui-description="The return factor multiplied by the tool offset is the length that is used to guide the tool back to the original path after an overcut is performed, you can only determine this value by experimentation (Default: 2.50)">2.50</param>
+ <param name="space" type="description"> </param>
<param name="precut" type="boolean" _gui-text="Use precut" _gui-description="Check this to cut a small line before the real drawing to align the tool orientation for the first cut (Default: Checked)">true</param>
- <_param name="offsetNote" type="description">Please note that using the tool offset correction will move your drawing away from the zero point by the tool offset specified on both axes.</_param>
+ <param name="space" type="description"> </param>
+ <_param name="offsetNote" type="description">Please note that using the tool offset correction will shift your drawing away from the zero point by the length of the tool offset on both axes.</_param>
</page>
<page name="misc" _gui-text="Miscellaneous">
<param name="flat" type="float" min="0.1" max="10.0" precision="1" _gui-text="Curve flatness" _gui-description="Curves are divided into lines, this number controls how fine the curves will be reproduced, the smaller the finer (Default: '1.2')">1.2</param>
- <param name="offsetX" type="float" min="-10000.0" max="10000.0" precision="2" _gui-text="X offset (mm)" _gui-description="The offset to move your plot away from the zero point in mm (Default: '0.00')">0.00</param>
- <param name="offsetY" type="float" min="-10000.0" max="10000.0" precision="2" _gui-text="Y offset (mm)" _gui-description="The offset to move your plot away from the zero point in mm (Default: '0.00')">0.00</param>
+ <param name="space" type="description"> </param>
+ <param name="offsetX" type="float" min="-10000.0" max="10000.0" precision="2" _gui-text="X offset (mm)" _gui-description="The offset to shift your plot away from the zero point in mm (Default: '0.00')">0.00</param>
+ <param name="offsetY" type="float" min="-10000.0" max="10000.0" precision="2" _gui-text="Y offset (mm)" _gui-description="The offset to shift your plot away from the zero point in mm (Default: '0.00')">0.00</param>
</page>
</param>
- <output needs-live-preview="true">
+ <_param name="plottingNote" type="description">Please use the plotter extension from the extension menu to plot directly out of Inkscape.</_param>
+ <output>
<extension>.hpgl</extension>
<mimetype>image/hpgl</mimetype>
<_filetypename>HP Graphics Language file (*.hpgl)</_filetypename>
diff --git a/share/extensions/hpgl_output.py b/share/extensions/hpgl_output.py
index b72996315..4c3217d63 100755
--- a/share/extensions/hpgl_output.py
+++ b/share/extensions/hpgl_output.py
@@ -19,8 +19,6 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'''
-# TODO:2013-07-15:Sebastian Wüst:make text to guide the user to the extension when he wants to plot
-
# standard library
import sys
# local library
@@ -64,8 +62,7 @@ class MyEffect(inkex.Effect):
def output(self):
# print to file
- if self.hpgl != 1:
- print self.hpgl
+ print self.hpgl
if __name__ == '__main__':
# Raise recursion limit to avoid exceptions on big documents
diff --git a/share/extensions/plotter.py b/share/extensions/plotter.py
index 42e348742..4556e9058 100644
--- a/share/extensions/plotter.py
+++ b/share/extensions/plotter.py
@@ -87,7 +87,6 @@ class MyEffect(inkex.Effect):
raise Exception(inst)
'''
# send data to plotter
- # TODO:2013-07-13:Sebastian Wüst:Somehow slow down sending to avoid buffer overruns in the plotter on very large drawings.
mySerial = serial.Serial(port=self.options.serialPort, baudrate=self.options.serialBaudRate, timeout=0.1, writeTimeout=None)
mySerial.write(self.hpgl)
# Read back 2 chars to avoid plotter not plotting last command (I have no idea why this is necessary)