diff --git a/opensubdiv/far/meshFactory.h b/opensubdiv/far/meshFactory.h index 5982efda..12c66922 100644 --- a/opensubdiv/far/meshFactory.h +++ b/opensubdiv/far/meshFactory.h @@ -374,20 +374,26 @@ FarMeshFactory::vertexIsBSpline( HbrVertex * v, bool next ) { // corner vertex HbrFace * f = v->GetFace(); + // the vertex may not need isolation depending on boundary + // interpolation rule (sharp vs. rounded corner) typename HbrMesh::InterpolateBoundaryMethod method = f->GetMesh()->GetInterpolateBoundaryMethod(); if (method==HbrMesh::k_InterpolateBoundaryEdgeAndCorner) { - // vertex may not need isolation depending on boundary - // interpolation rule (sharp vs. rounded corner) - int nsharpboundaries=0; - for (int i=0; iGetNumVertices(); ++i) { - HbrHalfedge * e = f->GetEdge(i); - if (e->IsBoundary() and - e->GetSharpness()==HbrHalfedge::k_InfinitelySharp) { - ++nsharpboundaries; + if (not next) { + // if we are checking coarse vertices (next==false), + // count the number of corners in the face, because we + // can only have 1 corner vertex in a corner patch. + int nsharpboundaries=0; + for (int i=0; iGetNumVertices(); ++i) { + HbrHalfedge * e = f->GetEdge(i); + if (e->IsBoundary() and + e->GetSharpness()==HbrHalfedge::k_InfinitelySharp) { + ++nsharpboundaries; + } } - } - return next; + return nsharpboundaries < 3 ? true: false; + } else + return true; } else return false; } else if (valence>3) { @@ -501,7 +507,7 @@ FarMeshFactory::refineAdaptive( HbrMesh * mesh, int maxIsolate ) { // for refinement as boundary patches. // // o ........ o ........ o ........ o - // . | | . ... b.undary edge + // . | | . ... boundary edge // . | needs | . // . | flag | . --- regular edge // . | | .