Model.surface_stitch#

Model.surface_stitch(collection, allow_self_stitch=1, allow_stitch_different_surfs=1, stitch_only_free_edges=1, stitch_to='across_comp', allow_small_edge_collapse=0, tolerance_across=0.000000, tolerance_within=0.000000)#

Performs stitching of edges within surfaces or/and between surfaces.

Parameters:
  • collection (Collection) – The collection containing the surfaces to be stitched.

  • allow_self_stitch (unsigned int) –

    Specifies whether to consider stitching edges of the same surface. Valid values are:

    0 - Do not consider self-stitching.

    1 - Consider self-stitching (same surface edges).

  • allow_stitch_different_surfs (unsigned int) –

    Specifies whether to consider stitching edges between different surfaces. Valid values are:

    0 - Do not stitch edges between different surfaces.

    1 - Stitch edges between different surfaces.

  • stitch_only_free_edges (unsigned int) –

    Specifies whether to restrict to free edges for stitching. Valid values are:

    0 - Consider all edges.

    1 - Consider free edges only.

  • stitch_to (hwString) –

    Specifies which edges to consider for stitching. Valid values are:

    across_comp - Allow stitch between components.

    within_comp_only - Do not stitch between components.

    to_connected_surfs - stitch between selected surfaces and surfaces connected to selection.

    within_selection - stitch only within the subset of selected surfaces.

  • allow_small_edge_collapse (unsigned int) –

    Specifies whether to allow collapsing small edges when stitching. Valid values are:

    0 - Do not collapse small edges.

    1 - Collapse small edges.

  • tolerance_across (double) – The stitching tolerance value for edges of different surfaces. The default geometry tolerance is used if this input is not specified.

  • tolerance_within (double) – The stitching tolerance for edges within a single surface. The default geometry tolerance is used if not specified.

Example#

Stitch edges between all displayed surfaces using a tolerance value of 0.2#
import hm
import hm.entities as ent

model = hm.Model()

disp_surfs = hm.CollectionByDisplayed(model,ent.Surface)

model.surface_stitch(disp_surfs,tolerance_across=0.2,tolerance_within=0.2)