Model.surfacemark_find_organize_symmetry#
- Model.surfacemark_find_organize_symmetry(surf_set_collection1, plane_normal, plane_base, options, tolerance, surf_set_collection2=Collection())#
Compares surfaces from two different sets, checking whether any surface in one set has an identical counterpart in another set after reflection with respect to the input plane. Optionally, only one set of surfaces can be provided on input, in which case this single set is automatically split into two sets based on the surfaces’ position with respect to the input plane. As a result of symmetry calculations, surfaces are either deleted or reorganized into newly created components, depending on the chosen options parameter.
- Parameters:
surf_set_collection1 (Collection) – The collection containing the surface entities in the first set.
plane_normal (hwTriple) – The hwTriple object defining the symmetry plane normal components. User can also supply a Python list of three doubles.
plane_base (hwTriple) – The hwTriple object defining the base point components of the symmetry plane. User can also supply a Python list of three doubles.
options (int) – An integer value representing a combination of flags used to modify function behavior (see the note below).
tolerance (double) – Tolerance value used to calculate surfaces identity.
surf_set_collection2 (Collection) – The collection containing the surface entities in the second set. In case we do not want additional surfaces empty collection should be passed.
Note
Argument Description:
optionsAs a result of surface sets symmetry calculation, input surfaces are separated into four sets:
output_set0 - unmatched (no symmetric counterpart was found) surfaces of the
surf_set_collection1.output_set1 - matched (symmetric counterpart was found) surfaces of the
surf_set_collection1.output_set2 - unmatched (no symmetric counterpart was found) surfaces of the
surf_set_collection2.output_set3 - matched (symmetric counterpart was found) surfaces of the
surf_set_collection2.
The
optionsargument is composed of several “action” groups, with each group consisting of four bits. Each bit in the group corresponds to one of four output sets: Action group “move to component” - bits 0…3: These bits correspond to the output set numbers (0-3). Surfaces from the specified output set set are moved into a component with a predefined name as described below:output set
orginal component name
new component name
output_set0
<name>
<name>_unmatched
output_set1
<name>
<name>_plus
output_set2
<name>
<name>_unmatched
output_set3
<name>
<name>_minus
Action group “delete” - bits 4…7 (corresponding to <output set #+4>): surfaces from the corresponding output set (4=unmatched/
surf_set_collection1, 5=matched/surf_set_collection1, 6=unmatched/surf_set_collection2, 7=matched/surf_set_collection2) are deleted (if both “move to component” and “delete” actions are specified for the same output set, this “delete” action takes precedence).Action group “highlight” - bits 8…11 (corresponding to <output set #+8>): surfaces from the corresponding output set (8=unmatched/
surf_set_collection1, 9=matched/surf_set_collection1, 10=unmatched/surf_set_collection2, 11=matched/surf_set_collection2) are also placed into their corresponding input set and highlighted.The final value for the options parameter is the sum of 2 to the power of the bit value for each desired action. For example, the “move to component” output set uses bit values equal to the output set numbers, so so moving the unmatched surfaces (output_set0 and output_set2) into a component requires an options value of 2^0 + 2^2 = 5.
Show Bit value calculator
Radio Button Table Option Name Value Unmatched surfaces of the 'surf_set_collection1' (Bit0) Matched surfaces of the 'surf_set_collection1' (Bit1) Unmatched surfaces of the 'surf_set_collection2' (Bit2) Matched surfaces of the 'surf_set_collection2' (Bit3) Delete unmatched surfaces of the 'surf_set_collection1' (Bit4) Delete matched surfaces of the 'surf_set_collection1' (Bit5) Delete unmatched surfaces of the 'surf_set_collection2' (Bit6) Delete matched surfaces of the 'surf_set_collection2' (Bit7) Highlight unmatched surfaces of the 'surf_set_collection1' (Bit8) Highlight matched surfaces of the 'surf_set_collection1' (Bit9) Highlight unmatched surfaces of the 'surf_set_collection2' (Bit10) Highlight matched surfaces of the 'surf_set_collection2' (Bit11) Calculated argument value: 0 Example#
Find the symmetry between the surfaces with IDs 3 , 4 and the surfaces with IDs 5,6 . You want to use identity tolerance of 0.1 . You want to reorganize and highlight surfaces that were found to be symmetrical , and to delete surfaces that do not have symmetric counterpart . To see how you would construct theoptionsvalue , see the note at the end of the example .#import hm import hm.entities as ent model = hm.Model() options = 2**1 + 2**3 + 2**4 + 2**6 + 2**9 + 2**11 model.surfacemark_find_organize_symmetry( surf_set_collection1=hm.Collection(model, ent.Surface, [3, 4]), surf_set_collection2=hm.Collection(model, ent.Surface, [5, 6]), plane_normal=[0.0, 0.0, 0.1], plane_base=[0.0, 10.0, 0.0], options=2650, tolerance=0.1, )
Note
The
optionsargument in this current example was constructed based on the actions below:Organizing symmetric surfaces - add bits 1 and 3 (action group “move to component” for output_set1 and output_set3).
Deleting unmatched surfaces - add bits 4 and 6 (action group “delete” for output_set0 and output_set2).
Highlighting symmetric surfaces - add bits 9 and 11 (action group “highlight” for output_set1 and output_set3).