File size: 734 Bytes
1a725f4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import json

asset_data = json.load(open("../procthor_assets/asset-database.json", "r"))

results = {}
for asset in asset_data["Window"]:
    results[asset['assetId']] = {"boundingBox": asset["boundingBox"]}
    results[asset['assetId']]["size"] = [asset["boundingBox"]["x"] * 100, asset["boundingBox"]["y"] * 100]

    if "Bay" in asset['assetId']:
        results[asset['assetId']]["type"] = "bay"
    elif "Fixed" in asset['assetId']:
        results[asset['assetId']]["type"] = "fixed"
    elif "Hung" in asset['assetId']:
        results[asset['assetId']]["type"] = "hung"
    elif "Slider" in asset['assetId']:
        results[asset['assetId']]["type"] = "slider"

json.dump(results, open("window-database.json", "w"), indent=4)