Model.fetosurfs#

Model.fetosurfs(collection_2d, collection_1d, options, complexity, tolerance, reserved)#

Generates surfaces from shell elements.

Parameters:
  • collection_2d (Collection) – The collection containing the input 2D shell element entities, which are used to construct the surface.

  • collection_1d (Collection) – The collection containing the edge/feature element entities, which are used to split shell elements into separate surfaces.

  • options (int) –

    Specifies options for creating the surfaces.

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

    Bit0

    Tolerance. Valid values are:

    0 - Use given tolerance to control accuracy. 1 - Use automatic calculation of approximation tolerance from input elements.

    Bit1

    Shell splitting. Valid values are:

    0 - Do not attempt automatic shell splitting in cases where surface approximation could not be calculated for given tolerance and complexity limit.

    1 - Split shell in cases where surface approximation could not be calculated for given tolerance and complexity limit.

    Bit2

    Failure. Valid values are:

    0 - Ignore failure on some patches and calculate the remainder.

    1 - Stop on failure

    Bit3

    Sharp features. Valid values are:

    0 - Ignore sharp features unless specified by input feature edges.

    1 - Automatically split shell along sharp features even if not specified by input feature edges.

    Bit4

    Element component information. Valid values are:

    0 - Ignore element component information.

    1 - Use element component information to split shell and create surfaces in the same component as corresponding elements.

    Bit5

    Associate nodes to created surfaces. Valid values are:

    0 - Do not associate nodes to created surfaces.

    1 - Associate nodes to created surfaces.

    Bit6

    Use of automatic feature detection. Valid values are:

    0 - Do not use automatic feature detection.

    1 - Use automatic feature detection, based on twice the value defined in the feature angle setting of the options panel.

    Show Bit value calculator
    Radio Button Table
    Option Name Value
    Tolerance (Bit0)
    Shell splitting (Bit1)
    Failure (Bit2)
    Sharp features (Bit3)
    Element component information (Bit4)
    Associate nodes to created surfaces (Bit5)
    Use of automatic feature detection (Bit6)
    Calculated argument value: 0

  • complexity (int) – A number controlling the maximum complexity of a single surface patch. This sets the maximum number of control points for a surface.

  • tolerance (double) – Geometry simplification tolerance. Defines the maximum distance between original and simplified geometries.

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

Example#

Construct a surface from all quad4 elements, using a tolerance of 0.1, limiting the number of control points to 900, no automatic shell splitting, stop on failures, split surfaces by sharp features, split surfaces according to element components, associate nodes, and no automatic feature detection (options = 1*0 + 2*0 + 4*1 + 8*1 + 16*1 + 32*1 + 64*0 = 60)#
import hm
import hm.entities as ent

model = hm.Model()

elems_2d = hm.Collection(model, ent.Element, config="quad4", type="CQUAD4")
elems_1d = hm.Collection(model, ent.Element, ids=hm.hwUIntList([]))

model.fetosurfs(
  collection_2d=elems_2d,
  collection_1d=elems_1d,
  options=60,
  complexity=900,
  tolerance=0.1,
  reserved=0
)