CuboidFace¶
- class CuboidFace(a, b, c, d)[source]¶
Bases:
objectA single face of a
Cuboid.The face is defined by four integer indices (
a,b,c,d) referencing cuboid nodes. This lightweight helper is used to store faces and serialize/deserialize them in Supervisely annotation format (seeto_json()/from_json()).CuboidFace for a single
Cuboid.- Parameters:
- Usage Example:
edge = CuboidFace(0, 1, 2, 3)
Methods
Convert list of integers to CuboidFace.
Convert the CuboidFace to list.
Convert CuboidFace to list.
Attributes
abcd- classmethod from_json(data)[source]¶
Convert list of integers to CuboidFace. Read more about Supervisely format.
- Parameters:
- Raises:
ValueError – if data have not 4 indices
- Returns:
CuboidFace from json.
- Return type:
- Usage Example:
new_edge = CuboidFace.from_json([0, 1, 2, 3])
- to_json()[source]¶
Convert the CuboidFace to list. Read more about Supervisely format.
- Returns:
List of integers
- Return type:
List[int, int, int, int]- Usage Example:
edge = CuboidFace(0, 1, 2, 3) edge_json = edge.to_json() print(edge_json) # Output: [0, 1, 2, 3]