Model.collisioncheck2_temp#

Model.collisioncheck2_temp(collection, config, thickness, allowable_depth, tolerance, pair_angle, minimum_penetration_depth=0)#

Performs a collision detection using the provided entities. Creates collision result entities that can be rendered in the UI or used as input to other functions.

Equivalent to calling Model.hm_collisioninit(), Model.hm_collisionentitycreate() and Model.collisioncheck_temp() with the corresponding input each. Must be followed by a call to hm_collisionend.

Based on the input, the function switches between the collirad collision detection engine (mainly based on Radioss algorithms, provides an automatic fix), which gets selected by default, and the opcode collision detection engine (supports some additional options, but no automatic fix as of now), which gets selected if any option is used which is not supported by the collirad engine.

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

Parameters:
  • collection (Collection) – The collection containing the entities to check. Valid entities are groups, components (only elements in components are considered) and elements

  • config (int) – The configuration that defines the collision behavior. This value is obtained by running Model.hm_collisiongetconfig(). Default is 0. See Model.hm_collisiongetconfig() for the possible options and their compatibilities.

  • thickness (double) – The assigned thickness or thickness multiplier. Default is 0, which means that element thickness is applied.

  • allowable_depth (double) –

    The allowable depth to use when finding and reporting interferences. If specified, config should not contain the intersect_planar option (see Model.hm_collisiongetconfig()) and tolerance should be -1.0. If not specified, this is ignored.

    Not supported in the collirad engine, so non-zero input selects the opcode engine

  • tolerance (double) –

    The tolerance to use for intersection checks (for model.hm_collisiongetconfig(options=["intersect_planar"])) or penetration checks (for model.hm_collisiongetconfig(options=["penetrat_min_overlap"])). If not specified, the default is 1.e-08.

    Not supported in the collirad engine, so non-zero input selects the opcode engine

  • 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.

    Not supported in the collirad engine, so non-zero input selects the opcode engine.

  • minimum_penetration_depth (double) – The minimum penetration depth value to be reported. All penetrations with depths below the specified value will not be reported. If not specified, the default is 0.0, which implies that all detected penetrations will be reported.

Example#

Check intersections and penetrations of groups with IDs 1001 and 1002#
import hm
import hm.entities as ent

model = hm.Model()

model.collisioncheck2_temp(
    collection=hm.Collection(model, ent.Group, [1001, 1002]),
    config=0,
    thickness=0.0,
    allowable_depth=0.0,
    tolerance=0.0,
    pair_angle=0.0,
)
model.hm_collisionend()