From 17218ce6fe400816376bfd48444baa2d35cf7dc4 Mon Sep 17 00:00:00 2001 From: barry Date: Tue, 14 May 2019 11:08:52 -0700 Subject: [PATCH] Fixed bug estimating Gregory face-point size for sharp corner patches --- opensubdiv/far/catmarkPatchBuilder.cpp | 2 ++ opensubdiv/far/loopPatchBuilder.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/opensubdiv/far/catmarkPatchBuilder.cpp b/opensubdiv/far/catmarkPatchBuilder.cpp index fc1b8815..eeb2d056 100644 --- a/opensubdiv/far/catmarkPatchBuilder.cpp +++ b/opensubdiv/far/catmarkPatchBuilder.cpp @@ -1251,6 +1251,8 @@ GregoryConverter::getIrregularFacePointSize( CornerTopology const & corner = _corners[cIndexNear]; CornerTopology const & adjCorner = _corners[cIndexFar]; + if (corner.isSharp && adjCorner.isSharp) return 2; + int thisSize = corner.isSharp ? 6 : (1 + corner.ringPoints.GetSize()); diff --git a/opensubdiv/far/loopPatchBuilder.cpp b/opensubdiv/far/loopPatchBuilder.cpp index ae10b910..20a8f96c 100644 --- a/opensubdiv/far/loopPatchBuilder.cpp +++ b/opensubdiv/far/loopPatchBuilder.cpp @@ -1281,6 +1281,8 @@ GregoryTriConverter::getIrregularFacePointSize( CornerTopology const & nearCorner = _corners[cIndexNear]; CornerTopology const & farCorner = _corners[cIndexFar]; + if (nearCorner.isSharp && farCorner.isSharp) return 2; + int nearSize = nearCorner.ringPoints.GetSize() - 3; int farSize = farCorner.ringPoints.GetSize() - 3;