Model.check_symmetric_surfaces#
- Model.check_symmetric_surfaces(source_collection, target_collection, param_strs)#
Checks whether a selection of surfaces is symmetric. Optionally, the transformation can be supplied. The transformation can be supplied as a translation, a rotation, or a 4x4 transformation matrix. If not supplied, the transformation is computed internally. The tolerance for matching the mesh can also be supplied. If not given, the global geometry cleanup tolerance is used instead. The global node tolerance is used for the computation. If the surfaces deviate on the number of fixed points, it can fix the target surfaces by adding or suppressing fixed points.
The output information is logged into two global arguments: g_hw_argc and g_hw_argv. These can be accessed after the execution of the function.
If a transformation was not supplied to the function, the internally computed transformation is logged in terms of translation and rotation. It also contains the general status of the function (whether the surfaces are symmetric or not).
- Parameters:
source_collection (Collection) – The collection containing the source entities. Valid entities are surfaces.
target_collection (Collection) – The collection containing the target entities. Valid entities are surfaces.
param_strs (hwStringList) –
The list that contains the additional input parameters. Valid parameters and their syntax are:
rotation
angle: <angle in degrees>
axis: <axis, x component> <axis, y component > <axis, z component >
base: <base, x component> < base, y component > < base, z component >
Syntax:
"rotation: angle :<angle> axis : <axis, x component> <axis, y component > <axis, z component > base: <base, x component> < base, y component > < base, z component >"tolerance
Syntax:
"tolerance: <value>"transformation
Syntax:
"transformation: <tr11> <tr12> <tr13> <tr14> <tr21> <tr22> <tr23> <tr24> <tr31> <tr32> <tr33> <tr34> <tr41> <tr42> <tr43> <tr44>"translation
Syntax:
"translation: <x component> <y component > <z component>"
Examples#
Check if the surfaces with IDs 10 and 20 are symmetric with a translation along the y direction , and a rotation of 90.0 degrees along the global y - axis#import hm import hm.entities as ent import hw model = hm.Model() # Checking the symmetry of mesh source_ccol = hm.Collection(model, ent.Surface, [10]) target_ccol = hm.Collection(model, ent.Surface, [20]) parameterList = [ "translation: 0 1 0", "rotation: angle :90 axis : 0 1 0 base: 0 0 0" ] model.check_symmetric_surfaces( source_collection=source_ccol, target_collection=target_ccol, param_strs=parameterList, ) # Query the output information hw.evalTcl("return $g_hw_argc") # length of output string list hw.evalTcl("return $g_hw_argv")
Do the check use a custom tolerance and transformation matrix#import hm import hm.entities as ent import hw model = hm.Model() # Checking the symmetry of mesh source_ccol = hm.Collection(model, ent.Surface, [10]) target_ccol = hm.Collection(model, ent.Surface, [20]) parameterList = [ "transformation: 0 0 1 0 0 1 0 0 -1 0 0 0 2.5 0 12.5 1", "tolerance: 0.1" ] model.check_symmetric_surfaces( source_collection=source_ccol, target_collection=target_ccol, param_strs=parameterList, ) # Query the output information hw.evalTcl("return $g_hw_argc") # length of output string list hw.evalTcl("return $g_hw_argv")
Do the check by auto - detect the transformation#import hm import hm.entities as ent import hw model = hm.Model() # Checking the symmetry of mesh source_ccol = hm.Collection(model, ent.Surface, [10]) target_ccol = hm.Collection(model, ent.Surface, [20]) parameterList = ["tolerance: 0.1"] model.check_symmetric_surfaces( source_collection=source_ccol, target_collection=target_ccol, param_strs=parameterList, ) # Query the output information hw.evalTcl("return $g_hw_argc") # length of output string list hw.evalTcl("return $g_hw_argv")