Model.hm_findclosestpointonsurface#

Model.hm_findclosestpointonsurface(x, y, z, surface)#

For a given point on a surface, this function returns the closest other point on that same surface:

xs ys zs dist

where xs, ys and zs are the coordinates of the point on the surface closest to input point, and dist is the distance between the original and projected points.

Parameters:
  • x (double) – The x coordinate of the known point.

  • y (double) – The y coordinate of the known point.

  • z (double) – The z coordinate of the known point.

  • surface (Entity) – The object describing the surface entity.

Returns:

  • hwReturnStatus - Status object

  • HmQueryResult - Result object containing the output values:

    • pointCoordinates (numpy.ndarray)

    • distance (double)

Example#

Find the point closest to a point with coordinates ( 2676 , -737 , 605 ) and located on surface with ID 7#
import hm
import hm.entities as ent

model = hm.Model()

_ , result = model.hm_findclosestpointonsurface(
  x=2676, y=-737, z=605, surface=ent.Surface(model, 7)
)

print("pointCoordinates", result.pointCoordinates)
print("distance", result.distance)