Model.adaptive_triangle_mesh#

Model.adaptive_triangle_mesh(collection, options, graphicsDB=0)#

Creates an adaptive tria mesh from an STL tria mesh input. This is useful for remeshing dirty STL meshes.

Parameters:
  • collection (Collection) – The collection containing the entities. Valid entities are components and elements.

  • options (hwString) –

    The options to control the new mesh generation. They are all key=value pairs. Pairs are separated by either a space or a comma. Valid parameters are:

    • break_connectivity=<value>

    Option to manage the connectivity with the neighboring mesh:

    0 - Fix nodes on selection boundary as well as other edges.

    1 - Break the connectivity at the selection boundary.

    2 - Keep the connectivity at the selection boundary.

    3 - Redo connectivity outside the selection, the spread of the transition region is determined automatically till the size meets neighboring size.

    • dfmin=<value>

    The minimum elem size.

    • feature_angle=<value>

    The minimum angle used to define features to keep in the resulting mesh. Default is 35.0 degrees.

    • growth_ratio=<value>

    The growth ratio of the triangles. Default is 1.2.

    • inside=<value>

    The fixed number of layers of elements inside the element selection where the connectivity is redone. This is valid only when break_connectivity=3.

    • outside=<value>

    The fixed number of layers of elements outside the element selection where the connectivity is redone. This is valid only when break_connectivity=3.

    • ref_size=<value>

    The default elem size.

    • span_angle=<value>

    Defines the maximum angle an element can span on a curved section. Default is 25.0 degrees.

  • graphicsDB (int) – Reserved for future development.

Example#

Create a new adaptive mesh of component with name “ remesh “ with new mesh size 10 , minimum size 1.0 , growth ratio 1.2 , span angle 30 degrees and feature angle 30 degrees .#
import hm
import hm.entities as ent

model = hm.Model()

comp_col = hm.Collection(model, ent.Component, "Name=remesh")

model.adaptive_triangle_mesh(
    collection=comp_col,
    options="growth_ratio=1.2 span_angle=30.0 feature_angle=30.0 ref_size=10.0 dfmin=1.0",
)