hm_getmatching

Performs a comparison and returns matching results.

Syntax

hm_getmatching entity_type mark_id ?option1=<value1>? ?option2=<value2>? ... ?optionN=<valueN>?

Type

HyperMesh Tcl Query Command

Description

Performs a comparison and returns matching results.

Returns a matching pair of comps or parts passed along with the percentage match. The reference/target entities are sequenced first in the output, followed by matching source entities, and subsequently followed by the matching percentage. If a source entity matches with more than one target, the pairs with maximum match percentage are returned. A source returned with one reference is not part of any other match pair.

Inputs

entity_type
The type of entity to copmare. Valid values are comps or parts.
mark_id
The ID of the mark of entities to compare. Valid values are 1 and 2.
areaCalcMethod=<value>
Specifies how the matching area percentage is calculated:
ByLowestId - Calcualte with respect to the entity with the lowest ID (default)
ByHighestId - Calcualte with respect to the entity with the highest ID
This is ignored when searchMethod=ByEncoding.
compareType=<value>
Specifies with what entities the comparison happens:
0 - Use both CAD and FE from the input selection
1 - Prefer CAD over FE. This will pick FE only if the input has only FE.
2 - Use only CAD
3 - Prefer FE over CAD. This will pick CAD only if the input has only CAD.
4 - Use only FE
deformationTolerance=<value>
The match tolerance value (default 0.0).
When searchMethod=ByEncoding this is used to determine if the distance between the encodings of the source and target are less than this value.
encoding_algorithm
The optional encoding algorithm to use when searchMethod=ByEncoding. Valid values are:
0 - Spherical harmonics (default)
matchingPercentThreshold=<value>
The matching area threshold above which matching pairs are returned (default is node tolerance).
When searchMethod=ByEncoding, this is reported as (1 – differenceinencoding/deformationTolerance=<value>)
referenceEntityMarkId=<value>
The ID of the mark of reference/target entities. Valid values are 1 and 2.
If not specified, the entire source is considered.
If specified, referenceEntityType is required.
referenceEntityType=<value?
The type of reference/target entity. Valid values are comps or parts.
If not specified, the entire source is considered.
If specified, referenceEntityMarkId is required.
searchMethod=<value>
Specifies how the matching is done:
ByArea - Matching is done with repect to area (default)
ByEncoding -
ByTopo - Matching is done with repect to exact topo matches
sphhar_bandwidth
Optional, valid for encoding_algorithm 0, default 16.
sphhar_fallof
Optional, valid for encoding_algorithm 0, default 2.828427.
sphhar_radii
Optional, valid for encoding_algorithm 0, default 32.
sphhar_resolution
Optional, valid for encoding_algorithm 0, default 64.

Examples

To compare part 4 to part 6 using a tolerance of 1.0:
*createmark parts 1 "by ids" 4
*createmark parts 2 "by ids" 6
hm_getmatching parts 1 referenceEntityType=parts referenceEntityMarkId=2 matchingPercentThreshold=0.0 deformationTolerance=1.0
To compare part 4 to part 6 using the encoding search with a tolerance of 0.6 and using both CAD and FE:
*createmark parts 1 "by ids" 4
*createmark parts 2 "by ids" 6
hm_getmatching parts 1 referenceEntityType=parts referenceEntityMarkId=2 deformationTolerance=0.6 searchMethod=ByEncoding compareType=0

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

2020

2020.1 - Added new options compareType, encoding_algorithm, sphhar_bandwidth, sphhar_fallof, sphhar_radii and sphhar_resolution. Added new searchMethod ByEncoding.