From 716f0bf4efad16c5f11ed4ee8ba42ed77336fbc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9=20Rios?= Date: Wed, 3 Apr 2024 14:27:58 +0200 Subject: [PATCH] Added rotation + round position --- AR/source/script.py | 2 +- Converter/source/classes/dcTrackToOGrEE.py | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/AR/source/script.py b/AR/source/script.py index 4eae666..5ac0e16 100644 --- a/AR/source/script.py +++ b/AR/source/script.py @@ -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) diff --git a/Converter/source/classes/dcTrackToOGrEE.py b/Converter/source/classes/dcTrackToOGrEE.py index 15d2f49..0bd16c2 100644 --- a/Converter/source/classes/dcTrackToOGrEE.py +++ b/Converter/source/classes/dcTrackToOGrEE.py @@ -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", @@ -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",