Model.hm_collisionvisualizebymark#

Model.hm_collisionvisualizebymark(collection, node_collection, review_type, fit_view, display_type)#

Enables the visualization of collision entities using one of various supported visualization modes.

Parameters:
  • collection (Collection) – The collection containing the collision entities to be visualized.

  • node_collection (Collection) –

    The collection containing ontaining the secondary node entities from the collision entities on collection. Only these nodes will be visualized.

    If empty collection is provided, all colliding nodes/elements will be visualized.

  • review_type (int) –

    A flag that indicates the type of visualization. Valid values are:

    1 - Highlight failed elements

    2 - Review failed elements

    3 - Contour penetration depths

    4 - Penetration vectors and intersection lines

    5 - Contour relative penetrations

  • fit_view (bool) –

    False - Do not fit view

    True - Fit view

  • display_type (int) –

    A flag that indicates which elements to display. Valid values are:

    1 - Display all elements

    2 - Display components with failed elements

    3 - Display only failed elements

Returns:

Examples#

Highlight intersect elements of components with IDs 1001 and 1002 with auto - fit and display of the components with failed elements#
import hm
import hm.entities as ent

model = hm.Model()

_, result = model.hm_collisiongetconfig(options=["intersect_planar"])
config = result.config

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

model.collisioncheck2_temp(
    collection=component_collection,
    config=config,
    thickness=0.0,
    allowable_depth=0.0,
    tolerance=0.0,
    pair_angle=0.0,
)

collision_collection = hm.Collection(model, ent.Collision)
model.hm_collisionvisualizebymark(
    collection=collision_collection,
    node_collection=hm.Collection(model, ent.Node, populate=False),
    review_type=1,
    fit_view=True,
    display_type=2,
)
Generate a contour plot of penetration depths of components with IDs 1001 and 1002 without auto - fit and display only failed elements#
import hm
import hm.entities as ent

model = hm.Model()

_, result = model.hm_collisiongetconfig(options=["collirad", "penetrations"])
config = result.config

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

model.collisioncheck2_temp(
    collection=component_collection,
    config=config,
    thickness=0.0,
    allowable_depth=0.0,
    tolerance=0.0,
    pair_angle=0.0,
)

collision_collection = hm.Collection(model, ent.Collision)
model.hm_collisionvisualizebymark(
    collection=collision_collection,
    node_collection=hm.Collection(model, ent.Node, populate=False),
    review_type=3,
    fit_view=False,
    display_type=3,
)