1
1
from jax import numpy as np , tree_map
2
- from raymarch import Objects , Camera , OBJECT_IDX
2
+ from raymarch import Objects , Camera , OBJECTS
3
3
4
4
# typing
5
5
from typeguard import check_type
@@ -18,7 +18,7 @@ class ObjectDict(TypedDict):
18
18
color : Tuple [float , float , float ]
19
19
position : Tuple [float , float , float ]
20
20
rotation : Tuple [float , float , float ]
21
- mirror : Tuple [float , float , float ]
21
+ mirror : Tuple [int , int , int ]
22
22
rounding : float
23
23
24
24
@@ -57,7 +57,7 @@ def check_scene_dict(scene_dict: Dict[str, Any]) -> SceneDict:
57
57
# checking the obj_names and adding default values where needed
58
58
for i in range (len (scene_dict ['Objects' ])):
59
59
obj_name , obj_dict = next (iter (scene_dict ['Objects' ][i ].items ())) # first item of dict
60
- assert obj_name in OBJECT_IDX , f'Unknown object name { obj_name } '
60
+ assert obj_name in OBJECTS , f'Unknown object name { obj_name } '
61
61
scene_dict ['Objects' ][i ] = (obj_name , add_obj_dict_defaults (** obj_dict ))
62
62
63
63
return check_type (scene_dict , SceneDict )
@@ -72,7 +72,7 @@ def build_scene(scene_dict: SceneDict) -> Dict[str, Any]:
72
72
obj_args ['mirrorings' ] = obj_args .pop ('mirrors' ).astype (np .bool_ ) # convert mirrorings
73
73
return {
74
74
'objects' : Objects (
75
- object_ids = np .uint8 ([OBJECT_IDX [ o ] for o in obj_names ]), # type: ignore
75
+ ids = np .uint8 ([OBJECTS . index ( o ) for o in obj_names ]), # type: ignore
76
76
** obj_args ,
77
77
smoothing = np .float32 (scene_dict ['smoothing' ]),
78
78
),
0 commit comments