Add json only input.
This commit is contained in:
parent
c9c98f91dc
commit
afbacca3f4
21 changed files with 89611 additions and 118 deletions
28
src/utility/generate_shape.py
Normal file
28
src/utility/generate_shape.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
import os
|
||||
import sys
|
||||
import random
|
||||
import json
|
||||
import product_gen.generate_lamp
|
||||
from argparse import ArgumentParser
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
shape_params = json.loads(sys.argv[1])
|
||||
shape = shape_params['shape']
|
||||
output = shape_params['output']
|
||||
|
||||
if not os.path.exists(os.getcwd() + "/" + output):
|
||||
os.makedirs(os.getcwd() + "/" + output)
|
||||
|
||||
height = 100.0 + random.random()*150.0
|
||||
radius = 20.0 + random.random()*100.0
|
||||
color = [18.0, 18.0, 18.0]
|
||||
|
||||
product_gen.generate_lamp.generate(shape, height, radius, color, output)
|
||||
|
||||
shape_parameters = {"shape": shape,
|
||||
"height": height,
|
||||
"radius": radius,
|
||||
"color": color}
|
||||
with open(os.getcwd() + "/" + output + "/"+ output + '.json', 'w') as outfile:
|
||||
json.dump(shape_parameters, outfile)
|
Loading…
Add table
Add a link
Reference in a new issue