Model.smooth3d#
- Model.smooth3d(collection, options)#
Optimizes node locations of 3D elements against user supplied quality criteria.
For nodes on the boundary of the selected elements, tolerances to limit node movement off and along boundary may be defined to improve the quality near the boundary. Note that nodes that are adjacent to unselected elements are always fixed and these tolerances have no effect.
For practical use, it is better to set the off/along boundary tolerances small and do multiple runs.
- Parameters:
collection (Collection) – The collection containing the entities to smooth. Valid entity types are components and elements.
options (hwString) –
A quoted string of space separated name=value options, which specify the run parameters and one or more quality criteria with the corresponding thresholds and weights.
The run parameters options the substrings below. If an option is not given, it takes the default value. Options can be given in any order. Valid options are:
feature_angle=<angle> - The feature angle. Default is 60.0.
niter=<number> - The maximum number of smooth iterations. Default is 50.0.
shell_dev=<off_tol>,<along_tol> - The boundary node move limits for off and along boundary relative to local elems size. Default is 0.01 and 0.1.
show_dim=<flag> - Show before move node locations using temp nodes. Valid options are:
0 - Do not show (default)
1 - Show edge node moves
2 - Show surface node moves
The quality parameters have one or more substrings as shown below. Only specified criteria are considered. Options can be given in any order. Valid options are:
angle2d=<min_tria_angle>,<max_tria_angle>,<min_quad_angle>,<max_quad_angle>,<weight> - The target face angle for both tria and quad faces.
aspect=<thr>,<weight> - The target aspect ratio.
jcbr=<thr>,<weight> - The target Jacobian ratio.
size=<min_size>,<max_size>,<weight> - The target min/max size. The size is not something that is optimized. Internally, the size is just equalized/smoothed.
skew=<angle>,<weight> - The target skew.
warp=<angle>,<weight> - The target warpage of quad faces.
Example#
Smoothen the elements with IDs 2, 3, and 4 with various options#import hm import hm.entities as ent model = hm.Model() model.smooth3d( collection=hm.Collection(model, ent.Element, [2, 3, 4]), options="niter=100 shell_dev=0.02,0.1 feature_angle=45 show_dim=2 warp=25,2 size=1.0,5.0,1 angle2d=20,120,40,140,1 aspect=3,1", )