hm_proximityinit

Checks the proximity between elements or components, and stores the results internally.

Syntax

hm_proximityinit entity_type mark_id max_distance ?mode? ?check_side? ?proximity_scheme? ?proximity_by_edge?

Type

HyperMesh Tcl Query

Description

Checks the proximity between elements or components, and stores the results internally. Other APIs can be used to query the results.

This must precede any calls to other hm_proximityget*/hm_proximitymark* APIs, and must be followed by a call to hm_proximityend.

Inputs

entity_type
The type of entity to query. Valid values are elements and components.
mark_id
The ID of the mark containing the input entities. Valid values are 1 and 2.
max_distance
The maximum distance beyond which proximity is not reported.
mode
1 – Global proximity (default behavior if not specified)
2 – Proximity between components (entity_type should be components only)
3 – Self proximity within component (entity_type should be components only)
check_side
1 – Check both sides of the elements
2 – Check the element normal side only
3 – Check 'outward volume' side (default behavior if not specified)
4 – check 'inward volume' side
proximity_scheme
0 – Checks basic proximity along a ray from the element center along the normal direction.
1 – Checks comprehensive proximity. Reports any proximity within an imaginary offsetted volume of the element (default behaviour if not specified).
proximity_by_edge
0 – Ignores proximity for nearby edges (default behaviour if not specified).
1 – Considers proximity for nearby edges.

Example

To calculate the proximity between all comps using a max distance of 2.5 and to query the component pairs:

*createmark comps 1 all
hm_proximityinit comps 1 2.5
set comp_pair_count [hm_proximitygetcomponentpaircount]
for {set i 0} {$i < $comp_pair_count} {incr i} {
    set comp_pair [hm_proximitygetcomponentpair $i]
    puts "Component pair $i: $comp_pair"
    set elem_pair_count [hm_proximitygetcomponentelementpaircount $i]
    for {set j 0} {$j < $elem_pair_count} {incr j} {
        set elem_pair [hm_proximitygetcomponentpair $i $j]
        puts "    Element pair $j: $elem_pair"
    }
}
hm_proximityend

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

14.0

2019 - Added new optional arguments proximity_scheme and proximity_by_edge. Changed default beahvior of API to use proximity_scheme value 1.