Model.shrinkwrapmesh#
- Model.shrinkwrapmesh(entity_collection, feature_collection, mesh_size, feature_angle, mesh_type, projection_type, min_checkval, system_entity, create_hole_elements, hole_patch_size, gap_patch_size)#
Generates a shrink wrap mesh of shell elements or its corresponding voxel mesh solid elements. This primarily differs from the function
Model.hmshrinkwrap()in that it can be used to generate solid elements. Furthermore, the tight mesh generated by this function better adheres to the input geometry without the need to directly specify features. Nevertheless, it is still possible to specify features for cases when it is desired to have mesh lines follow non-geometric features.- Parameters:
entity_collection (Collection) – The input collection containing the entities to use as input for generating the shrinkwrap mesh. Valid entities are elements, components, nodes, points, surfaces and solids.
feature_collection (Collection) – The collection containing the 1D feature element entities. This collection can be passed as empty as well as it is not needed in all use cases.
mesh_size (double) – The numerical value of the desired element size.
feature_angle (double) – This angle is used to calculate geometric features. If less than 0.0, the model’s mesh feature is utilized. A standard value is 30.0.
mesh_type (int) –
The type of mesh to generate. Valid values are:
0 - Unsmoothed, unprojected shell elements representing skin of outer voxel mesh.
1 - Triangle shell mesh.
2 - Quad shell mesh.
3 - Predominant quad mesh, with triangles used to split quads with diagonals lying near (geometric) feature edges.
10 - Unsmoothed, unprojected hexa element pure voxel mesh.
11 - All hexa mesh.
12 - All hexa mesh with pentas used to best fit the input geometry.
13 - All tetrahedral mesh.
projection_type (int) –
Flag indicating whether to create tight (projected) or smooth (unprojected) mesh. Valid values are:
0 - Smooth, unprojected mesh.
1 - Projected mesh adhering to specified feature angle.
min_checkval (double) – The minimum allowed value of the corner-node Jacobian for hexa/penta meshes, or minimum allowed value of tet-collapse for all tetrahedral meshes.
system_entity (Entity) – The object describing the system entity used to orient mesh grid. A value of
Noneimplies no such mesh orientation..create_hole_elements (int) –
0 - Do denote to create patch elements.
1 - Denotes to create patch elements.
hole_patch_size (double) – The input (topological) hole patch size.
gap_patch_size (double) – The input (semantic) gap patch size.
Examples#
Create a predominantly quad mesh with element size 4.0 that is projected using the model’s feature angle and that is aligned with the system with ID of 1. The input is all of the elements belonging to all components#import hm import hm.entities as ent model = hm.Model() component_collection = hm.Collection(model, ent.Component) model.shrinkwrapmesh( entity_collection=component_collection, feature_collection=hm.Collection(model, ent.Element, populate=False), mesh_size=4.0, feature_angle=0, mesh_type=3, projection_type=1, min_checkval=0, system_entity=ent.System(model, 1), create_hole_elements=0, hole_patch_size=0, gap_patch_size=0, )
Create a predominantly solid mesh with element size 2.0 that is projected using a feature angle of 30.0 degrees and whose elements’ Jacobian is constrained to be greater than 0.3. Also, have the surface of the mesh adhere to the features denoted by the feature elements onfeature_collection. The input is all surfaces onentity_collection#import hm import hm.entities as ent model = hm.Model() surface_collection = hm.Collection(model, ent.Surface) feature_element_collection = hm.Collection(model, ent.Element, populate=False) model.shrinkwrapmesh( entity_collection=surface_collection, feature_collection=feature_element_collection, mesh_size=2.0, feature_angle=30.0, mesh_type=12, projection_type=1, min_checkval=0.3, system_entity=None, create_hole_elements=0, hole_patch_size=0, gap_patch_size=0, ) print("Feature Element Collection length:", len(feature_element_collection))