mirror of
https://github.com/nophead/Mendel90.git
synced 2025-08-16 10:14:00 +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:
6
bom.py
6
bom.py
@@ -1,7 +1,7 @@
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
import shutil
|
||||
import openscad
|
||||
|
||||
class BOM():
|
||||
def __init__(self):
|
||||
@@ -95,10 +95,8 @@ def boms(machine):
|
||||
f. write("include <%s_config.scad>\n" % machine);
|
||||
f.close()
|
||||
|
||||
log = open("openscad.log", "w")
|
||||
subprocess.call(["openscad", "-o", "dummy.csg", "scad/bom.scad"], stdout = log, stderr = log)
|
||||
openscad.run("-o", "dummy.csg", "scad/bom.scad")
|
||||
print "Generating bom ...",
|
||||
log.close()
|
||||
|
||||
main = BOM()
|
||||
stack = []
|
||||
|
11
openscad.py
Normal file
11
openscad.py
Normal 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()
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import os
|
||||
import subprocess
|
||||
import openscad
|
||||
import shutil
|
||||
import sys
|
||||
from dxf import *
|
||||
@@ -49,7 +49,7 @@ def sheets(machine):
|
||||
# Run openscad on the created file
|
||||
#
|
||||
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)
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
4
stls.py
4
stls.py
@@ -1,5 +1,5 @@
|
||||
import os
|
||||
import subprocess
|
||||
import openscad
|
||||
import shutil
|
||||
import sys
|
||||
|
||||
@@ -58,7 +58,7 @@ def stls(machine):
|
||||
# Run openscad on the created file
|
||||
#
|
||||
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)
|
||||
|
||||
#
|
||||
|
Reference in New Issue
Block a user