Add more general shape description.
This commit is contained in:
parent
cfb558e540
commit
422f458469
27 changed files with 234 additions and 106 deletions
|
@ -7,6 +7,7 @@ import sys
|
|||
import random
|
||||
import json
|
||||
import product_gen.generate_product
|
||||
import product_gen.shapes.shape_description as sd
|
||||
from argparse import ArgumentParser
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
@ -23,25 +24,15 @@ if __name__ == "__main__":
|
|||
|
||||
# Global bounding box
|
||||
bbox_xmax = 2.2
|
||||
bbox_ymax = 2.5
|
||||
bbox_ymax = 20.0
|
||||
|
||||
# Minimum feature sizes
|
||||
feature_xmin = 0.4
|
||||
feature_ymin = 1.0
|
||||
|
||||
height = 1.0 + random.random()*1.5
|
||||
radius = 0.2 + random.random()*1.0
|
||||
color = [0.1, 0.1, 0.1]
|
||||
shape_parameters = sd.get_random_shape_description(shape,
|
||||
[bbox_xmax, bbox_ymax],
|
||||
[feature_xmin, feature_ymin])
|
||||
|
||||
height, radius, color = product_gen.generate_product.generate(shape,
|
||||
height,
|
||||
radius,
|
||||
color,
|
||||
output)
|
||||
|
||||
shape_parameters = {"shape": shape,
|
||||
"height": height,
|
||||
"radius": radius,
|
||||
"color": color}
|
||||
shape_parameters = product_gen.generate_product.generate(shape_parameters, output)
|
||||
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