hm_mapelementstoplane
NAME
hm_mapelementstoplane - Fast unfolding of a given set of connected shell elements onto the plane.
SYNTAX
hm_mapelementstoplane markMask ?panelSensitive?
TYPE
HyperMesh Tcl Query
DESCRIPTION
markMask
The mark mask (1 or 2) of selected shell elements
panelSensitive
0 = Mark mask insensitive to the HyperMesh panel level. (Default)
1 = Mark mask sensitive to the HyperMesh panel level
EXAMPLE
This script flattens a selected mesh, moving its notes to a 2-D plane:
# select elements
*createmark elems 1 all
# calculate mapping of selected elements nodes to 2d plane
set node_map2d [ hm_mapelementstoplane 1 ]
# move each node to its 2d position (flatten the mesh)
foreach node $node_map2d {
# node id, and calculated u, v on a plane
set node_id [ lindex $node 0 ]
set node_u [ lindex $node 1 ]
set node_v [ lindex $node 2 ]
# current coordinates
set node_x [ hm_getentityvalue nodes $node_id "x" 0 ]
set node_y [ hm_getentityvalue nodes $node_id "y" 0 ]
set node_z [ hm_getentityvalue nodes $node_id "z" 0 ]
# u will be new node's x, v will be new node's y, new z will be 0
set vector_x [ expr $node_u - $node_x ]
set vector_y [ expr $node_v - $node_y ]
set vector_z [ expr - $node_z ]
*createvector 1 $vector_x $vector_y $vector_z
# calculate translation distance used by 'translatemark' (vector magnitude is ignored there)
set dist [expr sqrt( $vector_x * $vector_x + $vector_y * $vector_y + $vector_z * $vector_x )]
# select and translate the node
*createmark nodes 1 $node_id
*translatemark nodes 1 1 $dist
The result is returned as a list with a number of entries equal to the number of nodes in the set of selected elements: { { id1 x1 y1 } { id2 x2 y2} ... }. Each entry in the list consists of node id and mapped node coordinates on the plane.
The algorithm used by this command attempts to unfold a set of connected shell elements onto the plane while minimizing deformation for each element.
SEE ALSO