hm_findpolygonselection
Finds a polygonal path that connects all given input elements. This path takes into consideration the local mesh flow when defining a polygon.
Syntax
hm_findpolygonselection element_id1 element_id2 element_id3 ... ?element_idN?
Type
HyperMesh Tcl Query Command
Description
Finds and returns a closed path of elements connecting all given ordered list of input elements. The path tries to be polygonal with respect to local mesh-flow. The order of input is honored when constructing the path. A minimum of three element IDs needs to be provided to construct the path.
The command returns three lists of element IDs:
- Elements that form a path starting from the first element and ending at the last element, going through the rest of the input elements intermediately, in order.
- Elements that form a loop-completing path starting from the last element to the first element. This path, along with the one formed by the first list, forms a closed loop.
- Elements that form the filled selection. This includes the boundary elements on the loop and those that are “inside” the closed loop formed by the previous two lists.
Inputs
- element_id1
- The ID of element 1.
- element_id2
- The ID of element 2.
- element_id3
- The ID of element 3.
- element_idN
- The ID of element N.
Examples
To highlight the polygonal path and lowlight the internal filled
elements:
set out [hm_findpolygonselection 45527 45528 45519]
*createmark elems 1 {*}[lindex $out 0]; # loop elements
*appendmark elems 1 {*}[lindex $out 1]; # loop completion elements
*createmark elems 2 {*}[lindex $out 2]; # filled loop
hm_highlightmark elems 2 low; # lowlight loop fill elements
hm_highlightmark elems 1 high; # highlight loop elements
Errors
Incorrect usage results in a Tcl error. To detect
errors, you can use the catch
command:
if { [ catch {command_name...} ] } {
# Handle error
}
Version History
2021.2