Model.hm_collisionentitycreate#
- Model.hm_collisionentitycreate(collection, dimension, thickness_type, thickness, edge_penetration, midside_nodes, split_quads, used_topology, grouping_identifier, offset)#
Adds input entities to consider for collision detection. This must be called after
Model.hm_collisioninit(), and before any calls tohm_collisionentitycreate().Multiple calls to this API can be made to add additional input entities to the collision detection. Note that the input entities are different from the core collision entity.
These functions do not operate on those entities, only on temporary memory.
When using the collirad collision detection engine, only one call is supported for each
grouping_identifier. This means that either a single call to this API has to be made withgrouping_identifieras 0, or one call withgrouping_identifier1 and 2 each.- Parameters:
collection (Collection) –
The collection containing the entities to add. Valid values are:
For opcode engine: Nodes, surfaces, solids, elements and components entities.
For collidrad engine: Components and groups entities.
dimension (int) –
Defines the dimension of elements to consider. Valid only for elements and components entities. Ignored by the collirad engine. Valid values are:
0 - No restriction.
2 - 2D shells only.
3 - 3D solids only.
thickness_type (int) –
Defines how the thickness is applied to the input entities, in combination with
thickness. Valid values are:0 - Use the value specified by thickness.
1 - Use component thickness.
2 - Use element thickness. Valid only for
collectionelements and components entities.Note
Add 10 to these values to also apply the thickness on the outside of solid elements or geometry (i.e. report solid skins being close to each other, but not intruding each other). Ignored by the collirad engine.
Add 20 to these values to also apply the thickness on the inside of solid elements or geometry, reporting a normal pointing outwards (i.e. report solids intruding each other). Ignored by the collirad engine.
Add 30 to these values to also apply the thickness on the inside and outside of solid elements or geometry, reporting a normal pointing outwards (i.e. combine the two options above). Ignored by the collirad engine.
Add 40 to these values to also apply the thickness to solid elements or geometry as if their skins were shell elements (i.e. report close faces with a normal pointing outwards, intruding faces with a normal pointing inwards). This affects the opcode engine, but the collirad engine always applies this logic.
Add 100 to these values to ignore penetrations of neighboring elements due to thicknesses being greater than element sizes. This corresponds to using Iremgap 2 in ontact interfaces. This is ignored by the opcode engine.
Add 200 to these values to restrict the thickness of the elements to 40% of their size. This also avoids undesired penetrations of neighboring elements due to thicknesses being greater than element sizes. This corresponds to the behavior of some contacts. This is ignored by the opcode engine.
Add 300 to these values to use thickness as a thickness multiplier when using component or element thickness. This is ignored by the collirad engine.
Add 400 to these values to use thickness as an add-on thickness when using component or element thickness. This is ignored by the collirad engine.
All values are ignored for groups, for which thicknesses are applied as in the solver.
thickness (double) – The assigned uniform thickness when
thickness_type=0. Ifthickness_typehas 300 or 400 added while using component or element thickness, this is used as a thickness multiplier or add-on. Used as a multiplier for real thickness in the collirad engine.edge_penetration (int) –
Not valid for groups for which the solver logic is applied. Valid values are:
0 - Do not consider edge penetrations.
1 - Consider edge penetrations.
midside_nodes (int) –
Valid only for
collectionwith elements and components entities. Valid values are:0 - Do not consider midside nodes.
1 - Consider midside nodes.
split_quads (int) –
Valid only for
collectionwith elements and components entities. Valid values are:0 - Do not split quads at the center for calculation purposes. This is the default for the opcode engine, and is not available for the collirad engine.
1 - Split quads at the center for calculation purposes. This is the default in the collirad engine.
used_topology (int) –
This is ignored for the collirad engine. Valid values are:
0 - Consider specified entities.
1 - Consider only nodes of specified entities.
2 - Use all edges of elements or faces.
3 - Use only free edges of shell elements.
grouping_identifier (int) – Entities with the same grouping identifier are not checked against each other. This is useful for performing checks “by pair”. If set to 0, entities are checked against all others.
offset (int) –
Used to specify which element types to offset using solver properties. Valid values are:
0 - None.
1 - Only bar/beam elements.
10 - Only shell elements.
11 - Both bar/beam and shell elements.
- Returns:
hwReturnStatus- Status object
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 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])
Find penetrate elements from components with IDs 1 - 5 use thickness defined on elements , offset defined on shell elements#import hm import hm.entities as ent model = hm.Model() model.hm_collisioninit() checking_comps = hm.Collection(model,ent.Component,list(range(1,6))) model.hm_collisionentitycreate( collection=checking_comps, dimension=0, thickness_type=2, thickness=0, edge_penetration=0, midside_nodes=0, split_quads=0, used_topology=0, grouping_identifier=False, offset=10 ) pene_elems = hm.Collection(model,ent.Element,populate=False) model.hm_collisioncheck(penetrated_elements=pene_elems) model.hm_collisionend() # Highlighting penetrating elements model.hm_highlightmark(collection=pene_elems,highlight="h")
Find penetrate elements from all components use a thickness multiplier of 1.1 on thickness defined on elements#import hm import hm.entities as ent model = hm.Model() model.hm_collisioninit() checking_comps = hm.Collection(model,ent.Component,list(range(1,6))) model.hm_collisionentitycreate( collection=checking_comps, dimension=0, thickness_type=302, thickness=1.1, edge_penetration=0, midside_nodes=0, split_quads=0, used_topology=0, grouping_identifier=False, offset=0 ) pene_elems = hm.Collection(model,ent.Element,populate=False) model.hm_collisioncheck(penetrated_elements=pene_elems) model.hm_collisionend() # Highlighting penetrating elements model.hm_highlightmark(collection=pene_elems,highlight="h")