Lagrange
Subdivision Module

Subdivision surfaces. More...

Classes

class  InterpolatedAttributes
 Helper class to select which attributes to interpolate. More...
 
struct  SubdivisionOptions
 Mesh subdivision options. More...
 

Enumerations

enum class  SchemeType { Bilinear , CatmullClark , Loop }
 Subdivision scheme. More...
 
enum class  VertexBoundaryInterpolation { None , EdgeOnly , EdgeAndCorner }
 Boundary Interpolation Rules. More...
 
enum class  FaceVaryingInterpolation {
  None , CornersOnly , CornersPlus1 , CornersPlus2 ,
  Boundaries , All
}
 Face-varying Interpolation Rules. More...
 
enum class  RefinementType { Uniform , EdgeAdaptive }
 Topology refinement method. More...
 

Functions

template<typename Scalar , typename Index >
SurfaceMesh< Scalar, Index > subdivide_mesh (const SurfaceMesh< Scalar, Index > &mesh, const SubdivisionOptions &options={})
 Evaluates the subdivision surface of a polygonal mesh. More...
 
template<typename Scalar , typename Index >
SurfaceMesh< Scalar, Index > midpoint_subdivision (const SurfaceMesh< Scalar, Index > &mesh)
 Performs one step of midpoint subdivision for triangle meshes. More...
 
template<typename Scalar , typename Index >
SurfaceMesh< Scalar, Index > sqrt_subdivision (const SurfaceMesh< Scalar, Index > &mesh)
 Performs one step of sqrt(3)-subdivision. More...
 

Detailed Description

Subdivision surfaces.

Enumeration Type Documentation

◆ SchemeType

enum class SchemeType
strong

#include <lagrange/subdivision/mesh_subdivision.h>

Subdivision scheme.

Enumerator
CatmullClark 

Bilinear subdivision scheme.

Useful to subdivide a mesh prior to applying a displacement map. Catmull-Clark is more widely used and suited to quad-dominant meshes.

Loop 

Loop is preferred for (and requires) purely triangulated meshes.

◆ VertexBoundaryInterpolation

enum class VertexBoundaryInterpolation
strong

#include <lagrange/subdivision/mesh_subdivision.h>

Boundary Interpolation Rules.

Boundary interpolation rules control how subdivision and the limit surface behave for faces adjacent to boundary edges and vertices.

Enumerator
None 

No boundary edge interpolation is applied by default; boundary faces are tagged as holes so that the boundary vertices continue to support the adjacent interior faces, but no surface corresponding to the boundary faces is generated; boundary faces can be selectively interpolated by sharpening all boundary edges incident the vertices of the face.

EdgeOnly 

A sequence of boundary vertices defines a smooth curve to which the limit surface along boundary faces extends.

EdgeAndCorner 

Similar to edge-only but the smooth curve resulting on the boundary is made to interpolate corner vertices (vertices with exactly one incident face)

◆ FaceVaryingInterpolation

enum class FaceVaryingInterpolation
strong

#include <lagrange/subdivision/mesh_subdivision.h>

Face-varying Interpolation Rules.

Face-varying interpolation rules control how face-varying data is interpolated both in the interior of face-varying regions (smooth or linear) and at the boundaries where it is discontinuous (constrained to be linear or "pinned" in a number of ways). Where the topology is continuous and the interpolation chosen to be smooth, the behavior of face-varying interpolation will match that of the vertex interpolation.

Enumerator
None 

Smooth everywhere the mesh is smooth.

CornersOnly 

Linearly interpolate (sharpen or pin) corners only.

CornersPlus1 

CornersOnly + sharpening of junctions of 3 or more regions.

CornersPlus2 

CornersPlus2 + sharpening of darts and concave corners.

Boundaries 

Linear interpolation along all boundary edges and corners.

All 

Linear interpolation everywhere (boundaries and interior)

◆ RefinementType

enum class RefinementType
strong

#include <lagrange/subdivision/mesh_subdivision.h>

Topology refinement method.

Enumerator
Uniform 

Each facet is subdivided a fixed number of time.

EdgeAdaptive 

Each facet is subdivided adaptively according to the mesh curvature.

Highly curved regions will be refined more. Best suited for rendering applications. Each facet is tessellated based on a target edge length and max subdiv level. Best suited to produce meshes with a uniform edge length when the input mesh has varying facet sizes.

Function Documentation

◆ subdivide_mesh()

SurfaceMesh< Scalar, Index > subdivide_mesh ( const SurfaceMesh< Scalar, Index > &  mesh,
const SubdivisionOptions options = {} 
)

#include <lagrange/subdivision/mesh_subdivision.h>

Evaluates the subdivision surface of a polygonal mesh.

Parameters
[in]meshInput mesh to subdivide.
[in]optionsSubdivision options.
Template Parameters
ScalarMesh scalar type.
IndexMesh index type.
Returns
Subdivided mesh.

◆ midpoint_subdivision()

SurfaceMesh< Scalar, Index > midpoint_subdivision ( const SurfaceMesh< Scalar, Index > &  mesh)

#include <lagrange/subdivision/midpoint_subdivision.h>

Performs one step of midpoint subdivision for triangle meshes.

Note
This function currently does not remap any mesh attribute.
Parameters
[in,out]meshInput mesh to subdivide.
Template Parameters
ScalarMesh scalar type.
IndexMesh index type.
Returns
Subdivided mesh.

◆ sqrt_subdivision()

SurfaceMesh< Scalar, Index > sqrt_subdivision ( const SurfaceMesh< Scalar, Index > &  mesh)

#include <lagrange/subdivision/sqrt_subdivision.h>

Performs one step of sqrt(3)-subdivision.

Implementation based on:

Kobbelt, Leif. "√3-subdivision." Proceedings of the 27th annual conference on Computer graphics and interactive techniques. 2000. https://doi.org/10.1145/344779.344835

Note
This function currently does not remap any mesh attribute.
Parameters
[in]meshInput mesh to subdivide. Only triangle meshes are supported.
Template Parameters
ScalarMesh scalar type.
IndexMesh index type.
Returns
Subdivided mesh.