# Filename: tri_face_direction.py
# Purose: Find the direction of a given face.
# Returns: Point as a unit vector.

from maptek import vulcan

input_tri = 'headframe.00t' # input tri

with vulcan.triangulation(input_tri) as tri: # Open triangulation in read mode
    face_dir = tri.face_direction(0) # pass facet index 0

    # do something with results...
    print(face_dir)

    # iterate through to find the directions of all facets
    for i, face in enumerate(tri.faces):
        face_dir = tri.face_direction(i) # pass facet index

        # do something with results...
        print(f"Facet index: {i}  {face_dir}")
        