Incomplete work for porting translate()
This commit is contained in:
@@ -23,6 +23,14 @@
|
||||
|
||||
#include "stl.h"
|
||||
|
||||
void
|
||||
stl_invalidate_shared_vertices(stl_file *stl)
|
||||
{
|
||||
if (stl->v_indices != NULL)
|
||||
free(stl->v_indices);
|
||||
if (stl->v_shared != NULL)
|
||||
free(stl->v_shared);
|
||||
}
|
||||
|
||||
void
|
||||
stl_generate_shared_vertices(stl_file *stl)
|
||||
@@ -38,6 +46,9 @@ stl_generate_shared_vertices(stl_file *stl)
|
||||
int next_facet;
|
||||
int reversed;
|
||||
|
||||
// make sure this function is idempotent and does not leak memory
|
||||
stl_invalidate_shared_vertices(stl);
|
||||
|
||||
stl->v_indices = (v_indices_struct*)
|
||||
calloc(stl->stats.number_of_facets, sizeof(v_indices_struct));
|
||||
if(stl->v_indices == NULL) perror("stl_generate_shared_vertices");
|
||||
|
||||
Reference in New Issue
Block a user