Skip to content

Commit

Permalink
feat: adding transforms to pinpoint-api
Browse files Browse the repository at this point in the history
  • Loading branch information
dbirman committed Sep 7, 2024
1 parent 4273d58 commit eb69b10
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ readme = "README.md"
dynamic = ["version"]

dependencies = [
'oursin',
'vbl-aquarium'
]

[project.optional-dependencies]
Expand Down
1 change: 1 addition & 0 deletions src/pinpoint_api/models/Default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"Default","prefix":"","scaling":{"x":1.0,"y":1.0,"z":1.0},"rotation":{"x":0.0,"y":0.0,"z":0.0}}
1 change: 1 addition & 0 deletions src/pinpoint_api/models/Dorr2008.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"Dorr2008","prefix":"d08","scaling":{"x":-1.087,"y":1.0,"z":-0.952},"rotation":{"x":0.0,"y":-7.5,"z":0.0}}
1 change: 1 addition & 0 deletions src/pinpoint_api/models/IBL-Dorr2008.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"IBL-Dorr2008","prefix":"id08","scaling":{"x":-1.087,"y":1.0,"z":-0.952},"rotation":{"x":0.0,"y":0.0,"z":0.0}}
1 change: 1 addition & 0 deletions src/pinpoint_api/models/Qiu2018.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"Qiu2018","prefix":"q18","scaling":{"x":-1.031,"y":0.952,"z":-0.885},"rotation":{"x":0.0,"y":-7.5,"z":0.0}}
62 changes: 62 additions & 0 deletions src/pinpoint_api/models/transforms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
from vbl_aquarium.models.pinpoint import AffineTransformModel
from vbl_aquarium.models.unity import Vector3

qiu2018 = AffineTransformModel(
name = "Qiu2018",
prefix = "q18",
scaling = Vector3(
x = -1.031,
y = 0.952,
z = -0.885
),
rotation = Vector3(
x = 0,
y = -7.5,
z = 0
)
)

dorr2018 = AffineTransformModel(
name = "Dorr2008",
prefix = "d08",
scaling = Vector3(
x = -1.087,
y = 1,
z = -0.952
),
rotation = Vector3(
x = 0,
y = -7.5,
z = 0
)
)

dorr2018_ibl = AffineTransformModel(
name = "IBL-Dorr2008",
prefix = "id08",
scaling = Vector3(
x = -1.087,
y = 1,
z = -0.952
),
rotation = Vector3(
x = 0,
y = 0,
z = 0
)
)

default = AffineTransformModel(
name = "Default",
prefix = "",
scaling = Vector3(
x = 1,
y = 1,
z = 1
),
rotation = Vector3(
x = 0,
y = 0,
z = 0
)
)
7 changes: 7 additions & 0 deletions src/pinpoint_api/scripts/build_models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from pinpoint_api.models.transforms import qiu2018, dorr2018, dorr2018_ibl, default

transforms = [qiu2018, dorr2018, dorr2018_ibl, default]

for transform in transforms:
with open(f'../models/{transform.name}.json', 'w') as file:
file.write(transform.model_dump_json())

0 comments on commit eb69b10

Please sign in to comment.