Initial commit.

This commit is contained in:
jmsgrogan 2017-10-20 12:30:47 +01:00
parent 68d9a17dd1
commit 29ffa13092
17 changed files with 224546 additions and 0 deletions

View file

@ -0,0 +1,40 @@
import os
import product_gen.generate_lamp
import product_gen.render_lamp
from argparse import ArgumentParser
def run(color):
height = 150.0
radius = 100.0
thickness = 3.0
shade = product_gen.generate_lamp.generate_shade(height, radius, thickness)
work_dir = os.getcwd()
shade.exportStl(work_dir + "/shade.stl")
height = 20.0
radius = 15.0
thickness = 3.0
base = product_gen.generate_lamp.generate_base(height, radius, thickness)
base.exportStl(work_dir + "/base.stl")
height = 150.0
radius = 2.0
thickness = 1.0
chord = product_gen.generate_lamp.generate_chord(height, radius, thickness)
chord.exportStl(work_dir + "/chord.stl")
product_gen.render_lamp.render_lamp(work_dir + "/shade.stl",
work_dir + "/base.stl",
work_dir + "/chord.stl",
work_dir + "/lamp.png",
color = color)
if __name__ == "__main__":
parser = ArgumentParser()
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.')
args = parser.parse_args()
run([args.r, args.g, args.b])