hm_flangedetectiongetflangemidline

Returns offset boundary points for a given flange.

Syntax

hm_flangedetectiongetflangemidline index offset_distance ?max_chordal_deviation?

Type

HyperMesh Tcl Query

Description

Returns offset boundary points for a given flange. This must be preceded by a call to hm_flangedetectionfindflanges.

The midline points are returned as a list of triples. These coordinates can then be used to construct the mideline.

Inputs

index
The index of the flange to query, starting from 0.
offset_distance
The offset distance from the free boundary.
max_chordal_deviation
The chordal deviation used to coarsen the output. Default value 0.1.

Examples

To find 2D flanges from elements in all components, using a min width of 2, a max width of 20 and a feature angle of 20, and write out all flange details to a file named C:/temp/flanges.txt:

set flangesfile [open "C:/temp/flanges.txt" "w"]
*createmark comps 1 all
hm_flangedetectioninit comps 1
hm_flangedetectionsetparams min_width=2.0 max_width=20 feature_angle=20
hm_flangedetectionfindflanges 1
set n [hm_flangedetectiongetnumberofflanges]
if { $n > 0 } {
    puts $flangesfile "Number of flanges = $n"
    puts $flangesfile "Flanges details"
    for {set i 0} {$i < $n} {incr i} {
        puts $flangesfile "$i details = [hm_flangedetectiongetflangedetails $i]"
        puts $flangesfile "$i midline = [hm_flangedetectiongetmidline $i 0]"
    }
    hm_flangedetectionfindmates
    set m [hm_flangedetectiongetnumberofmatinggroups]
    if { $m > 0 } {
        for {set i 0} {$i < $m} {incr i} {
            puts $flangesfile "$i = [hm_flangedetectiongetmatinggroupdetails $i]"
        }
    } else {
        puts $flangesfile "Flange mates not detected."
    }
} else {
    puts $flangesfile "Flanges not detected."
}
hm_flangedetectionend
close $flangesfile

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

2019