Model.hm_getsurfacenormal#

Model.hm_getsurfacenormal(entity)#

Gets the normals of the surfaces connected to the node or point.

Parameters:

entity (Entity) – The object describing the entity. Only nodes or points entites are supported.

Returns:

  • hwReturnStatus - Status object

  • HmQueryResult - Result object containing the output values:

    • noOfSurfaces (int) - The number of surfaces attached to the point/node entity

    • SurfaceData (HmQueryResultList)-Result list object containing HmQueryResult objects with the following output data:

      • normalVectorComponents (numpy.ndarray) - The direction cosines of the normal of the surfaceEntity attached to the point/node entity

      • surfaceEntity (Entity) - The surface attached to the point/node entity - Entity Type: Surface

Example#

Suppose that node with ID 100 is located on a shared edge between surfaces have IDs 10 and 11 , retrieve the normals at attached surfaces#
import hm
import hm.entities as ent

model = hm.Model()

_, result = model.hm_getsurfacenormal(entity=ent.Node(model, 100))

print("Number of attached surfaces:", result.noOfSurfaces)
for res in result.SurfaceData:
    print("Attached surface:", res.surfaceEntity.id)
    print("Normal Vector Direction Cosine Components:", res.normalVectorComponents)