Model.remesh_main_secondary_boolean#
- Model.remesh_main_secondary_boolean(selected_collection, main_collection, strings)#
Performs intersection and Boolean operations of 2D elements. Elements are distributed into groups based on their connectivity and component membership. The elements belonging to different components can be in a single group by parameter input. Only different groups are taken as counterparts for the intersection and Boolean operations. Moreover, elements sharing a node are not counterparts of intersection calculations for element/element intersection.
- Parameters:
selected_collection (Collection) – The collection containing the selected entities. Valid entities are elements and components.
main_collection (Collection) –
The collection containing the main entities. Valid entities are elements and components.
Note
Main entities are those with no elements (internal shell elements) deleted after conformal elements are generated for intersecting elements. Selected entities which are not also selected as main, are known as secondary elements. After conformal elements are generated for intersecting elements, the secondary elements inside any closed watertight element groups are deleted.
strings (hwString) –
Character string containing name/value pairs. Names and values are space separated. Valid values are:
angle
This is used to define feature edges on the mesh utilized for remeshing. If not defined, its default is 30.0.
break_shell_along_component_boundaries
0 - All elements connected to each other are classified as a group.
1 - Element group building stops at component boundaries. All elements in each group belong to a single component (default).
do_boolean_difference
If set to 1, perform a Boolean difference to subtract secondary entities from the main. Default is 0.
generate_intersect_segments_only
If set to 1, the function only calculates and creates the intersection segments, but does not perform the intersection and remeshing. Default is 0.
keep_intersected_edges
If set to 1, create 1D elements at mesh intersection locations. Default is 0.
num_remesh_layers
The number of layers attached to intersecting elements to consider for remeshing. Valid values are:
-1 - Intersecting elements are split and stitched to obtain a conformal element connectivity without remeshing.
0 - Remesh only the intersecting elements
> 0 - Remesh using the specified number of layers in addition to the intersected elements.
Example#
Create intersections between the displayed components and components brown and blue#import hm import hm.entities as ent model = hm.Model() component_collection = hm.CollectionByDisplayed(model, ent.Component) component_main_collection = hm.Collection( model, ent.Component, "Name=brown OR Name=blue" ) model.remesh_main_secondary_boolean( selected_collection=component_collection, main_collection=component_main_collection, strings="do_boolean_difference 1 keep_intersect_edges 0 break_shell_along_component_boundaries 0 num_remesh_layers -1 angle 30.000000", )