mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 06:39:13 +00:00
Added note about core.geometry representations functions
This commit is contained in:
@@ -87,6 +87,7 @@ def switch_representation(
|
|||||||
is_global=True,
|
is_global=True,
|
||||||
should_sync_changes_first=False,
|
should_sync_changes_first=False,
|
||||||
):
|
):
|
||||||
|
"""Function can switch to representation that wasn't yet assigned to that object. See #2766."""
|
||||||
if should_sync_changes_first and geometry.is_edited(obj) and not geometry.is_box_representation(representation):
|
if should_sync_changes_first and geometry.is_edited(obj) and not geometry.is_box_representation(representation):
|
||||||
representation_id = geometry.get_representation_id(representation)
|
representation_id = geometry.get_representation_id(representation)
|
||||||
geometry.run_geometry_update_representation(obj=obj)
|
geometry.run_geometry_update_representation(obj=obj)
|
||||||
@@ -117,6 +118,11 @@ def get_representation_ifc_parameters(geometry, obj=None, should_sync_changes_fi
|
|||||||
|
|
||||||
|
|
||||||
def remove_representation(ifc, geometry, obj=None, representation=None):
|
def remove_representation(ifc, geometry, obj=None, representation=None):
|
||||||
|
"""Function will produce orphan mesh data, see #2767.
|
||||||
|
|
||||||
|
Also should consider changing obj representation before using the function,
|
||||||
|
otherwise it will replace object with empty."""
|
||||||
|
|
||||||
element = ifc.get_entity(obj)
|
element = ifc.get_entity(obj)
|
||||||
type = geometry.get_element_type(element)
|
type = geometry.get_element_type(element)
|
||||||
if type and (geometry.is_mapped_representation(representation) or geometry.is_type_product(element)):
|
if type and (geometry.is_mapped_representation(representation) or geometry.is_type_product(element)):
|
||||||
|
|||||||
Reference in New Issue
Block a user