1717#include < wmtk/io/read_triangle_mesh.hpp>
1818#include < wmtk/utils/InsertTriangleUtils.hpp>
1919#include < wmtk/utils/Logger.hpp>
20- #include < wmtk/utils/ManifoldUtils.hpp>
21- #include < wmtk/utils/Reader.hpp>
2220#include < wmtk/utils/io.hpp>
2321
2422#include < wmtk/components/shortest_edge_collapse/ShortestEdgeCollapse.h>
@@ -55,9 +53,7 @@ std::vector<std::array<size_t, 3>> triangulate_polygon_face(std::vector<wmtk::Ve
5553 (b[0 ] * c[2 ] - b[2 ] * c[0 ]) != 0 ))) {
5654 no_colinear = false ;
5755 std::array<size_t , 3 > t = {
58- size_t (cur.second ),
59- size_t (next.second ),
60- size_t (nextnext.second )};
56+ {size_t (cur.second ), size_t (next.second ), size_t (nextnext.second )}};
6157 triangulated_faces.push_back (t);
6258 points_vector.erase (points_vector.begin () + ((i + 1 ) % points_vector.size ()));
6359 break ;
@@ -74,9 +70,9 @@ std::vector<std::array<size_t, 3>> triangulate_polygon_face(std::vector<wmtk::Ve
7470 // cleanup convex polygon
7571 while (points_vector.size () >= 3 ) {
7672 std::array<size_t , 3 > t = {
77- size_t (points_vector[0 ].second ),
78- size_t (points_vector[1 ].second ),
79- size_t (points_vector[points_vector.size () - 1 ].second )};
73+ { size_t (points_vector[0 ].second ),
74+ size_t (points_vector[1 ].second ),
75+ size_t (points_vector[points_vector.size () - 1 ].second )} };
8076 triangulated_faces.push_back (t);
8177 points_vector.erase (points_vector.begin ());
8278 }
@@ -327,9 +323,7 @@ void embed_surface(
327323 if (polygon_face.size () == 3 ) {
328324 // already a triangle
329325 std::array<size_t , 3 > triangle_face = {
330- polygon_face[0 ],
331- polygon_face[1 ],
332- polygon_face[2 ]};
326+ {polygon_face[0 ], polygon_face[1 ], polygon_face[2 ]}};
333327 int idx = triangulated_faces.size ();
334328 triangulated_faces.push_back (triangle_face);
335329 if (polygon_faces_on_input_surface[i]) {
@@ -348,9 +342,9 @@ void embed_surface(
348342 for (int j = 0 ; j < clipped_indices.size (); j++) {
349343 // need to map oldface index to new face indices
350344 std::array<size_t , 3 > triangle_face = {
351- polygon_face[clipped_indices[j][0 ]],
352- polygon_face[clipped_indices[j][1 ]],
353- polygon_face[clipped_indices[j][2 ]]};
345+ { polygon_face[clipped_indices[j][0 ]],
346+ polygon_face[clipped_indices[j][1 ]],
347+ polygon_face[clipped_indices[j][2 ]]} };
354348 int idx = triangulated_faces.size ();
355349 triangulated_faces.push_back (triangle_face);
356350
@@ -404,14 +398,14 @@ void embed_surface(
404398 }
405399 }
406400
407- std::array<size_t , 4 > tetra = {v0, v1, v2, v3};
401+ std::array<size_t , 4 > tetra = {{ v0, v1, v2, v3} };
408402
409403 // if inverted then fix the orientation
410404 Vector3r v0v1 = v_rational[v1] - v_rational[v0];
411405 Vector3r v0v2 = v_rational[v2] - v_rational[v0];
412406 Vector3r v0v3 = v_rational[v3] - v_rational[v0];
413407 if ((v0v1.cross (v0v2)).dot (v0v3) < 0 ) {
414- tetra = {v1, v0, v2, v3};
408+ tetra = {{ v1, v0, v2, v3} };
415409 }
416410
417411 // push the tet to final queue;
@@ -467,20 +461,20 @@ void embed_surface(
467461 for (const size_t f : polygon_cell) {
468462 for (const size_t t : map_poly_to_tri_face[f]) {
469463 std::array<size_t , 4 > tetra = {
470- triangulated_faces[t][0 ],
471- triangulated_faces[t][1 ],
472- triangulated_faces[t][2 ],
473- centroid_idx};
464+ { triangulated_faces[t][0 ],
465+ triangulated_faces[t][1 ],
466+ triangulated_faces[t][2 ],
467+ centroid_idx} };
474468 // check inverted tet and fix
475469 Vector3r v0v1 = v_rational[tetra[1 ]] - v_rational[tetra[0 ]];
476470 Vector3r v0v2 = v_rational[tetra[2 ]] - v_rational[tetra[0 ]];
477471 Vector3r v0v3 = v_rational[tetra[3 ]] - v_rational[tetra[0 ]];
478472 if ((v0v1.cross (v0v2)).dot (v0v3) < 0 ) {
479473 tetra = {
480- triangulated_faces[t][1 ],
481- triangulated_faces[t][0 ],
482- triangulated_faces[t][2 ],
483- centroid_idx};
474+ { triangulated_faces[t][1 ],
475+ triangulated_faces[t][0 ],
476+ triangulated_faces[t][2 ],
477+ centroid_idx} };
484478 }
485479
486480 tets_final.push_back (tetra);
@@ -605,9 +599,7 @@ EmbedSurface::EmbedSurface(
605599
606600 std::vector<Eigen::Vector3d> verts;
607601 std::vector<std::array<size_t , 3 >> tris;
608- verts.resize (V.rows ());
609- tris.resize (F.rows ());
610- wmtk::eigen_to_wmtk_input (verts, tris, V, F);
602+ VF_to_vectors (V, F, verts, tris);
611603
612604 V_surf_from_vector (verts);
613605 F_surf_from_vector (tris);
0 commit comments