Model.trim_elements_with_two_point_box#
- Model.trim_elements_with_two_point_box(collection, x1, y1, z1, x2, y2, z2, spc_collector_name, box_collector_name, remesh_params, dof_array=s_defaultDoubleList)#
Trims shell elements using a box defined by two diagonal points. Shell elements inside the box are kept with the elements along any cuts re-meshed. Solid elements with all nodes inside the box are kept, while all others are deleted.
- Parameters:
collection (Collection) – The collection containing the element entities to cut.
x1 (double) – The x-coordinate of the first corner point.
y1 (double) – The y-coordinate of the first corner point.
z1 (double) – The z-coordinate of the first corner point.
x2 (double) – The x-coordinate of the second corner point.
y2 (double) – The y-coordinate of the second corner point.
z2 (double) – The z-coordinate of the second corner point.
spc_collector_name (hwString) – Reserved for future development
box_collector_name (hwString) – Reserved for future development
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 box with corner points (0,0,0) and (100,100,100)#import hm import hm.entities as ent model = hm.Model() element_collection = hm.CollectionByDisplayed(model, ent.Element) model.trim_elements_with_two_point_box( collection=element_collection, x1=0.0, y1=0.0, z1=0.0, x2=100.0, y2=100.0, z2=100.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", )