Model.hm_getmeshfaceparams#

Model.hm_getmeshfaceparams(surface)#

Returns all of the relevant automesh settings applied to a surface face by Model.set_meshfaceparams(). If no automesh settings are applied, no values are returned.

Parameters:

surface (Entity) – The object describing the face (surface) entity of to query.

Returns:

  • hwReturnStatus - Status object

  • HmQueryResult - Result object containing the output values:

    • shapeType (int)

    • elementType (int)

    • meshingAlgorithm (int)

    • elementSize (double)

    • smoothMethod (int)

    • smoothTolerance (double)

    • sizeControl (int)

    • skewControl (int)

Example#

Get the automesh parameters assigned to face with ID 1 after set them#
import hm
import hm.entities as ent

model = hm.Model()

model.setedgedensitylinkwithaspectratio(aspectratio=-1.0)

model.interactiveremeshsurf(
    collection=hm.Collection(model, ent.Surface, [1]),
    elementsize=10.0,
    elem_type=2,
    elem_type2=2,
    forcing=2,
    size_control=1,
    skew_control=1,
)
model.set_meshfaceparams(
    face_index=0,
    shape_type=2,
    elem_type=2,
    alg_type=0,
    elem_size=0,
    smooth_method=1,
    smooth_tol=0.5,
    size_control=1,
    skew_control=1,
)
model.automesh(face_index=0, algorithm=2, elem_type=2)
model.ameshclearsurface()

_, result = model.hm_getmeshfaceparams(surface=ent.Surface(model, 1))

print("shapeType", result.shapeType)
print("elementType", result.elementType)
print("meshingAlgorithm", result.meshingAlgorithm)
print("elementSize", result.elementSize)
print("smoothTolerance", result.smoothTolerance)
print("sizeControl", result.sizeControl)
print("skewControl", result.skewControl)