diff --git a/extensions/fablabchemnitz/paths2openscad.inx b/extensions/fablabchemnitz/paths2openscad.inx
index cad0d7e1..c4f48c10 100644
--- a/extensions/fablabchemnitz/paths2openscad.inx
+++ b/extensions/fablabchemnitz/paths2openscad.inx
@@ -4,27 +4,16 @@
fablabchemnitz.de.paths2openscad
- {NAME}.scad
-
- 5.0
-
- true
-
-
- false
-
-
- false
-
-
- false
-
+ {NAME}.scad
+ 5.0
+ true
+ false
+ false
+ false
false
-
- 0.2
-
+ 0.2
0
@@ -33,9 +22,7 @@
-
+
1.0
100.0
@@ -49,22 +36,9 @@ Note: the 'Scale: XX %' instruction has no effect in outline mode.
-
-
-
-
- openscad "{NAME}.scad"
-
-
-
-
- openscad "{NAME}.scad" -o "{NAME}.stl"
-
-
-
- cura "{NAME}.stl" &
-
-
+ openscad "{NAME}.scad"
+ openscad "{NAME}.scad" -o "{NAME}.stl"
+ cura "{NAME}.stl" &
+Find updates at
+
diff --git a/extensions/fablabchemnitz/paths2openscad.py b/extensions/fablabchemnitz/paths2openscad.py
index d3298366..bb42ab2a 100644
--- a/extensions/fablabchemnitz/paths2openscad.py
+++ b/extensions/fablabchemnitz/paths2openscad.py
@@ -125,6 +125,7 @@ import time
import string
import tempfile
import gettext
+import subprocess
VERSION = "0.27" # CAUTION: Keep in sync with all *.inx files
DEFAULT_WIDTH = 100
@@ -147,9 +148,9 @@ RE_AUTO_ZOFFSET_DESC = re.compile(
DESC_TAGS = ["desc", inkex.addNS("desc", "svg")]
# CAUTION: keep these defaults in sync with paths2openscad.inx
-INX_SCADVIEW = os.getenv("INX_SCADVIEW", "openscad '{NAME}.scad'")
-INX_SCAD2STL = os.getenv("INX_SCAD2STL", "openscad '{NAME}.scad' -o '{NAME}.stl'")
-INX_STL_POSTPROCESSING = os.getenv("INX_STL_POSTPROCESSING", "cura '{NAME}.stl' &")
+INX_SCADVIEW = os.getenv("INX_SCADVIEW", "openscad \"{NAME}.scad\"")
+INX_SCAD2STL = os.getenv("INX_SCAD2STL", "openscad \"{NAME}.scad\" -o \"{NAME}.stl\"")
+INX_STL_POSTPROCESSING = os.getenv("INX_STL_POSTPROCESSING", "cura \"{NAME}.stl\" &")
def IsProcessRunning(pid):
@@ -158,19 +159,12 @@ def IsProcessRunning(pid):
"""
sys_platform = sys.platform.lower()
if sys_platform.startswith("win"):
- import subprocess
-
- ps = subprocess.Popen(
- r'tasklist.exe /NH /FI "PID eq %d"' % (pid),
- shell=True,
- stdout=subprocess.PIPE,
- )
- output = ps.stdout.read()
- ps.stdout.close()
- ps.wait()
- if str(pid) in output:
- return True
- return False
+ with subprocess.Popen(r'tasklist.exe /NH /FI "PID eq %d"' % (pid), shell=True, stdout=subprocess.PIPE) as ps:
+ output = ps.stdout.read()
+ ps.wait()
+ if str(pid) in output:
+ return True
+ return False
else:
# OSX sys_platform.startswith('darwin'):
# and Linux
@@ -433,15 +427,15 @@ class OpenSCAD(inkex.EffectExtension):
pars.add_argument( "--line_fn", type=int, default=int(4), help="Line width precision ($fn when constructing hull)", )
pars.add_argument( "--force_line", type=inkex.utils.Boolean, default=False, help="Force outline mode.", )
pars.add_argument( "--fname", default="{NAME}.scad", help="openSCAD output file derived from the svg file name.", )
- pars.add_argument( "--parsedesc", default="true", help="Parse zsize and other parameters from object descriptions", )
- pars.add_argument( "--scadview", default="false", help="Open the file with openscad ( details see --scadviewcmd option )", )
+ pars.add_argument( "--parsedesc", type=inkex.utils.Boolean, default=True, help="Parse zsize and other parameters from object descriptions", )
+ pars.add_argument( "--scadview", type=inkex.utils.Boolean, default=False, help="Open the file with openscad ( details see --scadviewcmd option )", )
pars.add_argument( "--scadviewcmd", default=INX_SCADVIEW, help="Command used start an openscad viewer. Use {SCAD} for the openSCAD input.", )
- pars.add_argument( "--scad2stl", default="false", help="Also convert to STL ( details see --scad2stlcmd option )", )
+ pars.add_argument( "--scad2stl", type=inkex.utils.Boolean, default=False, help="Also convert to STL ( details see --scad2stlcmd option )", )
pars.add_argument( "--scad2stlcmd", default=INX_SCAD2STL, help="Command used to convert to STL. You can use {NAME}.scad for the openSCAD file to read and "
+ "{NAME}.stl for the STL file to write.", )
- pars.add_argument( "--stlpost", default="false", help="Start e.g. a slicer. This implies the --scad2stl option. ( see --stlpostcmd )", )
+ pars.add_argument( "--stlpost", type=inkex.utils.Boolean, default=False, help="Start e.g. a slicer. This implies the --scad2stl option. ( see --stlpostcmd )", )
pars.add_argument( "--stlpostcmd", default=INX_STL_POSTPROCESSING, help="Command used for post processing an STL file (typically a slicer). You can use {NAME}.stl for the STL file.", )
- pars.add_argument( "--stlmodule",default="false", help="Output configured to comment out final rendering line, to create a module file for import.", )
+ pars.add_argument( "--stlmodule", type=inkex.utils.Boolean, default=False, help="Output configured to comment out final rendering line, to create a module file for import.", )
self.userunitsx = 1.0 # Move to pure userunits per mm for v1.0
self.userunitsy = 1.0
@@ -463,7 +457,7 @@ class OpenSCAD(inkex.EffectExtension):
self.pathid = int(0)
# Output file
- self.f = None
+ self.outfile = None
# For handling an SVG viewbox attribute, we will need to know the
# values of the document's