import os
import sys
import random
import json
import product_gen.generate_product
import shapes.shape_description as sd
from argparse import ArgumentParser

if __name__ == "__main__":
    
    shape = "pendant"
    output = "test"
    
    if not os.path.exists(os.getcwd() + "/" + output):
        os.makedirs(os.getcwd() + "/" + output)
    
    # Global bounding box
    bbox_xmax = 4.0
    bbox_ymax = 5.0
    
    # Minimum feature sizes
    feature_xmin = 0.4
    feature_ymin = 1.0
    shape_parameters = sd.get_random_shape_description(shape, 
                                                       [bbox_xmax, bbox_ymax],
                                                       [feature_xmin, feature_ymin])
    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)
