Model.sl_feature_mesh#

Model.sl_feature_mesh(surface_collection, meshcontrol_collection, mode)#

Performs feature-based meshing of surfaces using meshcontrols.

Parameters:
  • surface_collection (Collection) – The collection containing the surface entities to mesh. If it is not be used, pass empty collection.

  • meshcontrol_collection (Collection) – The collection containing the meshcontrol entities to use.

  • mode (int) –

    0 - Global, body and feature controls will be meshed. At least one global or body control is needed.

    1 - Feature controls only are meshed. Global/body controls are optional.

    Any surfaces defined in a feature meshcontrol must also be selected via the surface_collection, or also be defined in a body control. Otherwise, they will be ignored. The surfaces defined in the feature controls are meshed first, and the remainder are meshed by the global or body control as appropriate.

Examples#

Mesh all surfaces in the model using meshcontrols with IDs 1-3#
import hm
import hm.entities as ent

model = hm.Model()

surface_collection = hm.Collection(model, ent.Surface)
meshctrl_collection = hm.Collection(model, ent.Meshcontrol, [1, 2, 3])

model.sl_feature_mesh(
    surface_collection=surface_collection,
    meshcontrol_collection=meshctrl_collection,
    mode=0,
)
Mesh using all meshcontrols, with only feature controls expected to be meshed#
import hm
import hm.entities as ent

model = hm.Model()

meshctrl_collection = hm.Collection(model, ent.Meshcontrol)

model.sl_feature_mesh(
    surface_collection=hm.Collection(model,ent.Surface,populate=False),
    meshcontrol_collection=meshctrl_collection,
    mode=1,
)