Skip to content

Commit

Permalink
Added rotation + round position
Browse files Browse the repository at this point in the history
  • Loading branch information
Novanef committed Apr 3, 2024
1 parent 3dfcde4 commit 716f0bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion AR/source/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def main(roomName : str, devices: bool, fbx:bool):
if rackData['attributes']['template'] not in loadedTemplates:
file.write(f".template:{converter.templatePath}/{rackData['attributes']['template']}.json\n")
loadedTemplates.append(rackData['attributes']['template'])
file.write(f'+rk:/P/NOE/BI2/{roomName}/{rackData["name"]}@{rackData["attributes"]["posXYZ"]}@m@[0,0,0]@{rackData["attributes"]["template"]}\n')
file.write(f'+rk:/P/NOE/BI2/{roomName}/{rackData["name"]}@{rackData["attributes"]["posXYZ"]}@m@{rackData["attributes"]["rotation"]}@{rackData["attributes"]["template"]}\n')
loadedTemplates = WriteChildren(loadedTemplates, file,converter,roomName,rackData)


Expand Down
9 changes: 2 additions & 7 deletions Converter/source/classes/dcTrackToOGrEE.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def BuildRack(self, data: dict[str, Any]) -> dict[str, Any]:
"orientation": "front", # ???
"posXYZ": "[0,0,0]", # ???
"posXYUnit": "t",
"size": f'[{float(data["sizeWDHmm"][0]) / 10},{float(data["sizeWDHmm"][1]) / 10}]',
"size": f'[{round(float(data["sizeWDHmm"][0]) / 10,2)},{round(float(data["sizeWDHmm"][1]) / 10,2)}]',
"sizeUnit": "cm",
"height": str(float(data["sizeWDHmm"][2]) / 10),
"heightUnit": "cm",
Expand Down Expand Up @@ -223,12 +223,7 @@ def BuildDevice(self, data: dict[str, Any]) -> dict[str, Any]:
"domain": data["domain"] if "domain" in data else "",
"attributes": {
"orientation": "front", # Needs more precision
"size": json.dumps(
{
"x": data["sizeWDHmm"][0],
"y": data["sizeWDHmm"][1],
}
),
"size": f'[{round(float(data["sizeWDHmm"][0]) / 10,2)},{round(float(data["sizeWDHmm"][1]) / 10,2)}]',
"sizeUnit": "mm",
"height": data["sizeWDHmm"][2],
"heightUnit": "mm",
Expand Down

0 comments on commit 716f0bf

Please sign in to comment.