Model.prepare_solid_holes_for_meshing#
- Model.prepare_solid_holes_for_meshing(input_collection, output_collection, string_array)#
Takes as input a collection of surfaces or solids of a 3D body. It finds holes in the 3D body, and collects the found connected holes in “tubes”. It also trim and merges hole surfaces to make more surfaces suitable for the mapping mesh algorithm.
It sets element densities on surface edges. Moreover, independent holes can also be removed.
Optionally, this function groups holes by diameter, and creates a component with auto generated name for each holes group and moves the surfaces of the tubes to the corresponding components. Blind and through holes are considered as different separation groups, so they are grouped separately. the surfaces of the detected holes can be put to an output collection.
- Parameters:
input_collection (Collection) – The collection containing the input entities.
output_collection (Collection) – The output collection containing the surface entities of the detected holes. If provided directly as an empty collection no surfaces are placed on the
output_collection.string_array (hwStringList) –
The list of strings that contains the fillet width and radius group information.
The first string in quotations should contain the following parameters as keywords followed by the parameters values. Keywords and the corresponding values can be separated by blanks and/or by “=”:
cross_sect_size_max
Maximum length of the holes normal to the holes axes cross sections. This applies only to elongated holes (rounded slots or elliptical holes).
cross_sect_size_max
0 - No limitation is applied.
diams_ratio_max
Maximum ratio of diameters of adjacent co-axial cylindrical hole sections when the sections are considered within the same tube.
elem_size
The element size used in meshing parameters.
min_elem_size
The minimum element size used in meshing parameters.
separate_holes
0 - Means holes will not be distributed into different groups.
1 - Means holes will be distributed into different groups.
All other strings may contain 4 quotes values:
min_diam (double)
max_diam (double)
num_of_circumference_elems (int)
Used in seeding the circular edges of a hole.
elem_size_for_longitudinal_edges (double)
Used in seeding operation.
The intervals for min_diam and max_diam should not overlap between groups.
If num_of_circumference_elems is set to 0, the holes in the group are removed when possible. In this case, elem_size_for_longitudinal_edges is not required. If some holes can not be properly removed, then they are seeded normally with num_of_circumference_elems set to 3 and elem_size_for_longitudinal_edges set to elem_size. Currently, only independent holes can be removed.
Examples#
Recognize and prepare holes with diameters in three different intervals 0 - 15 , 15 - 20 and 20.0 - 40.0 , and separate them accord to different seeding design#import hm import hm.entities as ent model = hm.Model() options_list = [ "cross_sect_size_max = 100 diams_ratio_max = 2.5 min_elem_size = 2.0 seperate_holes = 1", "0.0 15.0 6 6.0", "15.0 20.0 6 8.0", "20.0 40.0 8 10.0", ] surf_collection = hm.Collection(model, ent.Surface) out_collection = hm.Collection(model, ent.Surface, populate=False) model.prepare_solid_holes_for_meshing( input_collection=surf_collection, output_collection=out_collection, string_array=options_list, )
Remove holes with diameter in the range 0.0 - 5.0#import hm import hm.entities as ent model = hm.Model() options_list = [ "cross_sect_size_max = 100 diams_ratio_max = 2.5 min_elem_size = 2.0 seperate_holes = 1", "0.0 5.0 0 0.0", ] surf_collection = hm.Collection(model, ent.Surface) out_collection = hm.Collection(model, ent.Surface, populate=False) model.prepare_solid_holes_for_meshing( input_collection=surf_collection, output_collection=out_collection, string_array=options_list, )