mirror of
https://github.com/nophead/Mendel90.git
synced 2025-08-15 17:53:57 +02:00
allow building selected stl's
This commit is contained in:
7
stls.py
7
stls.py
@@ -5,7 +5,7 @@ import sys
|
|||||||
|
|
||||||
source_dir = "scad"
|
source_dir = "scad"
|
||||||
|
|
||||||
def stls(machine):
|
def stls(machine, parts = None):
|
||||||
#
|
#
|
||||||
# Make the target directory
|
# Make the target directory
|
||||||
#
|
#
|
||||||
@@ -30,6 +30,7 @@ def stls(machine):
|
|||||||
if words:
|
if words:
|
||||||
last_word = words[-1]
|
last_word = words[-1]
|
||||||
if len(last_word) > 4 and last_word[-4:] == ".stl":
|
if len(last_word) > 4 and last_word[-4:] == ".stl":
|
||||||
|
if not parts or (last_word in parts):
|
||||||
targets.append(last_word.replace(".stl", "_stl"))
|
targets.append(last_word.replace(".stl", "_stl"))
|
||||||
|
|
||||||
|
|
||||||
@@ -69,7 +70,7 @@ def stls(machine):
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
if len(sys.argv) > 1:
|
if len(sys.argv) > 1:
|
||||||
stls(sys.argv[1])
|
stls(sys.argv[1], sys.argv[2:])
|
||||||
else:
|
else:
|
||||||
print "usage: stls [mendel|sturdy|your_machine]"
|
print "usage: stls [mendel|sturdy|your_machine] [part.stl ...]"
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
Reference in New Issue
Block a user