Model.hm_getmaxgapwidth#

Model.hm_getmaxgapwidth(entity_list1, entity_list2)#

Returns the approximate maximum distance between a pair of node lists. This is useful for determining the gap width to be used for filling the gap between the node lists.

Parameters:
  • entity_list1 (EntityList) – A list containing the entity objects of the first nodes.

  • entity_list2 (EntityList) – A list containing the entity objects of the second nodes.

Returns:

Example#

Get the maximum gap width between two node lists#
import hm
import hm.entities as ent

model = hm.Model()

nodes1 = [ent.Node(model, n) for n in range(1,21) ]
nodes2 = [ent.Node(model, n) for n in range(45, 81) ]

_, result = model.hm_getmaxgapwidth(
    entity_list1=nodes1,
    entity_list2=nodes2
)

print("maximumGap: ", result.maximumGap)