15#ifdef LAGRANGE_ENABLE_LEGACY_HEADERS
16 #include <lagrange/subdivision/legacy/mesh_subdivision.h>
19#include <lagrange/subdivision/api.h>
21#include <lagrange/SurfaceMesh.h>
138 std::vector<AttributeId> smooth,
139 std::vector<AttributeId> linear = {})
141 return {SelectionType::Selected, std::move(smooth), std::move(linear)};
160 void set_selected(std::vector<AttributeId> smooth, std::vector<AttributeId> linear = {})
336template <
typename Scalar,
typename Index>
A general purpose polygonal mesh class.
Definition SurfaceMesh.h:73
Helper class to select which attributes to interpolate.
Definition mesh_subdivision.h:106
void set_none()
Sets selection to none.
Definition mesh_subdivision.h:152
std::vector< AttributeId > smooth_attributes
List of per-vertex or indexed attributes ids to smoothly interpolate (in OpenSubdiv terms,...
Definition mesh_subdivision.h:176
void set_all()
Sets selection to all.
Definition mesh_subdivision.h:147
std::vector< AttributeId > linear_attributes
List of per-vertex attributes ids to linearly interpolate (in OpenSubdiv terms, this corresponds to "...
Definition mesh_subdivision.h:180
static InterpolatedAttributes selected(std::vector< AttributeId > smooth, std::vector< AttributeId > linear={})
Only interpolate the specified attributes.
Definition mesh_subdivision.h:137
static InterpolatedAttributes all()
Interpolate all compatible attribute.
Definition mesh_subdivision.h:119
SelectionType selection_type
Selection type.
Definition mesh_subdivision.h:170
SelectionType
Selection tag.
Definition mesh_subdivision.h:111
static InterpolatedAttributes none()
Do not interpolate any attribute.
Definition mesh_subdivision.h:126
void set_selected(std::vector< AttributeId > smooth, std::vector< AttributeId > linear={})
Set selection to a specific list of attribute ids.
Definition mesh_subdivision.h:160
FaceVaryingInterpolation
Face-varying Interpolation Rules.
Definition mesh_subdivision.h:69
VertexBoundaryInterpolation
Boundary Interpolation Rules.
Definition mesh_subdivision.h:44
SchemeType
Subdivision scheme.
Definition mesh_subdivision.h:31
RefinementType
Topology refinement method.
Definition mesh_subdivision.h:81
@ CornersPlus2
CornersPlus2 + sharpening of darts and concave corners.
Definition mesh_subdivision.h:73
@ CornersOnly
Linearly interpolate (sharpen or pin) corners only.
Definition mesh_subdivision.h:71
@ None
Smooth everywhere the mesh is smooth.
Definition mesh_subdivision.h:70
@ CornersPlus1
CornersOnly + sharpening of junctions of 3 or more regions.
Definition mesh_subdivision.h:72
@ Boundaries
Linear interpolation along all boundary edges and corners.
Definition mesh_subdivision.h:74
@ All
Linear interpolation everywhere (boundaries and interior)
Definition mesh_subdivision.h:75
@ EdgeOnly
A sequence of boundary vertices defines a smooth curve to which the limit surface along boundary face...
Definition mesh_subdivision.h:53
@ None
No boundary edge interpolation is applied by default; boundary faces are tagged as holes so that the ...
Definition mesh_subdivision.h:49
@ EdgeAndCorner
Similar to edge-only but the smooth curve resulting on the boundary is made to interpolate corner ver...
Definition mesh_subdivision.h:57
@ CatmullClark
Bilinear subdivision scheme.
Definition mesh_subdivision.h:34
@ Loop
Loop is preferred for (and requires) purely triangulated meshes.
Definition mesh_subdivision.h:35
@ EdgeAdaptive
Each facet is subdivided adaptively according to the mesh curvature.
Definition mesh_subdivision.h:93
@ Uniform
Each facet is subdivided a fixed number of time.
Definition mesh_subdivision.h:83
Subdivision surfaces.
Definition compute_sharpness.h:21
Mesh subdivision options.
Definition mesh_subdivision.h:185
std::string_view output_limit_normals
A newly computed per-vertex attribute containing the normals to the limit surface.
Definition mesh_subdivision.h:290
bool preserve_shared_indices
[Adaptive subdivision only] Whether to preserve shared indices when interpolating indexed attributes.
Definition mesh_subdivision.h:280
std::optional< AttributeId > face_hole_attr
Per-face integer attribute denoting face holes.
Definition mesh_subdivision.h:269
std::optional< AttributeId > edge_sharpness_attr
Per-edge scalar attribute denoting edge sharpness.
Definition mesh_subdivision.h:261
unsigned num_levels
Number of subdivision level requested.
Definition mesh_subdivision.h:195
bool validate_topology
Validate topology of the subdivision surface.
Definition mesh_subdivision.h:320
std::optional< float > max_edge_length
Maximum edge length for adaptive tessellation.
Definition mesh_subdivision.h:210
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:310
std::optional< SchemeType > scheme
Subvision scheme.
Definition mesh_subdivision.h:192
VertexBoundaryInterpolation vertex_boundary_interpolation
Vertex boundary interpolation rule.
Definition mesh_subdivision.h:232
std::optional< AttributeId > vertex_sharpness_attr
Per-vertex scalar attribute denoting vertex sharpness (e.g.
Definition mesh_subdivision.h:265
InterpolatedAttributes interpolated_attributes
List of attributes to interpolate.
Definition mesh_subdivision.h:251
RefinementType refinement
How to refine the mesh topology.
Definition mesh_subdivision.h:198
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:300
std::optional< float > max_chordal_deviation
Maximum chordal deviation for adaptive tessellation.
Definition mesh_subdivision.h:225
bool use_limit_surface
Interpolate all data to the limit surface.
Definition mesh_subdivision.h:239
FaceVaryingInterpolation face_varying_interpolation
Face-varying interpolation rule.
Definition mesh_subdivision.h:236