Model.imprint_mesh#
- Model.imprint_mesh(tgt_collection, src_collection=Collection(), src_node_list=s_defaultEntityList, close_node_list=0, anchor_nodes_collection=Collection(), remain=1, projection=0, projection_vector=hwTriple(0.0, 0.0, 0.0), to_dest_component=0, do_not_remesh_rebuild_extn=0, do_not_add_fixed_points_edges=0, remesh_mode=0, remesh_layers=2, angle=25.0, max_distance=0.0, mesh_size=0.0, mesh_type=0, create_joint_elems=0)#
Imprints source entities (nodes or elements) onto target entities (elements, components, parts or surfaces) with various input options.
- Parameters:
src_collection (Collection) – The collection containing the source entities for imprint. Valid entities are nodes, elements, and surfaces. Note that only FE geometry surfaces are supported. This argument will not be used if source is a node list.
tgt_collection (Collection) – The collection containing the target (destination) entities for imprint. Valid values are lines, surfaces, elements, components and parts.
src_node_list (EntityList) – The list containing the source nodes entities defining the segments to imprint.
close_node_list (int) –
This is applicable only if source is provided by
src_node_list.0 - Do not imprint segment between the last node and the first node to close the list as a loop (default if not provided).
1 - Imprint a segment between the last node and the first node to close the list as a loop.
anchor_nodes_collection (Collection) – The collection containing the the anchor node entities used for imprint. If provided, these nodes are anchored during imprint/remesh.
remain (int) –
1 - Source remains, source node coordinates are kept. (default)
2 - Destination remains, node coordinates projected to destination are used.
3 - Both remain, source entities are projected and a copy is imprinted to destination.
4 - Create patch between source entities and the imprinted copy to destination.
projection (int) –
0 - Normal to destination. (default)
1 - Along tangent.
2 - Along vector direction, if defined 3 doubles should be defined in
projection_vector.projection_vector (hwTriple) – The hwTriple object defining x, y, z components defining the vector direction. User can also supply a Python list of three doubles. Should be defined if
projection=2.to_dest_component (int) –
-1 - Create elements in source component.
0 - Create elements in current component. (default)
1 - Create elements in destination component.
do_not_remesh_rebuild_extn (int) –
0 - Remesh/rebuild extension. (default)
1 - Do not remesh/rebuild extension.
do_not_add_fixed_points_edges (int) –
0 - Add fixed points/edges on nodes imprint. (default)
1 - Do not add fixed points/edges on nodes imprint.
remesh_mode (int) –
-1 - No remesh. Element connectivity is maintained by recovery of the imprinting element edges.
0 - Do not remesh destination. Destination mesh is stitched to maintain element connectivity. (default)
1 - Remesh all input destination elements.
2 - Remesh destination elements defined by
remesh_layers.remesh_layers (int) –
Must be defined if
remesh_mode=2.0 - Remesh only the elements attached to the border of the imprinted element image.
> 0 - Remesh additional layers in addition to the elements attached to the imprinted element image. (default 2)
angle (double) – The angle in degrees used to define feature edges on the mesh. (default 25.0)
max_distance (double) – The function will exit with an error if the distance between source and destination exceeds this value. If not specified, this is ignored.
mesh_size (double) – The mesh size used for remeshing the imprint area. Automatically detected from input mesh if not provided.
mesh_type (int) –
The mesh type used for remeshing the imprint area. Automatically detected from input mesh if not provided.
0 - tria
1 - quad
2 - mixed
3 - R-tria
4 - quad only
create_joint_elems (int) –
0 - Do not create joint elements. (default)
1 - Create joint elements.
Example#
Imprint elements ID 217-232 onto elements ID 117-216, imprinting along direction (0, 0, -1), creating a patch, with destination component as source component, remesh rebuild extension as 1, add fixed points edges as 0, without anchor nodes, remesh mode as 0 and a feature angle of 30#import hm import hm.entities as ent model = hm.Model() source_element_collection = hm.Collection(model, ent.Element, list(range(217, 233))) target_element_collection = hm.Collection(model, ent.Element, list(range(217, 217))) model.imprint_mesh( src_collection=source_element_collection, tgt_collection=target_element_collection, projection=1, projection_vector=[0.0, 0.0, -1.0], remain=4, to_dest_component=-1, do_not_remesh_rebuild_extn=1, angle=30.0, )