MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / triangulate_bd_loops

Method triangulate_bd_loops

tools/Wires/Inflator/PeriodicBoundaryRemesher.cpp:511–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

509}
510
511void 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
540void PeriodicBoundaryRemesher::update_all_indices(const VectorI& vertex_map) {
541 update_indices(m_faces, vertex_map);

Callers

nothing calls this directly

Calls 2

triangulateFunction · 0.70
reorientate_trianglesFunction · 0.70

Tested by

no test coverage detected