*surfacemark_duplicate_check

Check identity between input surface sets.

Syntax

*surfacemark_duplicate_check mark_id1 mark_id2 options use_plane plane tol

Type

HyperMesh Tcl Modify

Description

This command takes surfaces from two different sets and checks if any surface in one set has an identical counterpart in another set. Optionally, reflection with respect to an input plane is used before checking identity. Only one set of surfaces may also be provided on input if mark_id2 is set to 0. If a plane is provided (use_plane = 2), then this single set is automatically split into two sets by the surfaces’ position with respect to the input plane. As a result of identity calculations, surfaces are removed or switched between input sets or returned depending on the input options parameter.

As a result of surface sets symmetry calculation, input surfaces are separated into four sets. If there are two input sets provided, the meaning of the output sets is:
  • output_set0 – no identical counterpart was found (unmatched) for surfaces of mark_id1.
  • output_set1 – identical counterpart was found (matched) for surfaces of mark_id1.
  • output_set2 – no identical counterpart was found (unmatched) for surfaces of mark_id2.
  • output_set3 – identical counterpart was found (matched) for surfaces of mark_id2.
If only one input set is provided (mark_id2 is 0), the meaning of the output sets is:
  • output_set0 – surfaces that do not have duplicate counterparts.
  • output_set1 – “master” surfaces that do have duplicate counterparts (in the set of several identical surfaces, only one surface is selected as “master”).
  • output_set2 – “slave” surfaces that have duplicate counterparts.
  • output_set3 – empty set.

Inputs

mark_id1
The ID of the mark containing the first set of surfaces. Valid values are 1 and 2.
mark_id2
The ID of the mark containing the second set of surfaces. Valid values are 1 and 2.
options
Integer value representing combination of flags used to modify command behavior. This parameter is composed of several “action” groups, with each group consisting of several possible values. The value of this parameter is a sum of the required values:
  • Set selection group – bits 0…3: Since there is a limitation that only two mark values can be used to designate input sets and respectively the same two values are used to mark surfaces in output sets, this means that only two out of four output sets can be selected.
  • Set selection bits group is used to indicate which of possible four output sets are returned on output. If corresponding to output set bit is set to 1, then surfaces from corresponding result set are selected.
  • Mark inversion group – bits 4…7: If corresponding bit is not set, then output set is marked by the same mark as originating input set. If bit is set, the mark of another set is used instead. Those bits do not have any effect in case corresponding bit in set selection bits group is not set. Also, bits in this group do not have any effect in case both sets are the same.
  • Highlight group – bits 9 and 10. If bit 9 is set, then surfaces in the output set marked by surf_set_mark_id1 are highlighted. If bit 10 is set, then surfaces in the output set marked by surf_set_mark_id2 are highlighted.
use_plane
0 - Check for identity of surfaces in two sets.
1 - Use plane specified by plane parameter to reflect on of sets before checking identity.
2 - All surfaces are assumed to be selected in only one set and they are rearranged into two sets by their position with respect to input plane before checking for their symmetry.
plane
A plane ID defining the symmetry plane.
tol
Tolerance value used to calculate surfaces identity.

Example

If you want to clean up the model so that it does not contain duplicated surfaces. That is, if there exists a set of two or more surfaces that are identical one would like to delete all but one of surfaces from this set. A tolerance of 0.1 is going to be used to identify surfaces. One puts all input surfaces into one set (mark 1) and selects value 4 for options to indicate that surfaces of output_set2 (“slave” surfaces) have to be returned on the input mark.
*createmark surfs 1 "all"
*surfacemark_duplicate_check 1 1 4 0 0 0.1
*deletemark surfs 1

Errors

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