Model.fixnarrowsurfaces#

Model.fixnarrowsurfaces(collection, width_threshold, mesh_type, fix_flag, string_options)#

Fixes narrow surfaces and surfaces having local narrow regions like tails and necks.

It is intended to eliminate sliver elements while meshing and sometimes to allow meshing surfaces otherwise non-meshable. Different levels of fixes can be provided for different types of meshing.

Parameters:
  • collection (Collection) – The collection containing the input entities.

  • width_threshold (double) – The width threshold for considering surfaces as narrow. It should be a positive value much smaller than the target element size for meshing of the model.

  • mesh_type (int) –

    The targeted mesh type:

    0 - Meshing using surface topology. Sliver surfaces, narrow surface tails and necks are identified and corresponding edges and points are self-stitched together. Collapsed surfaces are removed.

    1 - Meshing the splines (faces) topology. Sliver surfaces, narrow surface tails and necks are identified and corresponding edges are points are self-stitched together. Collapsed surfaces are removed. Gaps between surfaces and vertices exceeding the geometry_fix_tol are eliminated.

  • fix_flag (int) – When set to 1, performs geometry topology matching to morph the geometry to close physical gaps caused by stitching.

  • string_options (hwString) –

    An optional input string containing additional input parameters. The data for each input parameter consists of the predefined parameter keyword and the parameter value separated by space characters and /or equality symbol: parameter_keyword = parameter_value or parameter_keyword parameter_value.

    Supported parameters are:

    • geometry_fix_tol = tolerance

    The maximum gap allowed between edges and vertices, when eliminating geometry gaps for mesh_type. If not specified, the value is auto defined.

    • max_sharp_angle = angle

    The corner angle above which the area nearby a surface corner is not considered a local narrow region. Default is 10 degrees.

Examples#

Find and fix narrow surfaces with a width less than 0.4. Do not eliminate geometry gaps#
import hm
import hm.entities as ent

model = hm.Model()

surfs = hm.CollectionByDisplayed(model, ent.Surface)

model.fixnarrowsurfaces(
    collection=surfs, width_threshold=0.4, mesh_type=0, fix_flag=0, string_options=""
)
Find and fix narrow surfaces with a width less than 0.4. Eliminate geometry gaps, using an auto-defined tolerance#
import hm
import hm.entities as ent

model = hm.Model()

surfs = hm.CollectionByDisplayed(model, ent.Surface)

model.fixnarrowsurfaces(
    collection=surfs, width_threshold=0.4, mesh_type=1, fix_flag=0, string_options=""
)
Find and fix narrow surfaces with a width less than 0.4. Eliminate geometry gaps more than 0.02#
import hm
import hm.entities as ent

model = hm.Model()

surfs = hm.CollectionByDisplayed(model, ent.Surface)

model.fixnarrowsurfaces(
    collection=surfs, width_threshold=0.4, mesh_type=1, fix_flag=0, string_options="geometry_fix_tol = 0.02"
)