Model.hm_morph_getdomainlength#

Model.hm_morph_getdomainlength(domain, x=DBL_MAX, y=DBL_MAX, z=DBL_MAX)#

Returns the length of a specified edge domain. Optional argument allows the user to input a vector along which to measure the length.

Parameters:
  • domain (Entity) – The object describing an edge domain entity.

  • x (double) – The x coordinate of the vector along which the length will be measured. Default vector is from one end of the domain towards the other.

  • y (double) – The y coordinate of the vector along which the length will be measured. Default vector is from one end of the domain towards the other.

  • z (double) – The z coordinate of the vector along which the length will be measured. Default vector is from one end of the domain towards the other.

Returns:

Examples#

Get the length of a domain with ID 2#
import hm
import hm.entities as ent

model = hm.Model()

_,result = model.hm_morph_getdomainlength(domain=ent.Domain(model, 2))

print("length",result.length)
Get the length of a domain with ID 2 and measured along a vector that runs 1.0 in the x direction , 0.5 in the y direction , and 0.0 in the z direction#
import hm
import hm.entities as ent

model = hm.Model()

_,result = model.hm_morph_getdomainlength(domain=ent.Domain(model, 2), x=1.0, y=0.5, z=0.0)

print("length",result.length)

Note

Only the length from end to end is measured. Curvature is ignored.