From a70a9e56d622989e9707378be5d328488e41c992 Mon Sep 17 00:00:00 2001 From: Trammell Hudson Date: Sun, 15 Feb 2015 16:03:41 -0500 Subject: [PATCH] allow start vertex to be set --- faces.c | 3 ++- stl_3d.c | 7 ++++--- stl_3d.h | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/faces.c b/faces.c index d1d0ab1..486382d 100644 --- a/faces.c +++ b/faces.c @@ -220,7 +220,8 @@ main(void) stl, f, vertex_list, - face_used + face_used, + 0 ); fprintf(stderr, "%d: %d vertices\n", i, vertex_count); diff --git a/stl_3d.c b/stl_3d.c index ca94efd..2aa88f7 100644 --- a/stl_3d.c +++ b/stl_3d.c @@ -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; } diff --git a/stl_3d.h b/stl_3d.h index 1fb2016..04d0d1b 100644 --- a/stl_3d.h +++ b/stl_3d.h @@ -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 );