|
15 | 15 | from surface_tracker.surface import Surface |
16 | 16 | from surface_tracker.surface_online import Surface_Online |
17 | 17 | from surface_tracker.surface_offline import Surface_Offline |
18 | | -from surface_tracker.surface_marker_aggregate import Surface_Marker_Aggregate, Surface_Marker_UID |
| 18 | +from surface_tracker.surface_marker_aggregate import ( |
| 19 | + Surface_Marker_Aggregate, |
| 20 | + Surface_Marker_UID, |
| 21 | +) |
19 | 22 |
|
20 | 23 |
|
21 | 24 | __all__ = [ |
|
29 | 32 |
|
30 | 33 |
|
31 | 34 | def surface_pairs() -> typing.Collection[typing.Tuple[Surface, dict]]: |
32 | | - return ( |
33 | | - (SURFACE_V00_DESERIALIZED, SURFACE_V00_SERIALIZED), |
34 | | - ) |
| 35 | + return ((SURFACE_V00_DESERIALIZED, SURFACE_V00_SERIALIZED),) |
| 36 | + |
35 | 37 |
|
36 | 38 | def surfaces_serialized() -> typing.Collection[dict]: |
37 | 39 | return tuple(s for d, s in surface_pairs()) |
38 | 40 |
|
| 41 | + |
39 | 42 | def surfaces_deserialized() -> typing.Collection[Surface]: |
40 | 43 | return tuple(d for d, s in surface_pairs()) |
41 | 44 |
|
42 | | -def surface_marker_aggregate_pairs() -> typing.Collection[typing.Tuple[Surface_Marker_Aggregate, dict]]: |
| 45 | + |
| 46 | +def surface_marker_aggregate_pairs() -> typing.Collection[ |
| 47 | + typing.Tuple[Surface_Marker_Aggregate, dict] |
| 48 | +]: |
43 | 49 | return ( |
44 | | - (SURFACE_MARKER_AGGREGATE_V00_DESERIALIZED_0_DIST, SURFACE_MARKER_AGGREGATE_V00_SERIALIZED_0_DIST), |
45 | | - (SURFACE_MARKER_AGGREGATE_V00_DESERIALIZED_1_DIST, SURFACE_MARKER_AGGREGATE_V00_SERIALIZED_1_DIST), |
46 | | - (SURFACE_MARKER_AGGREGATE_V00_DESERIALIZED_0_UNDIST, SURFACE_MARKER_AGGREGATE_V00_SERIALIZED_0_UNDIST), |
47 | | - (SURFACE_MARKER_AGGREGATE_V00_DESERIALIZED_1_UNDIST, SURFACE_MARKER_AGGREGATE_V00_SERIALIZED_1_UNDIST), |
| 50 | + ( |
| 51 | + SURFACE_MARKER_AGGREGATE_V00_DESERIALIZED_0_DIST, |
| 52 | + SURFACE_MARKER_AGGREGATE_V00_SERIALIZED_0_DIST, |
| 53 | + ), |
| 54 | + ( |
| 55 | + SURFACE_MARKER_AGGREGATE_V00_DESERIALIZED_1_DIST, |
| 56 | + SURFACE_MARKER_AGGREGATE_V00_SERIALIZED_1_DIST, |
| 57 | + ), |
| 58 | + ( |
| 59 | + SURFACE_MARKER_AGGREGATE_V00_DESERIALIZED_0_UNDIST, |
| 60 | + SURFACE_MARKER_AGGREGATE_V00_SERIALIZED_0_UNDIST, |
| 61 | + ), |
| 62 | + ( |
| 63 | + SURFACE_MARKER_AGGREGATE_V00_DESERIALIZED_1_UNDIST, |
| 64 | + SURFACE_MARKER_AGGREGATE_V00_SERIALIZED_1_UNDIST, |
| 65 | + ), |
48 | 66 | ) |
49 | 67 |
|
| 68 | + |
50 | 69 | def surface_marker_aggregates_serialized() -> typing.Collection[dict]: |
51 | 70 | return tuple(s for d, s in surface_marker_aggregate_pairs()) |
52 | 71 |
|
53 | | -def surface_marker_aggregates_deserialized() -> typing.Collection[Surface_Marker_Aggregate]: |
54 | | - return tuple(d for d, s in surface_marker_aggregate_pairs()) |
55 | 72 |
|
| 73 | +def surface_marker_aggregates_deserialized() -> typing.Collection[ |
| 74 | + Surface_Marker_Aggregate |
| 75 | +]: |
| 76 | + return tuple(d for d, s in surface_marker_aggregate_pairs()) |
56 | 77 |
|
57 | 78 |
|
58 | 79 | ##### PRIVATE |
59 | 80 |
|
60 | 81 |
|
61 | 82 | SURFACE_MARKER_AGGREGATE_V00_SERIALIZED_0_UNDIST = { |
62 | | - 'id': 7, |
63 | | - 'verts_uv': [ |
64 | | - [2.0279725503600556e-14, -2.0718593602363743e-14], |
65 | | - [0.09232430905103683, 0.0054827057756483555], |
66 | | - [0.09320462495088577, 0.07479614019393921], |
67 | | - [0.008808332495391369, 0.07134716212749481] |
68 | | - ] |
| 83 | + "id": 7, |
| 84 | + "verts_uv": [ |
| 85 | + [2.0279725503600556e-14, -2.0718593602363743e-14], |
| 86 | + [0.09232430905103683, 0.0054827057756483555], |
| 87 | + [0.09320462495088577, 0.07479614019393921], |
| 88 | + [0.008808332495391369, 0.07134716212749481], |
| 89 | + ], |
69 | 90 | } |
70 | 91 | SURFACE_MARKER_AGGREGATE_V00_SERIALIZED_1_UNDIST = { |
71 | | - 'id': 57, |
72 | | - 'verts_uv': [ |
73 | | - [0.9255635738372803, 0.9278208017349243], |
74 | | - [0.9941799640655518, 0.928483784198761], |
75 | | - [0.9941900372505188, 0.9999602437019348], |
76 | | - [0.9251440763473511, 0.998592734336853] |
77 | | - ] |
| 92 | + "id": 57, |
| 93 | + "verts_uv": [ |
| 94 | + [0.9255635738372803, 0.9278208017349243], |
| 95 | + [0.9941799640655518, 0.928483784198761], |
| 96 | + [0.9941900372505188, 0.9999602437019348], |
| 97 | + [0.9251440763473511, 0.998592734336853], |
| 98 | + ], |
78 | 99 | } |
79 | 100 | SURFACE_MARKER_AGGREGATE_V00_SERIALIZED_0_DIST = { |
80 | | - 'id': 7, |
81 | | - 'verts_uv': [ |
82 | | - [1.9851928125457982e-14, -1.923472062778219e-14], |
83 | | - [0.060702838003635406, -0.004638743586838245], |
84 | | - [0.05217646434903145, 0.06511983275413513], |
85 | | - [-0.009258653968572617, 0.06691507995128632] |
86 | | - ] |
| 101 | + "id": 7, |
| 102 | + "verts_uv": [ |
| 103 | + [1.9851928125457982e-14, -1.923472062778219e-14], |
| 104 | + [0.060702838003635406, -0.004638743586838245], |
| 105 | + [0.05217646434903145, 0.06511983275413513], |
| 106 | + [-0.009258653968572617, 0.06691507995128632], |
| 107 | + ], |
87 | 108 | } |
88 | 109 | SURFACE_MARKER_AGGREGATE_V00_SERIALIZED_1_DIST = { |
89 | | - 'id': 57, |
90 | | - 'verts_uv': [ |
91 | | - [0.9114755799300843, 0.9409661768393776], |
92 | | - [0.9818958957355025, 0.9379570537747127], |
93 | | - [0.9800677671918846, 1.005555440640987], |
94 | | - [0.909855488690773, 1.0082552654603305] |
95 | | - ] |
| 110 | + "id": 57, |
| 111 | + "verts_uv": [ |
| 112 | + [0.9114755799300843, 0.9409661768393776], |
| 113 | + [0.9818958957355025, 0.9379570537747127], |
| 114 | + [0.9800677671918846, 1.005555440640987], |
| 115 | + [0.909855488690773, 1.0082552654603305], |
| 116 | + ], |
96 | 117 | } |
97 | 118 | SURFACE_V00_SERIALIZED = { |
98 | | - 'name': 'surface_v00', |
99 | | - 'real_world_size': {'x': 1.0, 'y': 1.0}, |
100 | | - 'reg_markers': [ |
| 119 | + "name": "surface_v00", |
| 120 | + "real_world_size": {"x": 1.0, "y": 1.0}, |
| 121 | + "reg_markers": [ |
101 | 122 | SURFACE_MARKER_AGGREGATE_V00_SERIALIZED_0_UNDIST, |
102 | 123 | SURFACE_MARKER_AGGREGATE_V00_SERIALIZED_1_UNDIST, |
103 | 124 | ], |
104 | | - 'registered_markers_dist': [ |
| 125 | + "registered_markers_dist": [ |
105 | 126 | SURFACE_MARKER_AGGREGATE_V00_SERIALIZED_0_DIST, |
106 | 127 | SURFACE_MARKER_AGGREGATE_V00_SERIALIZED_1_DIST, |
107 | 128 | ], |
108 | | - 'build_up_status': 1.0, |
109 | | - 'deprecated': False |
| 129 | + "build_up_status": 1.0, |
| 130 | + "deprecated": False, |
110 | 131 | } |
111 | 132 |
|
112 | 133 | SURFACE_MARKER_AGGREGATE_V00_DESERIALIZED_0_UNDIST = Surface_Marker_Aggregate( |
113 | 134 | uid=Surface_Marker_UID("legacy:7"), |
114 | | - verts_uv=np.asarray([ |
115 | | - [2.0279725503600556e-14, -2.0718593602363743e-14], |
116 | | - [0.09232430905103683, 0.0054827057756483555], |
117 | | - [0.09320462495088577, 0.07479614019393921], |
118 | | - [0.008808332495391369, 0.07134716212749481] |
119 | | - ]) |
| 135 | + verts_uv=np.asarray( |
| 136 | + [ |
| 137 | + [2.0279725503600556e-14, -2.0718593602363743e-14], |
| 138 | + [0.09232430905103683, 0.0054827057756483555], |
| 139 | + [0.09320462495088577, 0.07479614019393921], |
| 140 | + [0.008808332495391369, 0.07134716212749481], |
| 141 | + ] |
| 142 | + ), |
120 | 143 | ) |
121 | 144 | SURFACE_MARKER_AGGREGATE_V00_DESERIALIZED_1_UNDIST = Surface_Marker_Aggregate( |
122 | 145 | uid=Surface_Marker_UID("legacy:57"), |
123 | | - verts_uv=np.asarray([ |
124 | | - [0.9255635738372803, 0.9278208017349243], |
125 | | - [0.9941799640655518, 0.928483784198761], |
126 | | - [0.9941900372505188, 0.9999602437019348], |
127 | | - [0.9251440763473511, 0.998592734336853] |
128 | | - ]) |
| 146 | + verts_uv=np.asarray( |
| 147 | + [ |
| 148 | + [0.9255635738372803, 0.9278208017349243], |
| 149 | + [0.9941799640655518, 0.928483784198761], |
| 150 | + [0.9941900372505188, 0.9999602437019348], |
| 151 | + [0.9251440763473511, 0.998592734336853], |
| 152 | + ] |
| 153 | + ), |
129 | 154 | ) |
130 | 155 | SURFACE_MARKER_AGGREGATE_V00_DESERIALIZED_0_DIST = Surface_Marker_Aggregate( |
131 | 156 | uid=Surface_Marker_UID("legacy:7"), |
132 | | - verts_uv=np.asarray([ |
133 | | - [1.9851928125457982e-14, -1.923472062778219e-14], |
134 | | - [0.060702838003635406, -0.004638743586838245], |
135 | | - [0.05217646434903145, 0.06511983275413513], |
136 | | - [-0.009258653968572617, 0.06691507995128632] |
137 | | - ]) |
| 157 | + verts_uv=np.asarray( |
| 158 | + [ |
| 159 | + [1.9851928125457982e-14, -1.923472062778219e-14], |
| 160 | + [0.060702838003635406, -0.004638743586838245], |
| 161 | + [0.05217646434903145, 0.06511983275413513], |
| 162 | + [-0.009258653968572617, 0.06691507995128632], |
| 163 | + ] |
| 164 | + ), |
138 | 165 | ) |
139 | 166 | SURFACE_MARKER_AGGREGATE_V00_DESERIALIZED_1_DIST = Surface_Marker_Aggregate( |
140 | 167 | uid=Surface_Marker_UID("legacy:57"), |
141 | | - verts_uv=np.asarray([ |
142 | | - [0.9114755799300843, 0.9409661768393776], |
143 | | - [0.9818958957355025, 0.9379570537747127], |
144 | | - [0.9800677671918846, 1.005555440640987], |
145 | | - [0.909855488690773, 1.0082552654603305] |
146 | | - ]) |
| 168 | + verts_uv=np.asarray( |
| 169 | + [ |
| 170 | + [0.9114755799300843, 0.9409661768393776], |
| 171 | + [0.9818958957355025, 0.9379570537747127], |
| 172 | + [0.9800677671918846, 1.005555440640987], |
| 173 | + [0.909855488690773, 1.0082552654603305], |
| 174 | + ] |
| 175 | + ), |
147 | 176 | ) |
148 | 177 | SURFACE_V00_DESERIALIZED = Surface_Offline( |
149 | 178 | name="surface_v00", |
150 | | - real_world_size={'x': 1.0, 'y': 1.0}, |
| 179 | + real_world_size={"x": 1.0, "y": 1.0}, |
151 | 180 | marker_aggregates_undist=[ |
152 | 181 | SURFACE_MARKER_AGGREGATE_V00_DESERIALIZED_0_UNDIST, |
153 | 182 | SURFACE_MARKER_AGGREGATE_V00_DESERIALIZED_1_UNDIST, |
|
0 commit comments