This commit is contained in:
Jedd Morgan
2025-06-19 10:08:01 +01:00
parent f937df95e0
commit 23d01f3da4
8 changed files with 9 additions and 22 deletions
-6
View File
@@ -1,6 +0,0 @@
def main():
print("Hello from ifc-openshell-file-importer!")
if __name__ == "__main__":
main()
@@ -10,7 +10,6 @@ from speckleifc.converter.geometry_converter import geometry_to_speckle
def data_object_to_speckle(
shape: TriangulationElement, step_element: entity_instance
) -> DataObject:
geometry = cast(Triangulation, shape.geometry)
display_value = geometry_to_speckle(geometry)
@@ -10,7 +10,6 @@ from speckleifc.converter.geometry_converter import geometry_to_speckle
def data_object_to_speckle(
shape: TriangulationElement, step_element: entity_instance
) -> DataObject:
geometry = cast(Triangulation, shape.geometry)
display_value = geometry_to_speckle(geometry)
+9 -10
View File
@@ -8,7 +8,6 @@ from specklepy.objects.geometry import Mesh
def geometry_to_speckle(geometry: Triangulation) -> list[Base]:
materials = cast(Sequence[int], geometry.materials)
MESH_COUNT = max(len(materials), 1)
@@ -49,15 +48,15 @@ def geometry_to_speckle(geometry: Triangulation) -> list[Base]:
i += 1
face_index += 3 # number of items in the faces list we just jumped over
mapped_index_counters[
mesh_index
] += 3 # number of verts we just added to the mesh.vertices i.e. the next index
mapped_faces_pointers[
mesh_index
] += 4 # number of item's we've just added to the mesh.faces list
mapped_vertices_pointers[
mesh_index
] += 9 # number of item's we've just added to the mesh.vertices list
mapped_index_counters[mesh_index] += (
3 # number of verts we just added to the mesh.vertices i.e. the next index
)
mapped_faces_pointers[mesh_index] += (
4 # number of item's we've just added to the mesh.faces list
)
mapped_vertices_pointers[mesh_index] += (
9 # number of item's we've just added to the mesh.vertices list
)
return mapped_meshes # type: ignore
@@ -9,7 +9,6 @@ from speckleifc.ifc_geometry_processing import get_shape
def spatial_element_to_speckle(step_element: entity_instance) -> DataObject:
if step_element.Representation is not None:
shape = get_shape(step_element)
geometry = cast(Triangulation, shape.geometry)
@@ -36,7 +36,6 @@ def open_ifc(file_path: str) -> file:
def create_geometry_iterator(ifc_file: file | sqlite) -> iterator:
return iterator(_IFC_ITERATOR_SETTINGS, ifc_file, multiprocessing.cpu_count() // 2)
-1
View File
@@ -13,7 +13,6 @@ from speckleifc.root_object_builder import RootObjectBuilder
class ImportJob:
def __init__(self, ifc_file: file):
self._ifc_file = ifc_file
self.builder = RootObjectBuilder()
-1
View File
@@ -51,7 +51,6 @@ class RootObjectBuilder:
def apply_relationship(
self, current: Base, step_id: int, root_commit_object: Base
) -> None:
parents = self._parent_infos[step_id]
for parent_id, prop_name in parents: