1
0
mirror of https://github.com/nophead/Mendel90.git synced 2025-08-17 02:34:06 +02:00

works both on windows and linux

you need to get MSVCR100D.dll somewhere to get included openscad_cl running
This commit is contained in:
Vsevolod Lobko
2012-03-12 22:55:27 +02:00
parent 04b1fa549d
commit b4f3f2040f
4 changed files with 17 additions and 8 deletions

6
bom.py
View File

@@ -1,7 +1,7 @@
import os import os
import subprocess
import sys import sys
import shutil import shutil
import openscad
class BOM(): class BOM():
def __init__(self): def __init__(self):
@@ -95,10 +95,8 @@ def boms(machine):
f. write("include <%s_config.scad>\n" % machine); f. write("include <%s_config.scad>\n" % machine);
f.close() f.close()
log = open("openscad.log", "w") openscad.run("-o", "dummy.csg", "scad/bom.scad")
subprocess.call(["openscad", "-o", "dummy.csg", "scad/bom.scad"], stdout = log, stderr = log)
print "Generating bom ...", print "Generating bom ...",
log.close()
main = BOM() main = BOM()
stack = [] stack = []

11
openscad.py Normal file
View File

@@ -0,0 +1,11 @@
import subprocess
import os
def run(*args):
if os.name == "nt":
subprocess.call(["openscad_cl"] + list(args))
else:
log = open("openscad.log", "w")
subprocess.call(["openscad"] + list(args), stdout = log, stderr = log)
log.close()

View File

@@ -1,5 +1,5 @@
import os import os
import subprocess import openscad
import shutil import shutil
import sys import sys
from dxf import * from dxf import *
@@ -49,7 +49,7 @@ def sheets(machine):
# Run openscad on the created file # Run openscad on the created file
# #
dxf_name = target_dir + "/" + module[:-4] + ".dxf" dxf_name = target_dir + "/" + module[:-4] + ".dxf"
subprocess.call(["openscad", "-o", dxf_name, dxf_maker_name]) openscad.run("-o", dxf_name, dxf_maker_name)
dxf_to_svg(dxf_name) dxf_to_svg(dxf_name)
if __name__ == '__main__': if __name__ == '__main__':

View File

@@ -1,5 +1,5 @@
import os import os
import subprocess import openscad
import shutil import shutil
import sys import sys
@@ -58,7 +58,7 @@ def stls(machine):
# Run openscad on the created file # Run openscad on the created file
# #
stl_name = target_dir + "/" + module[:-4] + ".stl" stl_name = target_dir + "/" + module[:-4] + ".stl"
subprocess.call(["openscad", "-o", stl_name, stl_maker_name]) openscad.run("-o", stl_name, stl_maker_name)
targets.remove(module) targets.remove(module)
# #