@@ -239,7 +239,6 @@ void Mesh::construct() {
239239 if (he->rev_ == nullptr ) {
240240 auto face = new Face ();
241241 addFace (face);
242- face->isBoundary_ = true ;
243242
244243 std::vector<Halfedge *> boundaryHalfedges;
245244 Halfedge *it = he.get ();
@@ -273,6 +272,7 @@ void Mesh::construct() {
273272 const auto degree = static_cast <int >(boundaryHalfedges.size ());
274273 for (int j = 0 ; j < degree; j++) {
275274 const int k = (j - 1 + degree) % degree;
275+ boundaryHalfedges[j]->src_ ->isBoundary_ = true ;
276276 boundaryHalfedges[j]->next_ = boundaryHalfedges[k];
277277 }
278278 }
@@ -289,13 +289,10 @@ void Mesh::construct() {
289289 FatalError (" Some vertices are not referenced by any polygon!" );
290290 }
291291
292- uint32_t count = 0 ;
292+ uint32_t count = v-> isBoundary () ? - 1 : 0 ;
293293 Halfedge *he = v->halfedge_ ;
294294 do {
295- if (!he->face ()->isBoundary ()) {
296- count += 1 ;
297- }
298-
295+ count += 1 ;
299296 he = he->rev ()->next ();
300297 } while (he != v->halfedge_ );
301298
@@ -897,7 +894,6 @@ bool Mesh::triangulate(Face *face, double dihedralBound) {
897894 * Different from them, the triangularion is performed when the dihedral
898895 * angle in resulting triangularion is less than "dihedralBound".
899896 */
900-
901897 using E = IndexPair;
902898 using T = std::tuple<uint32_t , uint32_t , uint32_t >;
903899
@@ -1097,6 +1093,7 @@ bool Mesh::triangulate(Face *face, double dihedralBound) {
10971093 }
10981094 }
10991095
1096+ he->src_ ->isBoundary_ = false ;
11001097 he = he->next_ ;
11011098 } while (he != f->halfedge_ );
11021099 }
0 commit comments