*collisionfix_temp

Fix collisions by moving nodes.

Syntax

*collisionfix_temp reserved mark_id smooth

Type

HyperMesh Tcl Modify Command

Description

Fixes collisions (intersections or penetrations) that have been detected with a call of *collisioncheck_temp or *collisioncheck2_temp, by automatically moving individual nodes. The collision result entities passed as input get updated or deleted, if the fix is successful. This has no effect if the implemented algorithm cannot find any appropriate fix.

There are some restrictions regarding the collision result entities that are used as input:
  • Only possible for either intersections or penetrations at a time. All provided collision result entities should have the same "config" (otherwise the ones with another config than the first one are ignored).
  • Only possible for one group at a time. All provided collision result entities have to have the same "parent" (otherwise the ones with another parent than the first one are ignored).

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

This command is a temporary command and may be deprecated in a future release.

Inputs

reserved
Reserved for future use. Must be set to 0.
mark_id
The ID of the mark containing the entities to fix. Valid values are 1 and 2.
smooth
Used to improve the results of the automatic penetration fix. Valid values are integers >= 0. Setting to 0 will apply the built-in default, which has proven to be efficient.

Example

Intersection and penetration fix of all comps in the model, implementing the recommended approach to fix penetrations only if there are no intersections:

#Delete potential obsolete collision results
hm_collisionend
*createmark collisions 1 all
if {[hm_marklength collisions 1]} {
    *deletemark collisions 1
}
*clearmarkall 1

*createmark comps 1 all
hm_collisioninit [hm_collisiongetconfig collirad]
hm_collisionentitycreate comps 1 0 2 0.0 0 0 0 0 0

#Intersection check triggered by providing mark_id_int_elems
*collisioncheck_temp 1 0 0 0 0 0 0 90.0 0 0 0.0 2

#Intersection fix if there are intersections
*createmark collisions 1 all
set collision_count [hm_marklength collisions 1]
if {$collision_count} {
    *collisionfix_temp 0 1 0 
    *createmark collisions 1 all
    set collision_count [hm_marklength collisions 1]
}

#Penetration check and fix only if no intersections remain
if {! $collision_count} {
    #Penetration check triggered by providing mark_id_pene_elems
    *collisioncheck_temp 0 1 0 0 0 0 0 90.0 0 0 0.0 2 
    *createmark collisions 1 all
    set collision_count [hm_marklength collisions 1]
    if {$collision_count} {
        *collisionfix_temp 0 1 0
        *createmark collisions 1 all
        set collision_count [hm_marklength collisions 1]
    }
}

#Delete collision results
hm_collisionend
*createmark collisions 1 all
if {[hm_marklength collisions 1]} {
    *deletemark collisions 1
}

Errors

Incorrect usage results in a Tcl error. To detect errors, you can use the catch command:
if { [ catch {command_name...} ] } {
   # Handle error
}

Version History

2017.1