Compare commits
3 Commits
main
...
jrm/lcal-testing
| Author | SHA1 | Date | |
|---|---|---|---|
| dd628132dd | |||
| 6a79b02af7 | |||
| ebe7312cd6 |
@@ -6,6 +6,7 @@ from os import getenv
|
||||
|
||||
from speckleifc.main import open_and_convert_file
|
||||
from specklepy.core.api.client import SpeckleClient
|
||||
from specklepy.core.api.credentials import get_accounts_for_server
|
||||
from specklepy.logging import metrics
|
||||
|
||||
|
||||
@@ -55,7 +56,26 @@ def cmd_line_import() -> None:
|
||||
json.dump({"success": False, "error": str(e)}, f)
|
||||
|
||||
|
||||
def manual_import() -> None:
|
||||
PROJECT_ID = "f3a42bdf24"
|
||||
MODEL_ID = "0e23cfdea3"
|
||||
SERVER_URL = "app.speckle.systems"
|
||||
|
||||
metrics.set_host_app(
|
||||
"ifc",
|
||||
)
|
||||
|
||||
account = get_accounts_for_server(SERVER_URL)[0]
|
||||
client = SpeckleClient(SERVER_URL, use_ssl=not SERVER_URL.startswith("http://"))
|
||||
client.authenticate_with_account(account)
|
||||
project = client.project.get(PROJECT_ID)
|
||||
|
||||
open_and_convert_file(FILE_PATH, project, None, MODEL_ID, client)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
start = time.time()
|
||||
cmd_line_import()
|
||||
# cmd_line_import()
|
||||
|
||||
manual_import()
|
||||
print(f"Total time (including cleanup): {(time.time() - start) * 1000}ms")
|
||||
|
||||
@@ -13,7 +13,8 @@ def _create_iterator_settings() -> settings:
|
||||
# no need to weld verts
|
||||
ifc_settings.set("weld-vertices", False)
|
||||
# Speckle meshes are all in world coords
|
||||
ifc_settings.set("use-world-coords", True)
|
||||
ifc_settings.set("use-world-coords", False)
|
||||
ifc_settings.set("permissive-shape-reuse", False)
|
||||
# Tiny performance improvement,
|
||||
ifc_settings.set("no-wire-intersection-check", True)
|
||||
# Rendermaterials inherit the material names instead of type + unique id
|
||||
|
||||
@@ -54,9 +54,10 @@ class ImportJob:
|
||||
)
|
||||
|
||||
children = self._convert_children(step_element)
|
||||
display_value = self.cached_display_values.get(step_element.id(), [])
|
||||
id = step_element.id()
|
||||
display_value = self.cached_display_values.get(id, [])
|
||||
|
||||
if display_value is not None:
|
||||
if display_value:
|
||||
self.geometries_used += 1
|
||||
|
||||
# Extract current storey name from DataObject if available
|
||||
@@ -127,6 +128,7 @@ class ImportJob:
|
||||
self.geometries_count += 1
|
||||
id = cast(int, shape.id)
|
||||
|
||||
print(f"converted {id}")
|
||||
try:
|
||||
display_value = geometry_to_speckle(
|
||||
shape, self._render_material_manager
|
||||
|
||||
Reference in New Issue
Block a user