| 509 | } |
| 510 | |
| 511 | void PeriodicBoundaryRemesher::triangulate_bd_loops(Float max_area, short axis, |
| 512 | std::vector<MatrixFr>& remeshed_vertices, |
| 513 | std::vector<MatrixIr>& remeshed_faces, |
| 514 | size_t& vertex_count, size_t& face_count) { |
| 515 | Vector3F offset(0.0, 0.0, 0.0); |
| 516 | offset[axis] = m_bbox_max[axis] - m_bbox_min[axis]; |
| 517 | Vector3F normal(0.0, 0.0, 0.0); |
| 518 | normal[axis] = -1.0; |
| 519 | const MatrixIr& min_loops = m_bd_loops[min_axis_marker[axis]]; |
| 520 | |
| 521 | MatrixFr output_vertices; |
| 522 | MatrixIr output_faces; |
| 523 | triangulate(m_vertices, min_loops, output_vertices, output_faces, max_area); |
| 524 | reorientate_triangles(output_vertices, output_faces, normal); |
| 525 | |
| 526 | // Add triangulated min boundary |
| 527 | remeshed_vertices.emplace_back(output_vertices); |
| 528 | remeshed_faces.emplace_back(output_faces.array() + vertex_count); |
| 529 | vertex_count += output_vertices.rows(); |
| 530 | face_count += output_faces.rows(); |
| 531 | |
| 532 | // Add triangulated max boundary |
| 533 | output_faces.col(2).swap(output_faces.col(1)); |
| 534 | remeshed_vertices.emplace_back(output_vertices.rowwise() + offset.transpose()); |
| 535 | remeshed_faces.emplace_back(output_faces.array() + vertex_count); |
| 536 | vertex_count += output_vertices.rows(); |
| 537 | face_count += output_faces.rows(); |
| 538 | } |
| 539 | |
| 540 | void PeriodicBoundaryRemesher::update_all_indices(const VectorI& vertex_map) { |
| 541 | update_indices(m_faces, vertex_map); |
nothing calls this directly
no test coverage detected