3DCoat
3D-COAT 4.9.xx
3DCoat is the one application that has all the tools you need to take your 3D idea from a block of digital clay all the way to a production ready, fully textured organic or hard surface model.
|
Scheme is a class template which provides all implementation for the subdivision schemes supported by OpenSubdiv through specializations of the methods of each. An instance of Scheme<SCHEME_TYPE> includes a set of Options that will dictate the variable aspects of its behavior. More...
#include <scheme.h>
Public Member Functions | |
template<typename FACE , typename MASK > | |
void | ComputeFaceVertexMask (FACE const &faceNeighborhood, MASK &faceVertexMask) const |
Face-vertex masks - trivial for all current schemes. More... | |
template<typename EDGE , typename MASK > | |
void | ComputeEdgeVertexMask (EDGE const &edgeNeighborhood, MASK &edgeVertexMask, Crease::Rule parentRule=Crease::RULE_UNKNOWN, Crease::Rule childRule=Crease::RULE_UNKNOWN) const |
Edge-vertex masks If known, the Rule for the edge and/or the derived vertex can be specified to accelerate the computation (though the Rule for the parent is trivially determined). In particular, knowing the child rule can avoid the need to subdivide the sharpness of the edge to see if it is a transitional crease that warrants fractional blending. More... | |
template<typename VERTEX , typename MASK > | |
void | ComputeVertexVertexMask (VERTEX const &vertexNeighborhood, MASK &vertexVertexMask, Crease::Rule parentRule=Crease::RULE_UNKNOWN, Crease::Rule childRule=Crease::RULE_UNKNOWN) const |
Vertex-vertex masks If known, a single Rule or pair of Rules can be specified (indicating a crease transition) to accelerate the computation. Either no Rules, the first, or both should be specified. Specification of only the first Rule implies it to be true for both (wish the compiler would allow such default value specification), i.e. no transition. The case of knowing the parent Rule but deferring determination of the child Rule to this method is not supported. More... | |
template<typename VERTEX , typename MASK > | |
void | ComputeVertexLimitMask (VERTEX const &vertexNeighborhood, MASK &positionMask, Crease::Rule vertexRule) const |
Limit masks for vertices – position and tangents These presume that a vertex is suitably isolated for its limit to be well-defined and, unlike the refinement masks, the subdivision Rule for the vertex (presumably at its last level of refinement) is required rather than being optional. In the presence of semi-sharp creasing that has not decayed to zero, the limit is neither sharp nor smooth – in such cases the Rule specified by the caller determines the result. More... | |
Scheme is a class template which provides all implementation for the subdivision schemes supported by OpenSubdiv through specializations of the methods of each. An instance of Scheme<SCHEME_TYPE> includes a set of Options that will dictate the variable aspects of its behavior.
The primary purpose of Scheme is to provide the mask weights for vertices generated by subdivision. Methods to determine the masks are given topological neighborhoods from which to compute the appropriate weights for neighboring components. While these neighborhoods may require sharpness values for creasing, the computation of subdivided crease values is independent of the scheme type and is also made available through the Crease class.
Mask queries are assisted by two utility classes – a Neighborhood class defining the set of relevant data in the topological neighborhood of the vertex being subdivided, and a Mask class into which the associated mask weights will be stored. Depending on where and how these queries are used, more or less information may be available. See the details of the Neighborhood classes as appropriate initialization of them is critical. It is generally best to initialize them with what data is known and accessible for immediate and efficient retrieval, but subclasses can be created to gather it lazily if desired.
void OpenSubdiv::v3_4_3::Sdc::Scheme< SCHEME >::ComputeEdgeVertexMask | ( | EDGE const & | edgeNeighborhood, |
MASK & | edgeVertexMask, | ||
Crease::Rule | parentRule = Crease::RULE_UNKNOWN , |
||
Crease::Rule | childRule = Crease::RULE_UNKNOWN |
||
) | const |
Edge-vertex masks If known, the Rule for the edge and/or the derived vertex can be specified to accelerate the computation (though the Rule for the parent is trivially determined). In particular, knowing the child rule can avoid the need to subdivide the sharpness of the edge to see if it is a transitional crease that warrants fractional blending.
Whether to use the "Rules" in this interface is really debatable – the parent Rule is really based on the edge and its sharpness, while the child Rule is technically based on the neighborhood of the child vertex, but it can be deduced from the two child edges' sharpness. So the Crease methods used to compute these rules differ from those for the vertex-vertex mask. Perhaps a simple pair of new methods for Crease should be added specific to the edge-vertex case, i.e. one that takes a single sharpness (for the parent rule) and one that takes a pair (for the child).
void OpenSubdiv::v3_4_3::Sdc::Scheme< SCHEME >::ComputeFaceVertexMask | ( | FACE const & | faceNeighborhood, |
MASK & | faceVertexMask | ||
) | const |
Face-vertex masks - trivial for all current schemes.
void OpenSubdiv::v3_4_3::Sdc::Scheme< SCHEME >::ComputeVertexLimitMask | ( | VERTEX const & | vertexNeighborhood, |
MASK & | positionMask, | ||
Crease::Rule | vertexRule | ||
) | const |
Limit masks for vertices – position and tangents These presume that a vertex is suitably isolated for its limit to be well-defined and, unlike the refinement masks, the subdivision Rule for the vertex (presumably at its last level of refinement) is required rather than being optional. In the presence of semi-sharp creasing that has not decayed to zero, the limit is neither sharp nor smooth – in such cases the Rule specified by the caller determines the result.
For tangent masks, the direction of the first tangent (T1) is oriented towards the leading edge of the vertex, i.e. the first incident edge of the vertex (beginning the set of incident edges in counter-clockwise order). The second tangent (T2) lies within the tangent plane such that its normal can be computed as T1 x T2. So for a boundary vertex, T1 will point along the boundary in the direction of the leading edge while T2 points inward across the limit surface.
As for magnitude, no assumptions should be made of the magnitudes of the resulting tangent vectors. Common formulae often factor out scale factors that contribute to magnitude. While some attempt has been made to make magnitudes more consistent between regular corners, boundaries and the interior, the same has not been done at irregular vertices – at least not yet. This may be addressed in future, as having consistent magnitudes returned here can aid in the construction of patches from limit positions and tangents.
void OpenSubdiv::v3_4_3::Sdc::Scheme< SCHEME >::ComputeVertexVertexMask | ( | VERTEX const & | vertexNeighborhood, |
MASK & | vertexVertexMask, | ||
Crease::Rule | parentRule = Crease::RULE_UNKNOWN , |
||
Crease::Rule | childRule = Crease::RULE_UNKNOWN |
||
) | const |
Vertex-vertex masks If known, a single Rule or pair of Rules can be specified (indicating a crease transition) to accelerate the computation. Either no Rules, the first, or both should be specified. Specification of only the first Rule implies it to be true for both (wish the compiler would allow such default value specification), i.e. no transition. The case of knowing the parent Rule but deferring determination of the child Rule to this method is not supported.
References OpenSubdiv::v3_4_3::Sdc::Crease::ComputeFractionalWeightAtVertex(), and OpenSubdiv::v3_4_3::Sdc::Crease::DetermineVertexVertexRule().