Model.surfmark_trim_by_elemmark#

Model.surfmark_trim_by_elemmark(input_surf_collection, ref_line_collection, trim_elem_collection)#

Trims the selected surfaces by selected elements using input lines or edges as reference.

Parameters:
  • input_surf_collection (Collection) – The collection containing the surface entities to trim.

  • ref_line_collection (Collection) – The collection containing the element entities to use as the trimmer.

  • trim_elem_collection (Collection) – The collection containing the line entities used as a reference to identify which part of the surfaces to trim out.

Example#

Trim the surface with ID 3425 by a selection of elements , and keep the portion of the surface which has an edge overlapping ( partially or fully ) with line with the ID 255495#
import hm
import hm.entities as ent

model = hm.Model()

# Creating a collection that contains the elements to use as the trimmer
elements_collection = hm.Collection(
    model,
    ent.Surface,
    [
        175323,
        175313,
        175309,
        175307,
        175304,
        175303,
        175301,
        175299,
        175298,
        175297,
        175296,
        175295,
        175293,
        175292,
        175291,
        175290,
        175289,
        175287,
    ],
)

model.surfmark_trim_by_elemmark(
    input_surf_collection=hm.Collection(model, ent.Surface, [3425]),
    ref_line_collection=hm.Collection(model, ent.Line, [2555495]),
    trim_elem_collection=elements_collection,
)