Model.trim_elements_with_predefined_box#
- Model.trim_elements_with_predefined_box(collection, cut_type, limit, spc_collector_name, box_collector_name, remesh_params, dof_array=s_defaultDoubleList)#
Trims shell elements using a predefined box.
- Parameters:
collection (Collection) – The collection containing the element entities to cut.
cut_type (hwString) – A predefined cut name. Valid values are left, right, front, rear, frontleft, frontright, rearleft or rearright.
limit (double) – The x value of the box for cut types
predefined_cut=front,rear,frontleft,frontright,rearleft,rearright.spc_collector_name (hwString) – The name of the collector in which the SPCs will be created for constraining cut elements.
box_collector_name (hwString) – The name of the collector in which a hexa might be created to show the cutbox.
remesh_params (hwString) –
The parameters of re-meshing along the cut, defined as “keyword value” format. For example:
remesh_params="angle 30.0 min_elem_size_rate 0.6 comp_remainder_area_rate 1.0"Valid keywords and values are:
angle
Values used to define feature edges on mesh. Default if not specified is 30.0.
min_elem_size_rate
Defines the minimum element size locally. The valid range is between 0.0 and 1.0. The minimum element size is calculated locally on the mesh area being re-meshed. The element size is computed for the mesh area and the minimum element size is then the product of min_elem_size_rate and the element size of the area.
min_elem_size_value
Defines the minimum element size globally.
comp_remainder_elem_numb
Defines the minimum number of elements in a component. After box trimming, any component with an element count less than this value is deleted.
comp_remainder_area_rate
Define the limit of shell element area of components. After box trimming, any component with element areas less than this percent of its original area is deleted. The valid range of the value is between 0.0 and 100.0.
dof_array (hwDoubleList) – The degrees of freedom that need to be constrained. Valid values are 0.0 and 1.0 and should be given in a list of 6 values each corresponding to one DOF. The 0.0 means not constrained and 1.0 means constrained.
Example#
Trim displayed elements using a left box, with limit of 50#import hm import hm.entities as ent model = hm.Model() element_collection = hm.CollectionByDisplayed(model, ent.Element) model.trim_elements_with_predefined_box( collection=element_collection, cut_type="left", limit=50.0, spc_collector_name="abc", box_collector_name="efg", remesh_params="min_elem_size_rate 0.6 comp_remainder_elem_rate 0.01 angle 30.0", )