Lagrange
SubdivisionOptions Struct Reference

Mesh subdivision options. More...

#include <lagrange/subdivision/mesh_subdivision.h>

Public Attributes

General Options
std::optional< SchemeTypescheme
 Subvision scheme. More...
 
unsigned num_levels = 1
 Number of subdivision level requested.
 
RefinementType refinement = RefinementType::Uniform
 How to refine the mesh topology.
 
Adaptive tessellation options
std::optional< float > max_edge_length
 Maximum edge length for adaptive tessellation. More...
 
Interpolation Rules
VertexBoundaryInterpolation vertex_boundary_interpolation
 Vertex boundary interpolation rule. More...
 
FaceVaryingInterpolation face_varying_interpolation = FaceVaryingInterpolation::None
 Face-varying interpolation rule.
 
bool use_limit_surface = false
 Interpolate all data to the limit surface.
 
Input Attributes To Interpolate
InterpolatedAttributes interpolated_attributes
 List of attributes to interpolate. More...
 
Input Element Tags
std::optional< AttributeIdedge_sharpness_attr
 Per-edge scalar attribute denoting edge sharpness. More...
 
std::optional< AttributeIdvertex_sharpness_attr
 Per-vertex scalar attribute denoting vertex sharpness (e.g. More...
 
std::optional< AttributeIdface_hole_attr
 Per-face integer attribute denoting face holes. More...
 
Output Attributes
bool preserve_shared_indices = false
 [Adaptive subdivision only] Whether to preserve shared indices when interpolating indexed attributes. More...
 
std::string_view output_limit_normals
 A newly computed per-vertex attribute containing the normals to the limit surface. More...
 
std::string_view output_limit_tangents
 A newly computed per-vertex attribute containing the tangents (first derivatives) to the limit surface. More...
 
std::string_view output_limit_bitangents
 A newly computed per-vertex attribute containing the bitangents (second derivative) to the limit surface. More...
 
Debugging options
bool validate_topology = false
 Validate topology of the subdivision surface. More...
 

Detailed Description

Mesh subdivision options.

Member Data Documentation

◆ scheme

std::optional<SchemeType> scheme

Subvision scheme.

If not provided, will use Loop for triangle meshes, and CatmullCark for quad-dominant meshes.

◆ max_edge_length

std::optional<float> max_edge_length

Maximum edge length for adaptive tessellation.

If not specified, it is set to the longest edge length divided by num_levels.

◆ vertex_boundary_interpolation

VertexBoundaryInterpolation vertex_boundary_interpolation
Initial value:
=
@ EdgeOnly
A sequence of boundary vertices defines a smooth curve to which the limit surface along boundary face...

Vertex boundary interpolation rule.

◆ interpolated_attributes

InterpolatedAttributes interpolated_attributes

List of attributes to interpolate.

The selection can be either all (default), none, or specify a list of attribute ids to interpolate.

See also
InterpolatedAttributes

◆ edge_sharpness_attr

std::optional<AttributeId> edge_sharpness_attr

Per-edge scalar attribute denoting edge sharpness.

Sharpness values must be in [0, 1] (0 means smooth, 1 means sharp).

◆ vertex_sharpness_attr

std::optional<AttributeId> vertex_sharpness_attr

Per-vertex scalar attribute denoting vertex sharpness (e.g.

for boundary corners). Sharpness values must be in [0, 1] (0 means smooth, 1 means sharp).

◆ face_hole_attr

std::optional<AttributeId> face_hole_attr

Per-face integer attribute denoting face holes.

A non-zero value means the facet is a hole. If a face is tagged as a hole, the limit surface will not be generated for that face.

◆ preserve_shared_indices

bool preserve_shared_indices = false

[Adaptive subdivision only] Whether to preserve shared indices when interpolating indexed attributes.

Turn this off if your input UVs are overlapping, or the output UVs will not be correctly interpolated.

◆ output_limit_normals

std::string_view output_limit_normals

A newly computed per-vertex attribute containing the normals to the limit surface.

Skipped if left empty.

Note
It is strongly recommended to use limit normals only when interpolating positions to the limit surface. Otherwise this can lead to visual artifacts if the positions and the normals don't match.

◆ output_limit_tangents

std::string_view output_limit_tangents

A newly computed per-vertex attribute containing the tangents (first derivatives) to the limit surface.

Skipped if left empty.

Note
It is strongly recommended to use limit tangents only when interpolating positions to the limit surface. Otherwise this can lead to visual artifacts if the positions and the normals don't match.

◆ output_limit_bitangents

std::string_view output_limit_bitangents

A newly computed per-vertex attribute containing the bitangents (second derivative) to the limit surface.

Skipped if left empty.

Note
It is strongly recommended to use limit bitangents only when interpolating positions to the limit surface. Otherwise this can lead to visual artifacts if the positions and the normals don't match.

◆ validate_topology

bool validate_topology = false

Validate topology of the subdivision surface.

For debugging only.


The documentation for this struct was generated from the following file: