1
0
mirror of https://github.com/nophead/Mendel90.git synced 2025-01-16 12:29:46 +01:00
Mendel90/accessories.py
Chris Palmer ad21323ec6 Mods to support e3d in the main branch.
Tweaks to the huxley extruder.
Now shows hot end filament diameter on the BOM.
Moved huxley spool holder back to give more room for lighting.
Updated README.md.
Added huxley to command line usage messages.
2016-01-16 10:47:25 +00:00

58 lines
1.5 KiB
Python

#!/usr/bin/env python
from __future__ import print_function
import sys
import bom
import stls
import shutil
import os
def accessories(machine, assembly = None):
assemblies = [
"raspberry_pi_assembly",
"raspberry_pi_camera_assembly",
"light_strip_assembly",
"z_limit_switch_assembly"
]
#
# Make the target directory
#
target_dir = machine + "/stls/accessories"
if os.path.isdir(target_dir):
if not assembly:
shutil.rmtree(target_dir) #if making all of them clear the directory first
os.makedirs(target_dir)
else:
os.makedirs(target_dir)
if assembly:
assemblies = [ assembly ]
for assembly in assemblies:
print(assembly)
bom.boms(machine, assembly)
stl_list = stls.bom_to_stls(machine, assembly)
stls.stls(machine, stl_list)
#
# Move all the stls that are not in the plates to the plates directory
#
for file in stl_list:
src = machine + "/stls/"+ file
if os.path.isfile(src):
shutil.move(src, target_dir + "/" + file)
else:
print("can't find %s to move" % src)
if __name__ == '__main__':
args = len(sys.argv)
if args in [2,3]:
if args == 3:
accessories(sys.argv[1], sys.argv[2])
else:
accessories(sys.argv[1])
else:
print("usage: accessories dibond|mendel|sturdy|huxley|your_machine [assembly_name]")
sys.exit(1)