Add Dockerfile and modify generator script to change shapes and take a unique file id.
This commit is contained in:
parent
29ffa13092
commit
c9c98f91dc
18 changed files with 166867 additions and 57 deletions
|
@ -4,37 +4,48 @@ import product_gen.render_lamp
|
|||
|
||||
from argparse import ArgumentParser
|
||||
|
||||
def run(color):
|
||||
height = 150.0
|
||||
radius = 100.0
|
||||
def run(height, radius, color, output_id):
|
||||
thickness = 3.0
|
||||
shade = product_gen.generate_lamp.generate_shade(height, radius, thickness)
|
||||
work_dir = os.getcwd()
|
||||
shade.exportStl(work_dir + "/shade.stl")
|
||||
shade.exportStl(work_dir + "/shade_" + output_id + ".stl")
|
||||
|
||||
height = 20.0
|
||||
radius = 15.0
|
||||
base_height = 20.0
|
||||
base_radius = 15.0
|
||||
thickness = 3.0
|
||||
base = product_gen.generate_lamp.generate_base(height, radius, thickness)
|
||||
base.exportStl(work_dir + "/base.stl")
|
||||
base = product_gen.generate_lamp.generate_base(base_height,
|
||||
base_radius,
|
||||
thickness)
|
||||
base.exportStl(work_dir + "/base_" + output_id + ".stl")
|
||||
|
||||
height = 150.0
|
||||
radius = 2.0
|
||||
chord_height = 150.0
|
||||
chord_radius = 2.0
|
||||
thickness = 1.0
|
||||
chord = product_gen.generate_lamp.generate_chord(height, radius, thickness)
|
||||
chord.exportStl(work_dir + "/chord.stl")
|
||||
chord = product_gen.generate_lamp.generate_chord(chord_height,
|
||||
chord_radius,
|
||||
thickness)
|
||||
chord.exportStl(work_dir + "/chord_" + output_id + ".stl")
|
||||
|
||||
product_gen.render_lamp.render_lamp(work_dir + "/shade.stl",
|
||||
work_dir + "/base.stl",
|
||||
work_dir + "/chord.stl",
|
||||
work_dir + "/lamp.png",
|
||||
product_gen.render_lamp.render_lamp(work_dir + "/shade_" + output_id + ".stl",
|
||||
work_dir + "/base_" + output_id + ".stl",
|
||||
work_dir + "/chord_" + output_id + ".stl",
|
||||
work_dir + "/lamp_" + output_id + ".png",
|
||||
color = color)
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = ArgumentParser()
|
||||
parser.add_argument('-height', type=float, help='Height.')
|
||||
parser.add_argument('-radius', type=float, help='Radius.')
|
||||
parser.add_argument('-r', type=float, help='Red intensity.')
|
||||
parser.add_argument('-g', type=float, help='Red intensity.')
|
||||
parser.add_argument('-b', type=float, help='Red intensity.')
|
||||
parser.add_argument('-g', type=float, help='Green intensity.')
|
||||
parser.add_argument('-b', type=float, help='Blue intensity.')
|
||||
parser.add_argument('-o', type=str, help='Output identifier.')
|
||||
parser.add_argument('-s', type=int, help='Stage identifier.')
|
||||
|
||||
args = parser.parse_args()
|
||||
run([args.r, args.g, args.b])
|
||||
color = [args.r, args.g, args.b]
|
||||
if args.s == 0:
|
||||
color = [18.0, 18.0, 18.0]
|
||||
|
||||
run(args.height, args.radius, color, args.o)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue