66#include < atomic>
77
88#include " core/vec.h"
9+ #include " core/debug.h"
910#include " core/openmp.h"
1011#include " core/mesh.h"
1112#include " core/vertex.h"
1516
1617namespace tinymesh {
1718
18- void remeshTriangular (Mesh &mesh, double shortLength, double longLength, double keepAngleLessThan, int iterations) {
19+ void remeshTriangular (Mesh &mesh, double shortLength, double longLength, double keepAngleLessThan, int iterations, bool verbose ) {
1920 Assertion (mesh.verify (), " Invalid mesh!" );
2021
2122 // Compute average edge length
@@ -70,9 +71,11 @@ void remeshTriangular(Mesh &mesh, double shortLength, double longLength, double
7071
7172 // Remesh loop
7273 for (int k = 0 ; k < iterations; k++) {
73- printf (" *** Original #%d ***\n " , k + 1 );
74- printf (" #vert: %d\n " , (int )mesh.numVertices ());
75- printf (" #face: %d\n " , (int )mesh.numFaces ());
74+ if (verbose) {
75+ Info (" *** Original #%d ***\n " , k + 1 );
76+ Info (" #vert: %d\n " , (int )mesh.numVertices ());
77+ Info (" #face: %d\n " , (int )mesh.numFaces ());
78+ }
7679
7780 // Split long edges
7881 indices.clear ();
@@ -95,9 +98,11 @@ void remeshTriangular(Mesh &mesh, double shortLength, double longLength, double
9598 }
9699 }
97100
98- printf (" *** After split ***\n " );
99- printf (" #vert: %d\n " , (int )mesh.numVertices ());
100- printf (" #face: %d\n " , (int )mesh.numFaces ());
101+ if (verbose) {
102+ Info (" *** After split ***\n " );
103+ Info (" #vert: %d\n " , (int )mesh.numVertices ());
104+ Info (" #face: %d\n " , (int )mesh.numFaces ());
105+ }
101106
102107 mesh.verify ();
103108
@@ -146,9 +151,11 @@ void remeshTriangular(Mesh &mesh, double shortLength, double longLength, double
146151 }
147152 }
148153
149- printf (" *** After collapse ***\n " );
150- printf (" #vert: %d\n " , (int )mesh.numVertices ());
151- printf (" #face: %d\n " , (int )mesh.numFaces ());
154+ if (verbose) {
155+ Info (" *** After collapse ***\n " );
156+ Info (" #vert: %d\n " , (int )mesh.numVertices ());
157+ Info (" #face: %d\n " , (int )mesh.numFaces ());
158+ }
152159
153160 // Flip edges
154161 for (int i = 0 ; i < (int )mesh.numHalfedges (); i++) {
0 commit comments