Model.hm_collisioncheck#

Model.hm_collisioncheck(intersected_elements=s_defaultCollection, penetrated_elements=s_defaultCollection, intersected_surfaces=s_defaultCollection, penetrated_surfaces=s_defaultCollection, penetrated_nodes=s_defaultCollection, self_check=False, reserved1=0, pair_angle=90.000000, store_segments=False, mark_adjoining=0, topo_feature_angle=0.000000, pair_results=False)#

Performs a collision detection using entities defined by Model.hm_collisionentitycreate(). This must be preceded by Model.hm_collisoininit() and one or more calls to Model.hm_collisionentitycreate().

Multiple calls to this API can be made to perform different detections.

Parameters:
  • intersected_elements (Collection) – The collection that should contain any intersected element entities on output. If argument is not provided provided, no intersected elements are output. Only valid if elements or components entities are used as input entities.

  • penetrated_elements (Collection) – The collection that should contain any penetrated element entities on output. If argument is not provided provided, no penetrated elements are output. Only valid if elements or components entities are used as input entities.

  • intersected_surfaces (Collection) – The collection that should contain any intersected surface entities on output. If argument is not provided provided, no intersected surfaces are output. Only valid if surfaces or solids entities are used as input entities.

  • penetrated_surfaces (Collection) – The collection that should contain any penetrated surface entities on output. If argument is not provided provided, no penetrated elements are output. Only valid if elements or components entities are used as input entities.

  • penetrated_nodes (Collection) – The collection that should contain any penetrated node entities. If argument is not provided provided, no penetrated nodes are output. Only valid if nodes entities are used as input entities.

  • self_check (bool) –

    False - Do not include self checks.

    True - Include self checks.

  • reserved1 (int) – Reserved for future use. Must be set to 0.

  • pair_angle (double) – The maximum allowed angle between penetrating pair normals. Meaningful values are 0.0 < pair_angle < 90.0. Other values disable this functionality.

  • store_segments (bool) – Set to True to store the intersection lines formed when intersection entities. Only valid when intersected_elements or intersected_surfaces are non-empty. The segments can then be visualized using Model.createintersectionsegments(). Default is False.

  • mark_adjoining (int) –

    0 - No additional marking (default).

    1 - Mark only surrounding 2D elements. Surrounded implies all of its nodes on other penetrated elements.

    2 - Mark all 2D elements on topology faces containing any penetrated elements.

    3 - Mark only 2D elements sharing a node with a penetrated element and on the same topo face.

  • topo_feature_angle (double) – The angle used to identify topo faces. If set to 0.0, the global feature angle is utilized (default).

  • pair_results (bool) – If set to True, detailed pair results are calculated and the hm_collisionget functions and Model.hm_collisionwriteresultsfile() APIs can be used. If set to False, detailed pair results are not calculated and the hm_collisionget functions and Model.hm_collisionwriteresultsfile() APIs cannot be used (default).

Returns:

Examples#

Find intersect surfaces from IDs 1 - 10#
import hm
import hm.entities as ent

model = hm.Model()

checking_surfs = hm.Collection(model,ent.Surface,list(range(1,11)))
intersect_surfs = hm.Collection(model,ent.Surface,populate=False)


model.hm_collisioninit()
model.hm_collisionentitycreate(collection=checking_surfs,dimension=0,thickness_type=1,
                              thickness=0,edge_penetration=0,midside_nodes=0,split_quads=0,
                              used_topology=0,grouping_identifier=False,offset=0
                              )
model.hm_collisioncheck(intersected_surfaces=intersect_surfs)
model.hm_collisionend()

print("Intersected surfaces: ", [s.id for s in intersect_surfs])
Find intersect surfaces from IDs 1 - 10 and create intersection segments#
import hm
import hm.entities as ent

model = hm.Model()

checking_surfs = hm.Collection(model,ent.Surface,list(range(1,11)))
intersect_surfs = hm.Collection(model,ent.Surface,populate=False)


model.hm_collisioninit()
model.hm_collisionentitycreate(collection=checking_surfs,dimension=0,thickness_type=1,
                              thickness=0,edge_penetration=0,midside_nodes=0,split_quads=0,
                              used_topology=0,grouping_identifier=False,offset=0
                              )
model.hm_collisioncheck(intersected_surfaces=intersect_surfs,store_segments=True)
model.createintersectionsegments(collector=0)
model.hm_collisionend()

print("Intersected surfaces: ", [s.id for s in intersect_surfs])
Find penetrate surfaces from IDs 1 - 10 , use the thickness assigned to the surface components#
import hm
import hm.entities as ent

model = hm.Model()

checking_surfs = hm.Collection(model,ent.Surface,list(range(1,11)))
pene_surfs = hm.Collection(model,ent.Surface,populate=False)


model.hm_collisioninit()
model.hm_collisionentitycreate(collection=checking_surfs,dimension=0,thickness_type=1,
                              thickness=0,edge_penetration=0,midside_nodes=0,split_quads=0,
                              used_topology=0,grouping_identifier=False,offset=0
                              )
model.hm_collisioncheck(penetrated_surfaces=pene_surfs)
model.hm_collisionend()

print("Penetrated surfaces: ", [s.id for s in pene_surfs])