Added new VTags for inf-sharp features:

- added new Vtr::Level::VTag members for inf-sharp features
    - updated Vtr::Level::print() to recognize new tags
    - explicitly initialized tags for new edge-verts in Vtr::Refinement
    - initialized tags for base level verts in Far::TopologyRefinerFactory
This commit is contained in:
barry 2016-07-20 16:16:52 -07:00
parent 1e625e690e
commit a9ecd79c32
4 changed files with 70 additions and 7 deletions

View File

@ -266,6 +266,56 @@ TopologyRefinerFactoryBase::prepareComponentTagsAndSharpness(TopologyRefiner& re
}
vTag._incomplete = 0;
//
// Assign tags specific to inf-sharp features to identify regular topologies
// partitioned by inf-sharp creases -- must be no semi-sharp features here
// (and manifold for now):
//
vTag._infSharpEdges = (infSharpEdgeCount > 0);
vTag._infSharpCrease = false;
vTag._infSharpCorners = false;
vTag._infIrregular = vTag._infSharp || vTag._infSharpEdges;
if (vTag._infSharpEdges) {
Sdc::Crease::Rule infRule = creasing.DetermineVertexVertexRule(vSharpness, infSharpEdgeCount);
if (infRule == Sdc::Crease::RULE_CREASE) {
vTag._infSharpCrease = true;
// A "regular" inf-crease can only occur along a manifold regular boundary
// or by bisecting a manifold interior region (it is also possible along
// non-manifold vertices in some cases, but that requires much more effort
// to detect -- perhaps later...)
//
if (!vTag._xordinary && !vTag._nonManifold) {
if (vTag._boundary) {
vTag._infIrregular = false;
} else {
assert((schemeRegularInteriorValence == 4) || (schemeRegularInteriorValence == 6));
if (schemeRegularInteriorValence == 4) {
vTag._infIrregular = (baseLevel.getEdgeTag(vEdges[0])._infSharp !=
baseLevel.getEdgeTag(vEdges[2])._infSharp);
} else if (schemeRegularInteriorValence == 6) {
vTag._infIrregular = (baseLevel.getEdgeTag(vEdges[0])._infSharp !=
baseLevel.getEdgeTag(vEdges[3])._infSharp) ||
(baseLevel.getEdgeTag(vEdges[1])._infSharp !=
baseLevel.getEdgeTag(vEdges[4])._infSharp);
}
}
}
} else if (infRule == Sdc::Crease::RULE_CORNER) {
vTag._infSharpCorners = true;
// A regular set of inf-corners occurs when all edges are sharp and not
// a smooth corner:
//
if ((infSharpEdgeCount == vEdges.size() && ((vEdges.size() > 2) || vTag._infSharp))) {
vTag._infIrregular = false;
}
}
}
//
// Having just decided if a vertex is on a boundary, and with its incident faces
// available, mark incident faces as holes.

View File

@ -531,13 +531,17 @@ Level::print(const Refinement* pRefinement) const {
for (int i = 0; printVertTags && i < (int)_vertTags.size(); ++i) {
VTag const& vTag = _vertTags[i];
printf(" vert %4d:", i);
printf(" rule = %s", ruleString((Sdc::Crease::Rule)vTag._rule));
printf(", boundary = %d", (int)vTag._boundary);
printf(", corner = %d", (int)vTag._corner);
printf(", xordinary = %d", (int)vTag._xordinary);
printf(", nonManifold = %d", (int)vTag._nonManifold);
printf(", infSharp = %d", (int)vTag._infSharp);
printf(", semiSharp = %d", (int)vTag._semiSharp);
printf(" rule = %s", ruleString((Sdc::Crease::Rule)vTag._rule));
printf(", boundary = %d", (int)vTag._boundary);
printf(", corner = %d", (int)vTag._corner);
printf(", xordinary = %d", (int)vTag._xordinary);
printf(", nonManifold = %d", (int)vTag._nonManifold);
printf(", infSharp = %d", (int)vTag._infSharp);
printf(", infSharpEdges = %d", (int)vTag._infSharpEdges);
printf(", infSharpCrease = %d", (int)vTag._infSharpCrease);
printf(", infSharpCorners = %d",(int)vTag._infSharpCorners);
printf(", infIrregular = %d", (int)vTag._infIrregular);
printf(", semiSharp = %d", (int)vTag._semiSharp);
printf(", semiSharpEdges = %d", (int)vTag._semiSharpEdges);
printf("\n");
}

View File

@ -114,6 +114,12 @@ public:
VTagSize _rule : 4; // variable when _semiSharp
VTagSize _incomplete : 1; // variable for sparse refinement
// Inf-sharp tags -- in development, some may not persist...
VTagSize _infSharpEdges : 1; // fixed
VTagSize _infSharpCrease : 1; // fixed
VTagSize _infSharpCorners : 1; // fixed
VTagSize _infIrregular : 1; // fixed
// On deck -- coming soon...
//VTagSize _constSharp : 1; // variable when _semiSharp
//VTagSize _hasEdits : 1; // variable

View File

@ -753,6 +753,9 @@ Refinement::populateVertexTagsFromParentEdges() {
vTag._nonManifold = pEdgeTag._nonManifold;
vTag._boundary = pEdgeTag._boundary;
vTag._semiSharpEdges = pEdgeTag._semiSharp;
vTag._infSharpEdges = pEdgeTag._infSharp;
vTag._infSharpCrease = pEdgeTag._infSharp;
vTag._infIrregular = pEdgeTag._infSharp && pEdgeTag._nonManifold;
vTag._rule = (Level::VTag::VTagSize)((pEdgeTag._semiSharp || pEdgeTag._infSharp)
? Sdc::Crease::RULE_CREASE : Sdc::Crease::RULE_SMOOTH);