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.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
OpenSubdiv::v3_4_3::Sdc::Crease Class Reference

Types, constants and utilities related to semi-sharp creasing – whose implementation is independent of the subdivision scheme. More...

#include <crease.h>

Public Types

enum  Rule
 Enum for the types of subdivision rules applied based on sharpness values (note these correspond to Hbr's vertex "mask"). The values are assigned to bit positions as it is useful to use bitwise operations to inspect collections of vertices (i.e. all of the vertices incident a particular face). More...
 

Public Member Functions

float ComputeFractionalWeightAtVertex (float vertexSharpness, float childVertexSharpness, int incidentEdgeCount, float const *incidentEdgeSharpness, float const *childEdgesSharpness) const
 Transitional weighting: When the rules applicable to a parent vertex and its child differ, one or more sharpness values has "decayed" to zero. Both rules are then applicable and blended by a weight between 0 and 1 that reflects the transition. Most often this will be a single sharpness value that decays from within the interval [0,1] to zero – and the weight to apply is exactly that sharpness value – but more than one may decay, and values > 1 may also decay to 0 in a single step while others within [0,1] may remain > 0. So to properly determine a transitional weight, sharpness values for both the parent and child must be inspected, combined and clamped accordingly. More...
 
float SharpenBoundaryEdge (float edgeSharpness) const
 Optional sharp features: Since options treat certain topological features as infinitely sharp – boundaries or (in future) non-manifold features – sharpness values should be adjusted before use. The following methods will adjust (by return) specific values according to the options applied. More...
 
float SharpenBoundaryVertex (float edgeSharpness) const
 Optional sharp features: Since options treat certain topological features as infinitely sharp – boundaries or (in future) non-manifold features – sharpness values should be adjusted before use. The following methods will adjust (by return) specific values according to the options applied. More...
 
float SubdivideUniformSharpness (float vertexOrEdgeSharpness) const
 Sharpness subdivision: The computation of a Uniform subdivided sharpness value is as follows: More...
 
float SubdivideVertexSharpness (float vertexSharpness) const
 Sharpness subdivision: The computation of a Uniform subdivided sharpness value is as follows: More...
 
float SubdivideEdgeSharpnessAtVertex (float edgeSharpness, int incidentEdgeCountAtEndVertex, float const *edgeSharpnessAroundEndVertex) const
 Sharpness subdivision: The computation of a Uniform subdivided sharpness value is as follows: More...
 
void SubdivideEdgeSharpnessesAroundVertex (int incidentEdgeCountAtVertex, float const *incidentEdgeSharpnessAroundVertex, float *childEdgesSharpnessAroundVertex) const
 Sharpness subdivision: The computation of a Uniform subdivided sharpness value is as follows: More...
 
Rule DetermineVertexVertexRule (float vertexSharpness, int incidentEdgeCount, float const *incidentEdgeSharpness) const
 Rule determination: Mask queries do not require the Rule to be known, it can be determined from the information provided, but it is generally more efficient when the Rule is known and provided. In particular, the Smooth case dominates and is known to be applicable based on the origin of the vertex without inspection of sharpness. More...
 
Rule DetermineVertexVertexRule (float vertexSharpness, int sharpEdgeCount) const
 Rule determination: Mask queries do not require the Rule to be known, it can be determined from the information provided, but it is generally more efficient when the Rule is known and provided. In particular, the Smooth case dominates and is known to be applicable based on the origin of the vertex without inspection of sharpness. More...
 
static float const SHARPNESS_SMOOTH = 0.0f
 Constants and related queries of sharpness values: More...
 
static float const SHARPNESS_INFINITE = 10.0f
 Constants and related queries of sharpness values: More...
 
static bool IsSmooth (float sharpness)
 Constants and related queries of sharpness values: More...
 
static bool IsSharp (float sharpness)
 Constants and related queries of sharpness values: More...
 
static bool IsInfinite (float sharpness)
 Constants and related queries of sharpness values: More...
 
static bool IsSemiSharp (float sharpness)
 Constants and related queries of sharpness values: More...
 

Detailed Description

Types, constants and utilities related to semi-sharp creasing – whose implementation is independent of the subdivision scheme.

Crease is intended to be a light-weight, trivially constructed class that computes crease-related properties – typically sharpness values and associated interpolation weights. An instance of Crease is defined with a set of options that include current and future variations that will impact computations involving sharpness values.

The Crease methods do not use topological neighborhoods as input. The methods here rely more on the sharpness values and less on the topology, so we choose to work directly with the sharpness values. We also follow the trend of using primitive arrays in the interface to encourage local gathering for re-use.

Note on the need for and use of sharpness values: In general, mask queries rely on the sharpness values. The common case of a smooth vertex, when known, avoids the need to inspect them, but unless the rules are well understood, users will be expected to provided them – particularly when they expect the mask queries to do all of the work (just determining if a vertex is smooth will require inspection of incident edge sharpness). Mask queries will occasionally require the subdivided sharpness values around the child vertex. So users will be expected to either provide them up front when known, or to be gathered on demand. Any implementation of subdivision with creasing cannot avoid subdividing the sharpness values first, so keeping them available for re-use is a worthwhile consideration.

Member Enumeration Documentation

Enum for the types of subdivision rules applied based on sharpness values (note these correspond to Hbr's vertex "mask"). The values are assigned to bit positions as it is useful to use bitwise operations to inspect collections of vertices (i.e. all of the vertices incident a particular face).

Member Function Documentation

float OpenSubdiv::v3_4_3::Sdc::Crease::ComputeFractionalWeightAtVertex ( float  vertexSharpness,
float  childVertexSharpness,
int  incidentEdgeCount,
float const *  incidentEdgeSharpness,
float const *  childEdgesSharpness 
) const

Transitional weighting: When the rules applicable to a parent vertex and its child differ, one or more sharpness values has "decayed" to zero. Both rules are then applicable and blended by a weight between 0 and 1 that reflects the transition. Most often this will be a single sharpness value that decays from within the interval [0,1] to zero – and the weight to apply is exactly that sharpness value – but more than one may decay, and values > 1 may also decay to 0 in a single step while others within [0,1] may remain > 0. So to properly determine a transitional weight, sharpness values for both the parent and child must be inspected, combined and clamped accordingly.

Referenced by OpenSubdiv::v3_4_3::Sdc::Scheme< SCHEME_TYPE >::ComputeVertexVertexMask().

Crease::Rule OpenSubdiv::v3_4_3::Sdc::Crease::DetermineVertexVertexRule ( float  vertexSharpness,
int  incidentEdgeCount,
float const *  incidentEdgeSharpness 
) const

Rule determination: Mask queries do not require the Rule to be known, it can be determined from the information provided, but it is generally more efficient when the Rule is known and provided. In particular, the Smooth case dominates and is known to be applicable based on the origin of the vertex without inspection of sharpness.

Referenced by OpenSubdiv::v3_4_3::Sdc::Scheme< SCHEME_TYPE >::ComputeVertexVertexMask().

Crease::Rule OpenSubdiv::v3_4_3::Sdc::Crease::DetermineVertexVertexRule ( float  vertexSharpness,
int  sharpEdgeCount 
) const

Rule determination: Mask queries do not require the Rule to be known, it can be determined from the information provided, but it is generally more efficient when the Rule is known and provided. In particular, the Smooth case dominates and is known to be applicable based on the origin of the vertex without inspection of sharpness.

static bool OpenSubdiv::v3_4_3::Sdc::Crease::IsInfinite ( float  sharpness)
inlinestatic

Constants and related queries of sharpness values:

static bool OpenSubdiv::v3_4_3::Sdc::Crease::IsSemiSharp ( float  sharpness)
inlinestatic

Constants and related queries of sharpness values:

static bool OpenSubdiv::v3_4_3::Sdc::Crease::IsSharp ( float  sharpness)
inlinestatic

Constants and related queries of sharpness values:

static bool OpenSubdiv::v3_4_3::Sdc::Crease::IsSmooth ( float  sharpness)
inlinestatic

Constants and related queries of sharpness values:

float OpenSubdiv::v3_4_3::Sdc::Crease::SharpenBoundaryEdge ( float  edgeSharpness) const
inline

Optional sharp features: Since options treat certain topological features as infinitely sharp – boundaries or (in future) non-manifold features – sharpness values should be adjusted before use. The following methods will adjust (by return) specific values according to the options applied.

float OpenSubdiv::v3_4_3::Sdc::Crease::SharpenBoundaryVertex ( float  edgeSharpness) const
inline

Optional sharp features: Since options treat certain topological features as infinitely sharp – boundaries or (in future) non-manifold features – sharpness values should be adjusted before use. The following methods will adjust (by return) specific values according to the options applied.

float OpenSubdiv::v3_4_3::Sdc::Crease::SubdivideEdgeSharpnessAtVertex ( float  edgeSharpness,
int  incidentEdgeCountAtEndVertex,
float const *  edgeSharpnessAroundEndVertex 
) const

Sharpness subdivision: The computation of a Uniform subdivided sharpness value is as follows:

  - Smooth edges or verts stay Smooth
  - Sharp edges or verts stay Sharp
  - semi-sharp edges or verts are decremented by 1.0

but for Chaikin (and potentially future non-uniform schemes that improve upon it) the computation is more involved. In the case of edges in particular, the sharpness of a child edge is determined by the sharpness in the neighborhood of the end vertex corresponding to the child. For this reason, an alternative to subdividing sharpness that computes all child edges around a vertex is given.

void OpenSubdiv::v3_4_3::Sdc::Crease::SubdivideEdgeSharpnessesAroundVertex ( int  incidentEdgeCountAtVertex,
float const *  incidentEdgeSharpnessAroundVertex,
float *  childEdgesSharpnessAroundVertex 
) const

Sharpness subdivision: The computation of a Uniform subdivided sharpness value is as follows:

  - Smooth edges or verts stay Smooth
  - Sharp edges or verts stay Sharp
  - semi-sharp edges or verts are decremented by 1.0

but for Chaikin (and potentially future non-uniform schemes that improve upon it) the computation is more involved. In the case of edges in particular, the sharpness of a child edge is determined by the sharpness in the neighborhood of the end vertex corresponding to the child. For this reason, an alternative to subdividing sharpness that computes all child edges around a vertex is given.

float OpenSubdiv::v3_4_3::Sdc::Crease::SubdivideUniformSharpness ( float  vertexOrEdgeSharpness) const
inline

Sharpness subdivision: The computation of a Uniform subdivided sharpness value is as follows:

  - Smooth edges or verts stay Smooth
  - Sharp edges or verts stay Sharp
  - semi-sharp edges or verts are decremented by 1.0

but for Chaikin (and potentially future non-uniform schemes that improve upon it) the computation is more involved. In the case of edges in particular, the sharpness of a child edge is determined by the sharpness in the neighborhood of the end vertex corresponding to the child. For this reason, an alternative to subdividing sharpness that computes all child edges around a vertex is given.

float OpenSubdiv::v3_4_3::Sdc::Crease::SubdivideVertexSharpness ( float  vertexSharpness) const
inline

Sharpness subdivision: The computation of a Uniform subdivided sharpness value is as follows:

  - Smooth edges or verts stay Smooth
  - Sharp edges or verts stay Sharp
  - semi-sharp edges or verts are decremented by 1.0

but for Chaikin (and potentially future non-uniform schemes that improve upon it) the computation is more involved. In the case of edges in particular, the sharpness of a child edge is determined by the sharpness in the neighborhood of the end vertex corresponding to the child. For this reason, an alternative to subdividing sharpness that computes all child edges around a vertex is given.

Member Data Documentation

float const OpenSubdiv::v3_4_3::Sdc::Crease::SHARPNESS_INFINITE = 10.0f
static

Constants and related queries of sharpness values:

float const OpenSubdiv::v3_4_3::Sdc::Crease::SHARPNESS_SMOOTH = 0.0f
static

Constants and related queries of sharpness values:


The documentation for this class was generated from the following files: