Model.solid_cavity_detect_start#
- Model.solid_cavity_detect_start(collection, all_cavities, get_n_cavities, max_radius, max_length, min_concavity)#
Finds cavities from solids, which may have been created by volume substraction from those solids. Internally, it merges identified cavities if they belong to the same volume.
The output of this function is a list of cavities, created as region entities. Each cavity is represented by a connected set of surfaces and one or more rims. Each rim is a connected set of edges. Cavities are sorted by descending order of their volume while creating the regions.
This function must be followed by a call to
Model.solid_cavity_detect_end().- Parameters:
collection (Collection) – The collection containing the surface entities. The surface entities should come from solids.
all_cavities (int) –
0 - Only cylindrical (simple cylinder) cavities will be detected.
1 - Cavities of all geometric shapes will be detected.
get_n_cavities (unsigned int) – If equal to 0, all identified cavities are found. If > 0, the first N cavities are found in descending order of their volume.
max_radius (double) – The maximum radius for circular cavities to be processed. For cavities of arbitrary shape the “effective” diameter is found as the cross section perimeter divided by pi. A value of -1 ignores this option.
max_length (double) – The maximum length of a cavity, mainly applicable for circular cavities. A value of -1 ignores this option.
min_concavity (double) – The minimum concavity factor. A value of 0.5 is default.
Examples#
Detect cavities of all geometric types based on default arguments#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_end()
Detect cavities of all geometric types, find only the first five cavities#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=5, max_radius=-1, max_length=-1, min_concavity=0.5, ) model.solid_cavity_detect_end()