Model.set_midsurface_z_offset#

Model.set_midsurface_z_offset(collection, z_offset, reserved)#

Sets the z-offset value assigned to a midsurface. The thickness assigned to a midsurface interprets the z-offset value according to three possible thickness origins:

  • Centered midsurface - When the thickness is assigned to the midsurface positioned in the middle between the plate sides.

  • Midsurface with base z-offset - When the thickness is assigned to the midsurface which is shifted from the center to accommodate steps or a base surface.

  • Midsurface side - When the thickness is assigned to the sides of the plate during the midsurface extraction.

Currently, this function will set the thickness origin to be “Centered midsurface”. However, if this function is used to set a constant z-offset value on a variable thickness surface, it is no longer possible to position the variable thickness correctly. Therefore, this function should only be used for constant thickness surfaces.

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

  • z_offset (double) – The constant z-offset value to assign to the surfaces.

  • reserved (int) – Reserved for future use. Must be set 0.

Example#

Set the z - offset value of surfaces with IDs 1 - 4 to 0.25#
import hm
import hm.entities as ent

model = hm.Model()

model.set_midsurface_z_offset(
    collection=hm.Collection(model, ent.Surface, [1, 2, 3, 4]),
    z_offset=0.25,
    reserved=0,
)