Model.solid_cavity_detect_modify_surfaces#

Model.solid_cavity_detect_modify_surfaces(collection, region_id, add_surfs_flag)#

Modify a partially detected cavity by adding and removing surfaces.

The function Model.solid_cavity_detect_start() must be called before calling this function to generate the cavities as region entities.

Parameters:
  • collection (Collection) – The collection containing the surface entities to add or remove.

  • region_id (unsigned int) – The ID of the region containing the cavity definition to modify.

  • add_surfs_flag (int) –

    0 - The input surfaces are removed from the cavity.

    1 - The input surfaces are added to the cavity.

Examples#

Add surfaces with IDs 10 and 23 to a cavity attached to the region with ID 5#
import hm
import hm.entities as ent

model = hm.Model()

model.solid_cavity_detect_start(
    collection=hm.Collection(model, ent.Surface, [10, 23]),
    all_cavities=1,
    get_n_cavities=0,
    max_radius=-1,
    max_length=-1,
    min_concavity=0.5,
)


model.solid_cavity_detect_modify_surfaces(
    collection=hm.Collection(model, ent.Surface, [10, 23]),
    region_id=5,
    add_surfs_flag=1,
)

model.solid_cavity_detect_end()
Remove the surfaces with IDs 10 and 23 to a cavity attached to the region with ID 5#
import hm
import hm.entities as ent

model = hm.Model()

model.solid_cavity_detect_start(
    collection=hm.Collection(model, ent.Surface, [10, 23]),
    all_cavities=1,
    get_n_cavities=0,
    max_radius=-1,
    max_length=-1,
    min_concavity=0.5,
)

model.solid_cavity_detect_modify_surfaces(
    collection=hm.Collection(model, ent.Surface, [10, 23]),
    region_id=5,
    add_surfs_flag=0,
)

model.solid_cavity_detect_end()