mirror of
https://github.com/nophead/Mendel90.git
synced 2025-01-16 20:38:15 +01:00
4849e642e2
The X ends now have much stronger bar clamps and the nut traps are moved to the top for less lead screw wobble. X motor bracket now has two screws in the front of the motor and one at the back allowing it to be much smaller. The Z couplings now use neoprene tubing instead of PVC and close completely. The tube end caps are now nut traps to allow the tube to just have a single hole. The rear fixing blocks now have the central screw going the other way so have onyl two nut traps. The extruder springs now have washers to increase the default tension. The spool holder now has the washers on the outside of the spool. The carriage fan bracket has been strengthened. The fan duct now has a hole to cool the top of the hot end. Small printed parts now aggregated onto one build plate. Hole in the Wade's big gear increased slightly. The heat shield is now 5 layers of cardboard instead of foil and an air gap. Bom generation and exploded view mode can now be enabled on the command line. The assembly diagrams for the manual are now built from the command line. Some mods for the Huxley version but still broken. Fixed the long ATX bracket holes ending coincident with the face. Can now have non square print beds. Cap screws now shown silver instead of black as now all BZP. Now shows the motor wire position. % operator no longer used for transparency as OpenScad behaviour has changed. Now includes the Skeinforge and Pronteface configurations on the SD card of priovided in the kit.
99 lines
3.0 KiB
Python
Executable File
99 lines
3.0 KiB
Python
Executable File
#!/usr/bin/env python
|
|
|
|
import os
|
|
import openscad
|
|
import shutil
|
|
import sys
|
|
import c14n_stl
|
|
|
|
source_dir = "scad"
|
|
|
|
def bom_to_stls(machine):
|
|
#
|
|
# Make a list of all the stls in the BOM
|
|
#
|
|
stl_files = []
|
|
for line in open(machine + "/bom/bom.txt", "rt").readlines():
|
|
words = line.split()
|
|
if words:
|
|
last_word = words[-1]
|
|
if len(last_word) > 4 and last_word[-4:] == ".stl":
|
|
stl_files.append(last_word)
|
|
return stl_files
|
|
|
|
def stls(machine, parts = None):
|
|
#
|
|
# Make the target directory
|
|
#
|
|
target_dir = machine + "/stls"
|
|
if os.path.isdir(target_dir):
|
|
if not parts:
|
|
shutil.rmtree(target_dir) #if making the BOM clear the directory first
|
|
os.makedirs(target_dir)
|
|
else:
|
|
os.makedirs(target_dir)
|
|
|
|
#
|
|
# Set the target machine
|
|
#
|
|
f = open("scad/conf/machine.scad","wt")
|
|
f. write("include <%s_config.scad>\n" % machine);
|
|
f.close()
|
|
|
|
#
|
|
# Decide which files to make
|
|
#
|
|
if parts:
|
|
targets = list(parts) #copy the list so we dont modify the list passed in
|
|
else:
|
|
targets = bom_to_stls(machine)
|
|
#
|
|
# Find all the scad files
|
|
#
|
|
used = []
|
|
for filename in os.listdir(source_dir):
|
|
if filename[-5:] == ".scad":
|
|
#
|
|
# find any modules ending in _stl
|
|
#
|
|
for line in open(source_dir + "/" + filename, "r").readlines():
|
|
words = line.split()
|
|
if(len(words) and words[0] == "module"):
|
|
module = words[1].split('(')[0]
|
|
stl = module.replace("_stl", ".stl")
|
|
if stl in targets:
|
|
#
|
|
# make a file to use the module
|
|
#
|
|
stl_maker_name = source_dir + "/stl.scad"
|
|
f = open(stl_maker_name, "w")
|
|
f.write("use <%s>\n" % filename)
|
|
f.write("%s();\n" % module);
|
|
f.close()
|
|
#
|
|
# Run openscad on the created file
|
|
#
|
|
stl_name = target_dir + "/" + module[:-4] + ".stl"
|
|
openscad.run("-D$bom=1","-o", stl_name, stl_maker_name)
|
|
c14n_stl.canonicalise(stl_name)
|
|
targets.remove(stl)
|
|
#
|
|
# Add the files on the BOM to the used list for plates.py
|
|
#
|
|
for line in open("openscad.log"):
|
|
if line[:7] == 'ECHO: "' and line[-6:] == '.stl"\n':
|
|
used.append(line[7:-2])
|
|
#
|
|
# List the ones we didn't find
|
|
#
|
|
for module in targets:
|
|
print "Could not find", module
|
|
return used
|
|
|
|
if __name__ == '__main__':
|
|
if len(sys.argv) > 1:
|
|
stls(sys.argv[1], sys.argv[2:])
|
|
else:
|
|
print "usage: stls [mendel|sturdy|your_machine] [part.stl ...]"
|
|
sys.exit(1)
|