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

Method get_cell_faces

tools/IGL/CellPartition.cpp:109–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109MatrixIr CellPartition::get_cell_faces(const size_t cell_id) const {
110 const size_t num_faces = m_faces.rows();
111 std::vector<VectorI> cell_faces;
112 for (size_t i=0; i<num_faces; i++) {
113 const size_t patch_id = m_patches[i];
114 if (m_cells(patch_id,0) == cell_id) {
115 cell_faces.push_back(m_faces.row(i).reverse());
116 } else if (m_cells(patch_id,1) == cell_id) {
117 cell_faces.push_back(m_faces.row(i));
118 }
119 }
120 MatrixIr faces = MatrixUtils::rowstack(cell_faces);
121 return faces;
122}
123
124size_t CellPartition::get_num_patches() const {
125 if (m_patches.size() > 0) return m_patches.maxCoeff();

Callers 1

partition_into_cellsFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected