# Filename: tri_append_faces.py
# Purpose: Use NumPy array to create triangulation.
# Returns: None.

from maptek import vulcan
from maptek import vulcan_gui
import numpy as np

new_tri = 'facet.00t'
with vulcan.triangulation(new_tri, 'w') as tri:
    # create NumPy arrays
    nodes = np.array([
                      [77300.0, 4600.0, 0.0],
                      [77600.0, 4600.0, 0.0], 
                      [77300.0, 4600.0, 300.0]])
    faces = np.array([[0,1,2]])
    tri.append_vertices(nodes)
    tri.append_faces(faces)
    
vulcan_gui.load_triangulation(new_tri)