stl.py

changeset 19
32de35694e56
parent 14
ba3d8c56e6f5
equal deleted inserted replaced
18:ff1941c85fd3 19:32de35694e56
1 """ 1 """
2 STL related helpers 2 STL related helpers
3 """ 3 """
4 4
5 import os, subprocess, vtk 5 import os, subprocess
6 import config, data 6 import config, data
7 7
8 OPENSCAD_MODULES = """ 8 OPENSCAD_MODULES = """
9 module tank(x, r, h) { 9 module tank(x, r, h) {
10 color("SteelBlue") render() { //rotate([90,0,0]) { 10 color("SteelBlue") render() { //rotate([90,0,0]) {
34 34
35 def run_openscad(output): 35 def run_openscad(output):
36 """ 36 """
37 Run openSCAD process, then convert the ascii stl to binary by using vtk 37 Run openSCAD process, then convert the ascii stl to binary by using vtk
38 """ 38 """
39 import vtk
39 if os.path.isfile(output): 40 if os.path.isfile(output):
40 print "skipping existing file %s" % output 41 print "skipping existing file %s" % output
41 return 42 return
42 print "rendering %s" % output 43 print "rendering %s" % output
43 subprocess.check_call([ 44 subprocess.check_call([

mercurial