Model.collisioncheck_temp#

Model.collisioncheck_temp(collection_int_elems=s_defaultCollection, collection_pene_elems=s_defaultCollection, collection_int_surfs=s_defaultCollection, collection_pene_surfs=s_defaultCollection, collection_pene_nodes=s_defaultCollection, self_check=0, reserved1=0, pair_angle=0.0, store_segments=1, mark_adjoining=0, topo_feature_angle=0.0, pair_results=0, flag=0, arg=0.0)#

Performs a collision detection using the input entities defined by Model.hm_collisionentitycreate(). This must be preceded by hm_collisioninit() and one or two calls to hm_collisionentitycreate(). Multiple calls to this API can be made to perform different detections.

Parameters:
  • collection_int_elems (Collection) – The collection that should contain any intersected element entities on output. If collection is empty, no intersected elements are output. Valid entity types are elements or components.

  • collection_pene_elems (Collection) – The collection that should contain any penetrated element entities on output. If collection is empty, no penetrated elements are output. Valid entity types are elements or components.

  • collection_int_surfs (Collection) – The collection that should contain any intersected surfaces on output. If collection is empty, no intersected surfaces are output. Valid entity types are surfaces or solids.

  • collection_pene_surfs (Collection) – The collection that should contain any penetrated surfaces entities on output. If collection is empty, no penetrated surfaces are output. Valid entity types are surfaces or solids.

  • collection_pene_nodes (Collection) – The collection that should contain any penetrated node entities on output. If collection is empty, no penetrated nodes are output. Valid entity type is only nodes.

  • self_check (int) –

    0 - Do not include self checks.

    1 - 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 (int) – Set to 1 to store the intersection lines formed when intersection entities. Only valid when collection_int_elems or collection_int_surfs are non empty. The segments can then be visualized using Model.createintersectionsegments(). Default is 0.

  • 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 (int) –

    If set to 0, detailed pair results are not calculated and none of the hm_collisionget* APIs can be used (default, same as Model.hm_collisioncheck()).

    If set to 1, detailed pair results are calculated and the hm_collisionget* and Model.hm_collisionwriteresultsfile() APIs can be used (same as Model.hm_collisioncheck()).

    If set to 2, additional collision result entities are created that can be rendered in the collision browser or used as input of other functions like Model.collisionfix_temp() (option not available in Model.hm_collisioncheck()).

    If set to 3, only the collision result entities are created (for browser , Model.collisionfix_temp()…), but not the detailed pair results (for hm_collisionget*). This option is not available for Model.hm_collisioncheck(), and is only available for the collirad engine.

    Note

    The Model.hm_collisionend() does not delete any collision result entities. The deletion must be handled using Model.deletemark().

  • flag (int) – Reserved for future development

  • arg (double) – Reserved for future development

Example#

Check intersections and penetrations of components with IDs 1001 and 1002 , use the nodes of component with ID 1002 against the elements of component with ID 1001 for the penetration check , create only collision result entities#
import hm
import hm.entities as ent

model = hm.Model()

# Initial collections and output collection
components_int_collection = hm.Collection(model, ent.Component, [1001])

components_pene_collection = hm.Collection(model, ent.Component, [1002])

nodes_pene_collection = hm.Collection(model, ent.Node, components_pene_collection)

# Detecting the collision config
status, result = model.hm_collisiongetconfig(options=["collirad"])

model.hm_collisioninit(config=result.config)

model.hm_collisionentitycreate(
    collection=components_int_collection,
    dimension=0,
    thickness_type=1,
    thickness=0.0,
    edge_penetration=0,
    midside_nodes=0,
    split_quads=0,
    used_topology=0,
    grouping_identifier=1,
    offset=0
)

model.hm_collisionentitycreate(
    collection=components_pene_collection,
    dimension=0,
    thickness_type=1,
    thickness=0.0,
    edge_penetration=0,
    midside_nodes=0,
    split_quads=0,
    used_topology=0,
    grouping_identifier=2,
    offset=0
)

model.collisioncheck_temp(
    collection_int_elems=components_int_collection,
    collection_pene_elems=components_pene_collection,
    collection_pene_nodes=nodes_pene_collection,
    self_check=0,
    reserved1=0,
    pair_angle=90.0,
    store_segments=0,
    mark_adjoining=0,
    topo_feature_angle=0.0,
    pair_results=3,
    flag=0,
    arg=0.0,
)

model.hm_collisionend()