Model.hm_findpolygonselection#

Model.hm_findpolygonselection(elements)#

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.

Parameters:

elements (EntityList) – The list of input element entities.

Returns:

  • hwReturnStatus - Status object

  • HmQueryResult - Result object containing the output values:

    • elementsPath (EntityList) - Entity Type: Element - 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.

    • elementsLoop (EntityList) - Entity Type: Element - 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.

    • elementsFilled (EntityList) - Entity Type: Element - 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.

Example#

Highlight the polygonal path and lowlight the internal filled elements#
import hm
import hm.entities as ent

model = hm.Model()

_ , result = model.hm_findpolygonselection(elements=[ent.Element(model, 45527), ent.Element(model, 45528), ent.Element(model, 45519)])

print("elementsPath", result.elementsPath)
print("elementsLoop", result.elementsLoop)
print("elementsFilled", result.elementsFilled)