Model.midsurface_extract_10#

Model.midsurface_extract_10(collection, outbound_normals, thickness_bound, align_steps, extract_by_comp, rerun_type, stitch_tol_mode, max_R_t_ratio, reserved_1, reserved_2, max_thickness_ratio, min_thickness, max_thickness, mid_position, reserved_4, reserved_5, new_or_curr_comp)#

Extracts mid-surfaces from a selection of surfaces or solids.

Parameters:
  • collection (Collection) – The collection containing the entities selected for mid-surface extraction. Valid entities are surfaces and solids.

  • outbound_normals (int) –

    If collection has surface entities:

    -1 - If surfaces selected on collection form a closed solid (but the entity type of collection is not set to solid). In this case the surfaces will be re-oriented, if needed, to have the normals go outside the solid they form.

    0 - If the normals go inside the selected surfaces.

    1 - If the normals go outside the selected surfaces.

    If collection has solid entities:

    3 - The parameter must be set to this value.

  • thickness_bound (int) –

    Limits on midsurface thickness:

    0 - No limit. Max ratio set using max_thickness_ratio.

    1 - User-defined thickness limits. Limits set using min_thickness and max_thickness.

  • align_steps (int) –

    Determines how steps are aligned for solids with discrete sections. This parameter also determines whether any specified base surfaces are taken into account when constructing the middle surface. If the values are 0, 1, or 2, the base surfaces are not used. In order to take the base surfaces into account, the value should be increased by 3.

    0 - Steps are not aligned at the thickness jumps (jumps maintained). Base surfaces will not be used.

    1 - Steps aligned at the thickness jumps. Mid-surface position set automatically. Base surfaces will not be used.

    2 - Steps aligned at the thickness jumps. Mid-surface position set using mid_position. Base surfaces will not be used.

    3- Steps are not aligned at the thickness jumps (jumps maintained). Base surfaces specified by you will be taken into account.

    4 - Steps aligned at the thickness jumps. Mid-surface position set automatically. Base surfaces specified by you will be taken into account.

    5 - Steps aligned at the thickness jumps. Mid-surface position set using mid_position. Base surfaces specified by you will be taken into account.

  • extract_by_comp (int) –

    0 - Extraction of the mid-surfaces can occur between any matching pair of the surfaces.

    1 - Extraction of the mid-surfaces can occur only between the surfaces that belong to the same component.

    Adding 10 to this value will result in the input geometry components maintaining their original transparency.

    Adding 100 to this value will result in creating plate information only, without midsurfaces.

  • rerun_type (int) –

    Used to specify one of the mid-surface extraction methods: “offset”, “offset+planes”, “offset+planes+sweeps” or “skin offset”. Valid options are:

    0 - Extracts the mid-surface using the “offset” method.

    1 - Extracts the mid-surface using the “offset” method, and at the same time copies the lines that collapsed into “Collapsed Lines” component.

    2 - Extracts the mid-surface using the “offset” method, by collapsing only the lines that are in the “Collapsed Lines” and “Just added Collapsed Lines” components. Additionally, it moves lines from “Just added Collapsed Lines” component into “Collapsed Lines” component.

    3 - Extracts the mid-surface using the “offset+planes” method.

    4 - Extracts the mid-surface using the “offset+planes” method, and at the same time copies the lines that collapsed into “Collapsed Lines” component.

    5 - Extracts the mid-surface using the “offset+planes” method, by collapsing only the lines that are in the “Collapsed Lines” and “Just added Collapsed Lines” components. Additionally, it moves lines from “Just added Collapsed Lines” component into “Collapsed Lines” component.

    6 - Extracts the mid-surface using the “skin offset” method.

    9 - Extracts the mid-surface using the “offset+planes+sweeps” method.

    10 - Extracts the mid-surface using the “offset+planes+sweeps” method, and at the same time copies the lines that collapsed into “Collapsed Lines” component.

    11 - Extracts the mid-surface using the “offset+planes+sweeps” method, by collapsing only the lines that are in the “Collapsed Lines” and “Just added Collapsed Lines” components. Additionally, it moves lines from “Just added Collapsed Lines” component into “Collapsed Lines” component.

  • stitch_tol_mode (int) –

    Defines the mode for performing mid-surface stitching. Valid values are:

    0 - Final stitching of the mid-surfaces is performed using a local tolerance of 1/5 of the local surface thickness (default in prior versions).

    1 - Final stitching of the mid-surfaces is performed using the geometry cleanup tolerance. This is recommended when extensive manual editing of the auto mid-surfacing result is expected, because having “far” stitching may misrepresent the geometry of the model and affect subsequent geometry operations.

  • max_R_t_ratio (double) – This is a ratio between the fillet radius and plate thickness analyzed at T, X and similar junctions. If the calculated ratio is greater than this parameter, the fillet does not collapse. In previous releases the ratio was a default value of 2 and could not be changed.

  • reserved_1 (double) – Reserved for future development. Value = 0.

  • reserved_2 (double) – Reserved for future development. Value = 0.

  • max_thickness_ratio (double) – This is a ratio between a plate thickness found during the midsurfacing and the minimum plate thickness found during the midsurfacing. If the ratio is exceeded the corresponding midsurface will be ignored. The parameter is used when thickness_bound is 0. It can be any real number > 1.

  • min_thickness (double) – Sets the minimum plate thickness bound. This parameter is used when thickness_bound=1. It can be any real number ≥ 0.

  • max_thickness (double) – Sets the maximum plate thickness bound. This parameter is used when thickness_bound=1. It can be any real number ≥ min_thickness.

  • mid_position (double) – Sets the midsurface position for step alignment case when align_steps is set to 2. This can be any number between 0 and 1.

  • reserved_4 (Collection) – Reserved for future development. Set it as empty collection.

  • reserved_5 (int) – Reserved for future development. Value = 0.

  • new_or_curr_comp (int) –

    1 - Midsurface will be created in a new component named “Middle Surface”.

    3 - Midsurface will be created in “Original” input components.

    6 - Midsurface will be created in “Original.#” component.

    7 - Midsurface will be created in “Original.#” component prefixed with Midsurface_.

    16 - Midsurface will be created in a new component under a new part hierarchy.

    17 - Midsurface will be created in a new component under a new part hierarchy prefixed with Midsurface_.

    20 - Midsurface will be created in the current component.

Example#

Extract the midsurface of solids with ID 5 - 7 , no thickness bounds , align the steps at 0.39 , only extract surfaces between the same component , max thickness ratio of 10 , and organize them into the “ Middle Surface “ component#
import hm
import hm.entities as ent

model = hm.Model()

solid_collection = hm.Collection(model, ent.Solid, [5, 6, 7])

model.midsurface_extract_10(
    collection=solid_collection,
    outbound_normals=3,
    thickness_bound=0,
    align_steps=2,
    extract_by_comp=1,
    rerun_type=0,
    stitch_tol_mode=0,
    max_R_t_ratio=2,
    reserved_1=0,
    reserved_2=0,
    max_thickness_ratio=10.0,
    min_thickness=0.0,
    max_thickness=0.0,
    mid_position=0.39,
    reserved_4=hm.Collection(model, ent.Component, populate=False),
    reserved_5=0,
    new_or_curr_comp=1,
)