Ng_surface_input_error

Hello,

I am trying to understand how to create a mesh of 1x1 square using STL, but I get NG_SURFACE_INPUT_ERROR when I call Ng_STL_InitSTLGeometry.
Here is the code:

Ng_Init();

Ng_Mesh* mesh = Ng_NewMesh();
Ng_STL_Geometry* geom = Ng_STL_NewGeometry();

double v1 = { 0, 0, 0 };
double v2 = { 1, 0, 0 };
double v3 = { 1, 1, 0 };
double v4 = { 0, 1, 0 };

Ng_STL_AddTriangle(geom, v1, v3, v4);
Ng_STL_AddTriangle(geom, v1, v2, v3);

Ng_Result res = Ng_STL_InitSTLGeometry(geom);

Cannot figure out what I am doing wrong. :weary:

Could the fact that all the vertices lay on the same plane be the problem?