Model.hm_getsurfacesurfaceangle#

Model.hm_getsurfacesurfaceangle(surf1, surf2, x, y, z)#

Finds the closest points, P1 and P2, on surfaces surf1 and surf2, respectively, to the point, Q, given by the coordinates (x, y, z). Next, it finds the vectors V1 and V2 which are normal to the given surfaces at points P1 and P2. The angle between V1 and V2, measured in degrees, is returned as the result. Note that the point Q does not have to be on either surface to find this angle.

Parameters:
  • surf1 (Entity) – The object describing the first input surface entity.

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

  • x (double) – The x-coordinate of the point from which the closest points to surf1 and surf2 will be measured.

  • y (double) – The y-coordinate of the point from which the closest points to surf1 and surf2 will be measured.

  • z (double) – The z-coordinate of the point from which the closest points to surf1 and surf2 will be measured.

Returns:

  • hwReturnStatus - Status object

  • HmQueryResult - Result object containing the output values:

    • angle (double) - The angles between the surf1 and surf2 normals

Example#

Find the angle between surfaces with IDs 413 and 156 at point ( 4.7 , 6.88 , 9.4 )#
import hm
import hm.entities as ent

model = hm.Model()

_, result = model.hm_getsurfacesurfaceangle(
    surf1=ent.Surface(model, 413), surf2=ent.Surface(model, 156), x=4.7, y=6.88, z=9.4
)

print("Angle:", result.angle)