allow start vertex to be set

This commit is contained in:
Trammell Hudson 2015-02-15 16:03:41 -05:00
parent c2bc3de94e
commit a70a9e56d6
3 changed files with 8 additions and 5 deletions

View File

@ -220,7 +220,8 @@ main(void)
stl,
f,
vertex_list,
face_used
face_used,
0
);
fprintf(stderr, "%d: %d vertices\n", i, vertex_count);

View File

@ -243,11 +243,12 @@ stl_trace_face(
const stl_3d_t * const stl,
const stl_face_t * const f_start,
const stl_vertex_t ** vertex_list,
int * const face_used
int * const face_used,
const int start_vertex
)
{
const stl_face_t * f = f_start;
int i = 0;
int i = start_vertex;
int vertex_count = 0;
do {
@ -288,7 +289,7 @@ stl_trace_face(
// keep going until we reach our starting face
// at vertex 0.
} while (f != f_start || i != 0);
} while (f != f_start || i != start_vertex);
return vertex_count;
}

View File

@ -59,7 +59,8 @@ stl_trace_face(
const stl_3d_t * const stl,
const stl_face_t * const f_start,
const stl_vertex_t ** vertex_list,
int * const face_used
int * const face_used,
int start_vertex
);