A few bug fixes and minor improvements for inf-sharp patches:

- updated face-varying VTag conversion to set VTag::_corner correctly
    - updated adaptive refinement to prevent over-isolation of inf-sharp features
    - fixed patch regularity test when inf-sharp and xord features not separated
      at level 0 or 1
    - generalized BSpline end-cap factory boundary test to defer to Gregory patch
      for any non-smooth corner
This commit is contained in:
barry 2016-09-26 19:14:42 -07:00
parent de3a781537
commit 9832e11939
4 changed files with 24 additions and 7 deletions

View File

@ -101,7 +101,7 @@ EndCapBSplineBasisPatchFactory::GetPatchPoints(
for (int corner = 0; (corner < 4) && !useGregoryPatch; ++corner) {
Vtr::internal::Level::VTag vtag = level->getVertexTag(facePoints[corner]);
if (vtag._boundary || cornerSpans[corner].isAssigned()) {
if ((vtag._rule != Sdc::Crease::RULE_SMOOTH) || cornerSpans[corner].isAssigned()) {
useGregoryPatch = true;
}
if (vtag._xordinary) {

View File

@ -601,6 +601,18 @@ PatchTableFactory::BuilderContext::IsPatchRegular(
}
}
}
// When inf-sharp and extra-ordinary features are not isolated, need to inspect more
// closely -- any smooth extra-ordinary corner makes the patch irregular:
if (fCompVTag._xordinary && (levelIndex < 2)) {
Level::VTag vTags[4];
level.getFaceVTags(faceIndex, vTags, fvcRefiner);
for (int i = 0; i < 4; ++i) {
if (vTags[i]._xordinary && (vTags[i]._rule == Sdc::Crease::RULE_SMOOTH)) {
isRegular = false;
}
}
}
}
// Legacy option -- reinterpret a smooth corner as sharp if specified:
@ -713,12 +725,15 @@ PatchTableFactory::BuilderContext::GetIrregularPatchCornerSpans(
if (noFVarMisMatch && !testInfSharp) {
cornerSpans[i].clear();
} else if (!vTags[i]._nonManifold) {
identifyManifoldCornerSpan(
level, faceIndex, i, singularEdgeMask, cornerSpans[i], fvcRefiner);
} else {
identifyNonManifoldCornerSpan(
level, faceIndex, i, singularEdgeMask, cornerSpans[i], fvcRefiner);
if (!vTags[i]._nonManifold) {
identifyManifoldCornerSpan(
level, faceIndex, i, singularEdgeMask, cornerSpans[i], fvcRefiner);
} else {
identifyNonManifoldCornerSpan(
level, faceIndex, i, singularEdgeMask, cornerSpans[i], fvcRefiner);
}
cornerSpans[i]._sharp = testInfSharp && (vTags[i]._rule == Sdc::Crease::RULE_CORNER);
}
}
}

View File

@ -322,7 +322,7 @@ namespace internal {
selectSemiSharpNonSingle = true;
// Inf-sharp features -- boundary extra-ordinary vertices are irreg creases:
selectInfSharpRegularCrease = !useSingleCreasePatch;
selectInfSharpRegularCrease = !(options_reduceInfSharpPatches || useSingleCreasePatch);
selectInfSharpRegularCorner = !options_reduceInfSharpPatches;
selectInfSharpIrregularDart = true;
selectInfSharpIrregularCrease = true;

View File

@ -391,10 +391,12 @@ FVarLevel::ValueTag::combineWithLevelVTag(Level::VTag levelTag) const
levelTag._rule = (Level::VTag::VTagSize) Sdc::Crease::RULE_CORNER;
levelTag._infSharp = true;
levelTag._infSharpCrease = false;
levelTag._corner = !this->_infIrregular && !this->_infSharpEdges;
} else {
levelTag._rule = (Level::VTag::VTagSize) Sdc::Crease::RULE_CREASE;
levelTag._infSharp = false;
levelTag._infSharpCrease = true;
levelTag._corner = false;
}
levelTag._infSharpEdges = true;
levelTag._infIrregular = this->_infIrregular;