Box
Bases: Polygon
A Box is a polygon that is constrained to 4 unique points.
Note that this does not need to be axis-aligned.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
List[List[Tuple[float, float]]]
|
An polygon value representing a box. |
required |
Attributes:
Name | Type | Description |
---|---|---|
area |
|
|
polygon |
|
|
boundary |
|
|
holes |
|
|
xmin |
|
|
xmax |
|
|
ymin |
|
|
ymax |
|
Examples:
Create a Box using extrema.
Source code in valor/schemas/symbolic/types.py
1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 |
|
Functions
valor.schemas.Box.__validate__(value)
classmethod
Validates typing.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
Any
|
The value to validate. |
required |
Raises:
Type | Description |
---|---|
TypeError
|
If the value type is not supported. |
Source code in valor/schemas/symbolic/types.py
valor.schemas.Box.decode_value(value)
classmethod
Decode object from JSON compatible dictionary.
Source code in valor/schemas/symbolic/types.py
valor.schemas.Box.from_extrema(xmin, xmax, ymin, ymax)
classmethod
Create a Box from extrema values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
xmin
|
float
|
Minimum x-coordinate of the bounding box. |
required |
xmax
|
float
|
Maximum x-coordinate of the bounding box. |
required |
ymin
|
float
|
Minimum y-coordinate of the bounding box. |
required |
ymax
|
float
|
Maximum y-coordinate of the bounding box. |
required |
Returns:
Type | Description |
---|---|
Box
|
A Box created from the provided extrema values. |
Source code in valor/schemas/symbolic/types.py
valor.schemas.Box.to_polygon()
Converts box to a generic polygon.
Returns:
Type | Description |
---|---|
Polygon
|
The box as a Polygon. |