Model.solid_offset_from_surfs#

Model.solid_offset_from_surfs(collection, offset, options, comp_mode)#

Creates solids by normally offsetting a set of selected surfaces.

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

  • offset (double) – The distance to offset along the normal direction.

  • options (int) –

    Flags that indicate different modes for the offset.

    Bit values are used and the value is calculated as (Bit0 + 2*Bit1 + 4*Bit2 + 8*Bit3 + 16*Bit4 + 32*Bit5). Valid Bit options are:

    Bit0

    Offset both free and internal edges of surfaces. Valid values are:

    0 - Only free edges of surfaces are offset.

    1 - Both free and internal edges are offset, thus creating separate solids from surfaces separated by shared edges.

    Bit1

    Create only boundary surfaces. Valid values are:

    0 - Create solid entities.

    1 - Create only boundary surfaces.

    Bit2

    Surfaces are offset in both directions. Valid values are:

    0 - Surfaces are offset in one direction (positive or negative based on the surface normal).

    1 - Surfaces are offset in both directions.

    Bit3

    Connectivity between selected and non-selected surfaces is preserved before creating solids. Valid values are:

    0 - Selected surfaces are disconnected from non-selected attached surfaces before creating solids.

    1 - Connectivity between selected and non-selected surfaces is preserved.

    Bit4

    When extrusion is made in both directions (Bit2=1), keep original surfaces. Valid values are:

    0 - When extrusion is made in both directions (Bit2=1), delete original surfaces.

    1 - When extrusion is made in both directions (Bit2=1), keep original surfaces and use them as separating surfaces between created solids.

    Bit5

    Copy of original selected surfaces is made before creating solids. Valid values are:

    0 - Original selected surfaces become part of created solid boundary.

    1 - Copy of original selected surfaces is made before creating solids.

    Show Bit value calculator
    Radio Button Table
    Option Name Value
    Offset both free and internal edges of surfaces (Bit0)
    Create only boundary surfaces (Bit1)
    Surfaces are offset in both directions (Bit2)
    Connectivity between selected and non-selected surfaces is preserved before creating solids (Bit3)
    When extrusion is made in both directions (Bit2=1), keep original surfaces (Bit4)
    Copy of original selected surfaces is made before creating solids (Bit5)
    Calculated argument value: 0

  • comp_mode (int) –

    Determines how new solids are distributed into components:

    0 - Solids are created in the current component and boundary surfaces are moved to the same component.

    1 - Solids are created in the current component, but surfaces remain in their original component.

    2 - Solids are created in the same component as the selected surfaces (the result is not predictable if the surfaces are originally in different components).

Example#

Create a solid by offset surface ID 3 a distance of 5.0 along both the positive and negative normal directions (Bit2=1) and to organize the input surface into the same component as the solid#
import hm
import hm.entities as ent

model = hm.Model()

model.solid_offset_from_surfs(
    collection=hm.Collection(model, ent.Surface, [3]),
    offset=5.0,
    options=4,
    comp_mode=0,
)