From 51eb6a041c5442b8851299eabf99bebe3df83a42 Mon Sep 17 00:00:00 2001 From: Barry Fowler Date: Tue, 14 Mar 2023 19:02:04 -0700 Subject: [PATCH] Fix bug in Bfr::SurfaceFactory with valence-2 interior vertex: - fixed IrregularPatchBuilder to correctly assign boundary sharpness - modified test shape creating creased val-2 interior face on boundary --- opensubdiv/bfr/irregularPatchBuilder.cpp | 4 ++++ regression/shapes/catmark_val2_interior.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/opensubdiv/bfr/irregularPatchBuilder.cpp b/opensubdiv/bfr/irregularPatchBuilder.cpp index bfbd640b..74173bc9 100644 --- a/opensubdiv/bfr/irregularPatchBuilder.cpp +++ b/opensubdiv/bfr/irregularPatchBuilder.cpp @@ -768,6 +768,10 @@ IrregularPatchBuilder::sharpenBoundaryControlEdges( // sharp. And only boundary edges of the base face are sharpened // here -- it is not necessary to deal with others. // + // Append boundary edge sharpness to existing sharp edges: + edgeVertPairs += *numSharpEdges * 2; + edgeSharpness += *numSharpEdges; + int faceSize = _surface.GetFaceSize(); for (int corner = 0; corner < faceSize; ++corner) { diff --git a/regression/shapes/catmark_val2_interior.h b/regression/shapes/catmark_val2_interior.h index cabe680f..9ccb0db5 100644 --- a/regression/shapes/catmark_val2_interior.h +++ b/regression/shapes/catmark_val2_interior.h @@ -317,6 +317,10 @@ static const std::string catmark_val2_interior = "f 87/87 88/88 89/89 93/93 92/92 91/91\n" "f 94/94 92/92 93/93 89/89 88/88 90/90\n" "\n" +"t crease 2/1/0 87 88 5.0\n" +"t crease 2/1/0 88 92 5.0\n" +"t crease 2/1/0 92 91 5.0\n" +"\n" "#\n" "# Shape 9: bottom-right\n" "#\n"