Model.solid_cavity_detect_modify_rims#

Model.solid_cavity_detect_modify_rims(add_collection, remove_collection, region_id, add_surfs_flag)#

Modify a partially detected cavity by adding and removing rims.

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

Parameters:
  • add_collection (Collection) – The collection of the line entities containing edges to add as rims.

  • remove_collection (Collection) – The collection of the line entities containing existing edges to remove as rims.

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

  • add_surfs_flag (int) –

    1 - The extracted surfaces are added to the cavity.

    0 - The extracted surfaces are removed from the cavity.

Example#

Add a rim represented by a connected set of surface edges with IDs 3 and 4 with a cavity represented by region ID 10,and remove the rim represented by surface edge IDs 7 and 8 . Add the surfaces , as the volume of cavity increases due to this modification#
import hm
import hm.entities as ent

model = hm.Model()

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

model.solid_cavity_detect_modify_rims(
    add_collection=hm.Collection(model, ent.Line, [3, 4]),
    remove_collection=hm.Collection(model, ent.Line, [7, 8]),
    region_id=10,
    add_surfs_flag=1,
)

model.solid_cavity_detect_end()