Model.solidmap_solids_set_face_params#

Model.solidmap_solids_set_face_params(collection, options)#

Sets the per surface mesh type and mesh flags. The function has effect only for surfaces for which the mesh type and flags are free to change (e.g not a along face of a solid and not linked to a premeshed surface…).

This function can only be called between the Model.solidmap_solids_begin() and Model.solidmap_solids_end() function pair.

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

  • options (unsigned int) –

    Flags that indicate different options for solid mapping.

    Bit values are used and the value is calculated as (Bit0 + 2*Bit1 + 4*Bit2 + 8*Bit3 + 16*Bit4 + 32*Bit5 + 64*Bit6 + 128*Bit7 + 256*Bit8). The bits not listed below are unused or for internal use (e.g. called in other functions). Valid Bit options are:

    Bit0,1

    Mesh type. Valid values are:

    0/1/3 - Non-mapped mesh type.

    2 - Mapped mesh type. The 4 most prominent vertices are used as corners.

    Bit2-4

    Elem type if non-mapped. Valid values are:

    0 - Use the same type defined in Model.solidmap_solids_begin().

    1 - tria.

    2 - quad.

    3 - mixed.

    4 - R-tria.

    Bit5

    Size control. Valid values are:

    0 - Size control off.

    1 - Size control on.

    Bit6 Skew control. Valid values are:

    0 - Skew control off.

    1 - Skew control on.

    Bit7

    Mesh flow alignment. Valid values are:

    0 - Mesh flow alignment off.

    1 - Mesh flow alignment on.

    Bit8

    Global size control. Valid values are:

    0 - Global size control off.

    1 - Global size control on.

    Show Bit value calculator
    Radio Button Table
    Option Name Value
    Mesh type. Valid values are 1/3/4 or 2 (Bit0,1)
    Elem type if non-mapped. Valid values are 0,1,2,3 or 4 (Bit2-4)
    Size control (Bit5)
    Skew control (Bit6)
    Mesh flow alignment (Bit7)
    Global size control (Bit8)
    Calculated argument value: 0

Example#

Mesh the solids with IDs 32 and 41 with a default elem size of 2.0. Additionally, the surfaces with IDs 5 and 10 are to be of mapped mesh type by auto determine the corners#
import hm
import hm.entities as ent

model = hm.Model()

model.solidmap_solids_begin(
    collection=hm.Collection(model, ent.Solid, [32, 41]), options=0, elem_size=2.0
)
model.solidmap_solids_set_face_params(
    collection=hm.Collection(model, ent.Surface, [5, 10]), options=2
)
model.solidmap_solids_end()