1
0
mirror of https://github.com/nophead/Mendel90.git synced 2025-08-25 14:11:01 +02:00

Mods to python scripts to allow boms and stls for accessories to be made.

This commit is contained in:
Chris Palmer
2014-06-12 19:21:16 +01:00
parent 4755176066
commit 055ae49547
4 changed files with 115 additions and 26 deletions

12
stls.py
View File

@@ -6,14 +6,18 @@ import shutil
import sys
import c14n_stl
source_dir = "scad"
from bom import source_dir
def bom_to_stls(machine):
def bom_to_stls(machine, assembly = None):
#
# Make a list of all the stls in the BOM
#
stl_files = []
for line in open(machine + "/bom/bom.txt", "rt").readlines():
if assembly:
bom = "accessories/%s.txt" % assembly
else:
bom = "bom.txt"
for line in open(machine + "/bom/" + bom, "rt").readlines():
words = line.split()
if words:
last_word = words[-1]
@@ -36,7 +40,7 @@ def stls(machine, parts = None):
#
# Set the target machine
#
f = open("scad/conf/machine.scad","wt")
f = open(source_dir + "/conf/machine.scad","wt")
f. write("include <%s_config.scad>\n" % machine);
f.close()