hm_checkproximity

Checks proximity between elements/components.

Syntax

hm_checkproximity entity_type mark_id max_proximity ?mode? ?check_side? ?proximity_scheme? ?proximity_by_edge?

Type

HyperMesh Tcl Query

Description

Checks proximity between input entities and returns list of entities within the specified proximity. The output depends on the mode argument as defined below.

Inputs

entity_type
The type of entity to check. Valid values are elems and comps (only elems in comps are considered).
mark_id
The ID of the mark containing the entities to check. Valid values are 1 and 2.
max_proximity

The maximum distance beyond which an entity is not considered.

mode
1 – Global proximity (default)
2 – Proximity between components (entity_type must be comps)
3 – Self proximity within components (entity_type must be comps)
When set to 1, returns two lists of element IDs. The first list contains the elements for which a proximity is found. The second list contains the paired elements for the elements in the first list.
  • E.g. {1, 2, 3, 4}{6, 6, 1, 1}
When set to 2 or 3, returns one list per input component. The first item in each list is the component ID. The first sub-list contains elements for which proximity is found. The second sub-list contains the paired elements.
When set to 2:
  • E.g. {compid1, {elements within proximity} {paired elements from other components}} {compid2, {elements within proximity} {paired elements from other components}} etc.
When set to 3:
  • E.g. {compid1, {elements within proximity} {paired elements from same component}} {compid2, {elements within proximity} {paired elements from same component}} etc.
check_side
1 – Check both sides of elements
2 – Check only the element normal side
3 – Check 'outward volume' side (default)
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 find proximity between all components using a max distance of 2.5:

*createmark comps 1 all 
hm_checkproximity comps 1 2.5
{{201 200 199 198 197 196 195 194 225 224 223 222 221 220 219 218} {221 219 220 218 225 223 224 222 197 195 196 194 201 199 200 198}}

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

13.0.110

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