15#ifdef LAGRANGE_ENABLE_LEGACY_FUNCTIONS
16 #include <lagrange/subdivision/legacy/mesh_subdivision.h>
19#include <lagrange/SurfaceMesh.h>
136 std::vector<AttributeId> smooth,
137 std::vector<AttributeId> linear = {})
139 return {SelectionType::Selected, std::move(smooth), std::move(linear)};
158 void set_selected(std::vector<AttributeId> smooth, std::vector<AttributeId> linear = {})
315template <
typename Scalar,
typename Index>
Helper class to select which attributes to interpolate.
Definition: mesh_subdivision.h:104
void set_none()
Sets selection to none.
Definition: mesh_subdivision.h:150
std::vector< AttributeId > smooth_attributes
List of per-vertex or indexed attributes ids to smoothly interpolate (in OpenSubdiv terms,...
Definition: mesh_subdivision.h:174
void set_all()
Sets selection to all.
Definition: mesh_subdivision.h:145
std::vector< AttributeId > linear_attributes
List of per-vertex attributes ids to linearly interpolate (in OpenSubdiv terms, this corresponds to "...
Definition: mesh_subdivision.h:178
static InterpolatedAttributes selected(std::vector< AttributeId > smooth, std::vector< AttributeId > linear={})
Only interpolate the specified attributes.
Definition: mesh_subdivision.h:135
static InterpolatedAttributes all()
Interpolate all compatible attribute.
Definition: mesh_subdivision.h:117
SelectionType selection_type
Selection type.
Definition: mesh_subdivision.h:168
SelectionType
Selection tag.
Definition: mesh_subdivision.h:109
static InterpolatedAttributes none()
Do not interpolate any attribute.
Definition: mesh_subdivision.h:124
void set_selected(std::vector< AttributeId > smooth, std::vector< AttributeId > linear={})
Set selection to a specific list of attribte ids.
Definition: mesh_subdivision.h:158
@ Uniform
Incident face normals have uniform influence on vertex normal.
FaceVaryingInterpolation
Face-varying Interpolation Rules.
Definition: mesh_subdivision.h:67
VertexBoundaryInterpolation
Boundary Interpolation Rules.
Definition: mesh_subdivision.h:42
SchemeType
Subdivision scheme.
Definition: mesh_subdivision.h:29
RefinementType
Topology refinement method.
Definition: mesh_subdivision.h:79
@ CornersPlus2
CornersPlus2 + sharpening of darts and concave corners.
@ CornersOnly
Linearly interpolate (sharpen or pin) corners only.
@ None
Smooth everywhere the mesh is smooth.
@ CornersPlus1
CornersOnly + sharpening of junctions of 3 or more regions.
@ Boundaries
Linear interpolation along all boundary edges and corners.
@ All
Linear interpolation everywhere (boundaries and interior)
@ EdgeOnly
A sequence of boundary vertices defines a smooth curve to which the limit surface along boundary face...
@ EdgeAndCorner
Similar to edge-only but the smooth curve resulting on the boundary is made to interpolate corner ver...
@ CatmullClark
Bilinear subdivision scheme.
@ Loop
Loop is preferred for (and requires) purely triangulated meshes.
@ EdgeAdaptive
Each facet is subdivided adaptively according to the mesh curvature.
@ Uniform
Each facet is subdivided a fixed number of time.
Subdivision surfaces.
Definition: mesh_subdivision.h:32
@ None
Do not reorder mesh vertices/facets.
Mesh subdivision options.
Definition: mesh_subdivision.h:183
std::string_view output_limit_normals
A newly computed per-vertex attribute containing the normals to the limit surface.
Definition: mesh_subdivision.h:269
bool preserve_shared_indices
[Adaptive subdivision only] Whether to preserve shared indices when interpolating indexed attributes.
Definition: mesh_subdivision.h:259
std::optional< AttributeId > face_hole_attr
Per-face integer attribute denoting face holes.
Definition: mesh_subdivision.h:248
std::optional< AttributeId > edge_sharpness_attr
Per-edge scalar attribute denoting edge sharpness.
Definition: mesh_subdivision.h:240
unsigned num_levels
Number of subdivision level requested.
Definition: mesh_subdivision.h:193
bool validate_topology
Validate topology of the subdivision surface.
Definition: mesh_subdivision.h:299
std::optional< float > max_edge_length
Maximum edge length for adaptive tessellation.
Definition: mesh_subdivision.h:204
std::string_view output_limit_bitangents
A newly computed per-vertex attribute containing the bitangents (second derivative) to the limit surf...
Definition: mesh_subdivision.h:289
std::optional< SchemeType > scheme
Subvision scheme.
Definition: mesh_subdivision.h:190
VertexBoundaryInterpolation vertex_boundary_interpolation
Vertex boundary interpolation rule.
Definition: mesh_subdivision.h:211
std::optional< AttributeId > vertex_sharpness_attr
Per-vertex scalar attribute denoting vertex sharpness (e.g.
Definition: mesh_subdivision.h:244
InterpolatedAttributes interpolated_attributes
List of attributes to interpolate.
Definition: mesh_subdivision.h:230
RefinementType refinement
How to refine the mesh topology.
Definition: mesh_subdivision.h:196
std::string_view output_limit_tangents
A newly computed per-vertex attribute containing the tangents (first derivatives) to the limit surfac...
Definition: mesh_subdivision.h:279
bool use_limit_surface
Interpolate all data to the limit surface.
Definition: mesh_subdivision.h:218
FaceVaryingInterpolation face_varying_interpolation
Face-varying interpolation rule.
Definition: mesh_subdivision.h:215