Store item_ids in imported meshes and set them on toggling edit mode

It will be used later to add more IFC capabilities to EDIT mode.

Example - https://imgur.com/a/HAkjoCY
This commit is contained in:
Andrej730
2024-07-08 17:40:07 +05:00
parent 7c1459b83e
commit acf135a6ed
5 changed files with 73 additions and 0 deletions
@@ -275,6 +275,11 @@ def get_faces(geometry: ShapeType) -> npt.NDArray[np.int32]:
return np.array([[faces[i], faces[i + 1], faces[i + 2]] for i in range(0, len(faces), 3)])
def get_representation_item_ids(geometry: ShapeType) -> npt.NDArray[np.int32]:
"""Get representation item ids for the geometry faces."""
return np.frombuffer(geometry.item_ids_buffer, dtype="i")
def get_shape_vertices(shape: ShapeType, geometry: ShapeType) -> npt.NDArray[np.float64]:
"""Get the shape's vertices as a numpy array