Lagrange
|
nullptr_t, size_t, ptrdiff_t basic_ostream bad_weak_ptr extent, remove_extent, is_array, is_void, common_type move, forward, swap More...
Classes | |
struct | BucketSortOffset |
Bucket sort offset infos. More... | |
struct | BucketSortResult |
Bucket sort result object. More... | |
class | control_block |
NOT implemented: custom allocator support. More... | |
class | control_block_base |
class | default_delete |
class | default_delete< T[]> |
struct | InverseMapping |
A simple struct representing the inverse of a 1-to-many mapping. More... | |
struct | MapAttributesOptions |
Attribute mapping options. More... | |
class | ptr |
class | shared_ptr |
NOT implemented: custom allocator support. More... | |
class | shared_ptr_access |
class | shared_ptr_access< T, false, true > |
class | shared_ptr_access< T, true, false > |
struct | SkinningExtractNResult |
struct | UnorientedEdge |
class | weak_ptr |
Enumerations | |
enum class | ResetToDefault { Yes , No } |
Functions | |
LA_CORE_API std::string_view | to_string (AttributeElement element) |
Returns a string representation of an attribute element type. More... | |
LA_CORE_API std::string | to_string (BitField< AttributeElement > element) |
Returns a string representation of an attribute element type. More... | |
LA_CORE_API std::string_view | to_string (AttributeUsage usage) |
Returns a string representation of an attribute usage. More... | |
template<typename ValueType > | |
std::string_view | value_type_name (const lagrange::Attribute< ValueType > &attr) |
Returns a string representation of the attribute value type. More... | |
template<typename ValueType > | |
std::string_view | value_type_name () |
Returns a string representation of the attribute value type. More... | |
template<typename DerivedF , typename DerivedFF , typename DerivedC > | |
void | bfs_orient (const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedFF > &FF, Eigen::PlainObjectBase< DerivedC > &C) |
template<typename Scalar , typename Index > | |
void | dijkstra (SurfaceMesh< Scalar, Index > &mesh, span< const Index > seed_vertices, span< const Scalar > seed_vertex_dist, Scalar radius, const function_ref< Scalar(Index, Index)> &dist, const function_ref< bool(Index, Scalar)> &process) |
Traverse the mesh based on Dijkstra's algorithm with customized distance metric and process functions. More... | |
template<typename DerivedV , typename DerivedF , typename DeriveddblA > | |
void | doublearea (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DeriveddblA > &dblA) |
template<typename Index , typename Func > | |
std::vector< Index > | fast_edge_sort (Index num_edges, Index num_vertices, Func get_edge, span< Index > vertex_to_first_edge={}) |
Sort an array of edges using a parallel bucket sort. More... | |
template<typename ExpectedValueType , typename Scalar , typename Index > | |
AttributeId | find_matching_attribute (const SurfaceMesh< Scalar, Index > &mesh, std::string_view name, BitField< AttributeElement > expected_element, AttributeUsage expected_usage, size_t expected_channels) |
Find an attribute with a given name, ensuring the usage and element type match an expected target. More... | |
template<typename ExpectedValueType , typename Scalar , typename Index > | |
AttributeId | find_matching_attribute (const SurfaceMesh< Scalar, Index > &mesh, span< const AttributeId > selected_ids, BitField< AttributeElement > expected_element, AttributeUsage expected_usage, size_t expected_channels) |
Find an attribute from a selected set of ids, ensuring the usage and element type match an expected target. More... | |
template<typename ExpectedValueType , typename Scalar , typename Index > | |
AttributeId | find_attribute (const SurfaceMesh< Scalar, Index > &mesh, std::string_view name, BitField< AttributeElement > expected_element, AttributeUsage expected_usage, size_t expected_channels) |
Find an attribute with a given name, ensuring the usage and element type match an expected target. More... | |
template<typename ExpectedValueType , typename Scalar , typename Index > | |
AttributeId | find_or_create_attribute (SurfaceMesh< Scalar, Index > &mesh, std::string_view name, AttributeElement expected_element, AttributeUsage expected_usage, size_t expected_channels, ResetToDefault reset_tag) |
Either retrieve or create an attribute with a prescribed name, element type and usage. More... | |
template<typename DerivedV , typename DerivedF , typename DerivedK > | |
void | internal_angles (const Eigen::MatrixBase< DerivedV > &vertices, const Eigen::MatrixBase< DerivedF > &facets, Eigen::PlainObjectBase< DerivedK > &angles) |
Compute internal angles for a triangle mesh. More... | |
template<typename Index , typename Function > | |
InverseMapping< Index > | invert_mapping (Index num_source_elements, Function old_to_new, Index num_target_elements=invalid< Index >()) |
Compute the target-to-source (i.e. More... | |
template<typename Index > | |
InverseMapping< Index > | invert_mapping (span< const Index > old_to_new, Index num_target_elements=invalid< Index >()) |
Compute the target-to-source (i.e. More... | |
template<AttributeElement element, typename Scalar , typename Index > | |
void | map_attributes (const SurfaceMesh< Scalar, Index > &source_mesh, SurfaceMesh< Scalar, Index > &target_mesh, span< const Index > mapping_data, span< const Index > mapping_offsets={}, const MapAttributesOptions &options={}) |
Map attributes from the source mesh to the target mesh. More... | |
template<typename DerivedF , typename DerivedC , typename AScalar > | |
void | orientable_patches (const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedC > &C, Eigen::SparseMatrix< AScalar > &A) |
template<typename DerivedF , typename DerivedC > | |
void | orientable_patches (const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedC > &C) |
template<typename T , typename... Args> | |
shared_ptr< T > | make_shared (Args &&... args) |
Creates a shared_ptr that manages a new object. | |
template<typename T , typename A , typename... Args> | |
shared_ptr< T > | allocate_shared (const A &a, Args &&... args)=delete |
template<typename T , typename U > | |
bool | operator== (const shared_ptr< T > &sp1, const shared_ptr< U > &sp2) |
Operator == overloading. | |
template<typename T > | |
bool | operator== (const shared_ptr< T > &sp, std::nullptr_t) noexcept |
template<typename T > | |
bool | operator== (std::nullptr_t, const shared_ptr< T > &sp) noexcept |
template<typename T , typename U > | |
bool | operator!= (const shared_ptr< T > &sp1, const shared_ptr< U > &sp2) |
Operator != overloading. | |
template<typename T > | |
bool | operator!= (const shared_ptr< T > &sp, std::nullptr_t) noexcept |
template<typename T > | |
bool | operator!= (std::nullptr_t, const shared_ptr< T > &sp) noexcept |
template<typename T > | |
void | swap (shared_ptr< T > &sp1, shared_ptr< T > &sp2) |
Swaps with another shared_ptr. | |
template<typename T , typename U > | |
shared_ptr< T > | static_pointer_cast (const shared_ptr< U > &sp) noexcept |
template<typename T , typename U > | |
shared_ptr< T > | const_pointer_cast (const shared_ptr< U > &sp) noexcept |
template<typename T , typename U > | |
shared_ptr< T > | dynamic_pointer_cast (const shared_ptr< U > &sp) noexcept |
template<typename T , typename U > | |
shared_ptr< T > | reinterpret_pointer_cast (const shared_ptr< U > &sp) noexcept |
template<class E , class T , class Y > | |
std::basic_ostream< E, T > & | operator<< (std::basic_ostream< E, T > &os, const shared_ptr< Y > &sp) |
template<typename Scalar , typename Index > | |
void | skinning_deform (SurfaceMesh< Scalar, Index > &mesh, const lagrange::Attribute< Scalar > &original_vertices, const std::vector< Eigen::Transform< Scalar, 3, Eigen::TransformTraits::Affine > > &transforms, const Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > &weights, const Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > &weight_complement={}) |
Performs linear blend skinning deformation on a mesh. More... | |
template<typename Scalar , typename Index > | |
void | skinning_deform (SurfaceMesh< Scalar, Index > &mesh, const Attribute< Scalar > &original_vertices, const std::vector< Eigen::Transform< Scalar, 3, Eigen::TransformTraits::Affine > > &transforms) |
Performs linear blend skinning on a mesh, using weights information from the mesh attributes. More... | |
template<typename Scalar , typename Index > | |
SkinningExtractNResult< Scalar, Index > | skinning_extract_n (const Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > &weights, int n, const Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > &weight_complement=Eigen::Matrix< Scalar, Eigen::Dynamic, 1 >()) |
From a weight matrix |V| x |H|, constructs a weight matrix |V| x n, where n is an arbitrary contraint (typically 4 or 8). More... | |
template<typename Scalar , typename Index , typename WeightScalar = Scalar> | |
lagrange::AttributeId | weights_to_mesh_attribute (SurfaceMesh< Scalar, Index > &mesh, const Eigen::Matrix< WeightScalar, Eigen::Dynamic, Eigen::Dynamic > &weights) |
Imports the weights matrix as weight attributes of the mesh. More... | |
template<typename Scalar , typename Index , typename WeightScalar = Scalar, typename WeightIndex = Index> | |
std::pair< lagrange::AttributeId, lagrange::AttributeId > | weights_to_indexed_mesh_attribute (SurfaceMesh< Scalar, Index > &mesh, const Eigen::Matrix< WeightScalar, Eigen::Dynamic, Eigen::Dynamic > &weights, int n) |
Imports the weights matrix as indexed weight attributes of the mesh. More... | |
template<typename DerivedX , typename DerivedIX > | |
void | sortrows (const Eigen::DenseBase< DerivedX > &X, const bool ascending, Eigen::PlainObjectBase< DerivedX > &Y, Eigen::PlainObjectBase< DerivedIX > &IX) |
template<typename DerivedX > | |
void | sortrows (const Eigen::DenseBase< DerivedX > &X, const bool ascending, Eigen::PlainObjectBase< DerivedX > &Y) |
template<typename Scalar > | |
std::string_view | string_from_scalar () |
Returns a human-readable string from any supported attribute value type. More... | |
template<typename DerivedA , typename DerivedC , typename DerivedIA , typename DerivedIC > | |
void | unique_rows (const Eigen::DenseBase< DerivedA > &A, Eigen::PlainObjectBase< DerivedC > &C, Eigen::PlainObjectBase< DerivedIA > &IA, Eigen::PlainObjectBase< DerivedIC > &IC) |
template<typename DerivedA , typename DerivedC , typename Derivedcounts > | |
void | vertex_components (const Eigen::SparseCompressedBase< DerivedA > &A, Eigen::PlainObjectBase< DerivedC > &C, Eigen::PlainObjectBase< Derivedcounts > &counts) |
template<typename DerivedA , typename DerivedC > | |
void | vertex_components (const Eigen::SparseCompressedBase< DerivedA > &A, Eigen::PlainObjectBase< DerivedC > &C) |
template<typename Func , typename Scalar , typename Index > | |
void | visit_attribute_read (const SurfaceMesh< Scalar, Index > &mesh, AttributeId id, Func &&func) |
Apply a function to a read-only mesh attribute. More... | |
template<typename Func , typename Scalar , typename Index > | |
void | visit_attribute_write (SurfaceMesh< Scalar, Index > &mesh, AttributeId id, Func &&func) |
Apply a function to a writeable mesh attribute. More... | |
template<typename T > | |
void | swap (weak_ptr< T > &wp1, weak_ptr< T > &wp2) |
Swaps with another weak_ptr. | |
template<typename MeshType > | |
auto | compute_triangle_areas (const MeshType &mesh) -> AttributeArrayOf< MeshType > |
Calculates the triangle areas. More... | |
template<typename MeshType > | |
auto | compute_quad_areas (const MeshType &mesh) -> AttributeArrayOf< MeshType > |
Calculates the quad areas. More... | |
bool | point_on_segment_2d (Eigen::Vector2d p, Eigen::Vector2d a, Eigen::Vector2d b) |
bool | point_on_segment_3d (Eigen::Vector3d p, Eigen::Vector3d a, Eigen::Vector3d b) |
template<typename Index > | |
BucketSortResult< Index > | bucket_sort (DisjointSets< Index > &unified_indices, span< Index > element_representative) |
Performs a bucket sort over a range of elements. More... | |
template<typename Index , typename Function > | |
BucketSortOffset< Index > | bucket_sort (std::vector< Index > &elements, Index num_buckets, Function get_representative) |
Perform a bucket sort over a range of elements in place. More... | |
template<typename Scalar , typename Index > | |
Eigen::Matrix< Scalar, 3, 1 > | compute_weighted_corner_normal (SurfaceMesh< Scalar, Index > &mesh, Index ci, NormalWeightingType weighting=NormalWeightingType::CornerTriangleArea) |
Compute weighted corner normal based on the weighting type. More... | |
template<typename Scalar , typename Index > | |
auto | recompute_facet_normal_if_needed (SurfaceMesh< Scalar, Index > &mesh, std::string_view facet_normal_attribute_name, bool recompute_facet_normals) |
Compute facet normal attribute if necessary or as requested. More... | |
nullptr_t, size_t, ptrdiff_t basic_ostream bad_weak_ptr extent, remove_extent, is_array, is_void, common_type move, forward, swap
This file contains commonly used functions related to skinning deformation on a mesh.
skinning_deform
deforms a mesh with weights.
skinning_extract_n
takes a weight matrix |V| x |H| and outputs indexed weights, up to n per vertex.
weights_to_mesh_attribute
and weights_to_indexed_mesh_attribute
save a weights matrix as attributes.
std::string_view to_string | ( | AttributeElement | element | ) |
Returns a string representation of an attribute element type.
[in] | element | Attribute element type. |
std::string to_string | ( | BitField< AttributeElement > | element | ) |
Returns a string representation of an attribute element type.
[in] | element | Attribute element type. |
std::string_view to_string | ( | AttributeUsage | usage | ) |
Returns a string representation of an attribute usage.
[in] | usage | Attribute usage. |
std::string_view value_type_name | ( | const lagrange::Attribute< ValueType > & | attr | ) |
Returns a string representation of the attribute value type.
[in] | attr | Input attribute. |
ValueType | Attribute value type. |
std::string_view value_type_name | ( | ) |
Returns a string representation of the attribute value type.
ValueType | Attribute value type. |
void dijkstra | ( | SurfaceMesh< Scalar, Index > & | mesh, |
span< const Index > | seed_vertices, | ||
span< const Scalar > | seed_vertex_dist, | ||
Scalar | radius, | ||
const function_ref< Scalar(Index, Index)> & | dist, | ||
const function_ref< bool(Index, Scalar)> & | process | ||
) |
Traverse the mesh based on Dijkstra's algorithm with customized distance metric and process functions.
mesh | The input mesh. |
seed_vertices | Seed vertices. |
seed_vertex_dist | Initial distance to the seed vertices. |
radius | The radius of the search. Radius <= 0 denotes the search is over the entire mesh. |
dist | The distance metric. e.g. d = dist(v0, v1) |
process | Call back function to process each new vertex reached. Its return type indicates whether the search is done. e.g. done = process(vid, v_dist) |
std::vector< Index > fast_edge_sort | ( | Index | num_edges, |
Index | num_vertices, | ||
Func | get_edge, | ||
span< Index > | vertex_to_first_edge = {} |
||
) |
Sort an array of edges using a parallel bucket sort.
triangulate_polygonal_facets
function.[in] | num_edges | Number of edges to sort. |
[in] | num_vertices | Number of vertices in the mesh. |
[in] | get_edge | Callback to retrieve the n-th edge endpoints. Must be safe to call from multiple threads. |
[in] | vertex_to_first_edge | Optional buffer of size num_vertices + 1 to avoid internal allocations on repeated uses. |
Index | Edge index type. |
Func | Callback function to retrieve edge endpoints. |
AttributeId find_matching_attribute | ( | const SurfaceMesh< Scalar, Index > & | mesh, |
std::string_view | name, | ||
BitField< AttributeElement > | expected_element, | ||
AttributeUsage | expected_usage, | ||
size_t | expected_channels | ||
) |
Find an attribute with a given name, ensuring the usage and element type match an expected target.
If the provided name is empty, the first attribute with matching properties is returned. If no such attribute is found, invalid_attribute_id() is returned instead.
mesh | Mesh where to look for attributes. | |
[in] | name | Optional name of the attribute to find. If empty, the first matching attribute id will be returned. |
[in] | expected_element | Expected element type. |
[in] | expected_usage | Expected attribute usage. |
[in] | expected_channels | Expected number of channels. If 0, then the check is skipped. |
ExpectedValueType | Expected attribute value type. |
Scalar | Mesh scalar type. |
Index | Mesh index type. |
AttributeId find_matching_attribute | ( | const SurfaceMesh< Scalar, Index > & | mesh, |
span< const AttributeId > | selected_ids, | ||
BitField< AttributeElement > | expected_element, | ||
AttributeUsage | expected_usage, | ||
size_t | expected_channels | ||
) |
Find an attribute from a selected set of ids, ensuring the usage and element type match an expected target.
If the provided selected_ids
is empty, it will search all attributes. Otherwise, only attributes corresponding to selected_ids
are searched. The first attribute with matching properties is returned. If no such attribute is found, invalid_attribute_id() is returned instead.
mesh | Mesh where to look for attributes. | |
[in] | selected_ids | Selected attribute ids. |
[in] | expected_element | Expected element type. |
[in] | expected_usage | Expected attribute usage. |
[in] | expected_channels | Expected number of channels. If 0, then the check is skipped. |
ExpectedValueType | Expected attribute value type. |
Scalar | Mesh scalar type. |
Index | Mesh index type. |
AttributeId find_attribute | ( | const SurfaceMesh< Scalar, Index > & | mesh, |
std::string_view | name, | ||
BitField< AttributeElement > | expected_element, | ||
AttributeUsage | expected_usage, | ||
size_t | expected_channels | ||
) |
Find an attribute with a given name, ensuring the usage and element type match an expected target.
This function does not allow empty names to be provided.
mesh | Mesh where to look for attributes. | |
[in] | name | Name of the attribute to find. |
[in] | expected_element | Expected element type. |
[in] | expected_usage | Expected attribute usage. |
[in] | expected_channels | Expected number of channels. If 0, then the check is skipped. |
ExpectedValueType | Expected attribute value type. |
Scalar | Mesh scalar type. |
Index | Mesh index type. |
AttributeId find_or_create_attribute | ( | SurfaceMesh< Scalar, Index > & | mesh, |
std::string_view | name, | ||
AttributeElement | expected_element, | ||
AttributeUsage | expected_usage, | ||
size_t | expected_channels, | ||
ResetToDefault | reset_tag | ||
) |
Either retrieve or create an attribute with a prescribed name, element type and usage.
When retrieving an existing attribute, this function performs additional sanity checks, such as ensuring that the attribute usage is correctly set, that the number of channels is correct, etc.
mesh | Mesh whose attribute to retrieve. | |
[in] | name | Name of the attribute to retrieve. |
[in] | expected_element | Expected element type. |
[in] | expected_usage | Expected attribute usage. |
[in] | expected_channels | Expected number of channels. If 0, then the check is skipped. |
[in] | reset_tag | Whether to reset attribute values to default (if attribute is not created). |
ExpectedValueType | Expected attribute value type. |
Scalar | Mesh scalar type. |
Index | Mesh index type. |
void internal_angles | ( | const Eigen::MatrixBase< DerivedV > & | vertices, |
const Eigen::MatrixBase< DerivedF > & | facets, | ||
Eigen::PlainObjectBase< DerivedK > & | angles | ||
) |
Compute internal angles for a triangle mesh.
[in] | vertices | #vertices by dim Eigen matrix of mesh vertex nD positions. |
[in] | facets | #facets by 3 eigen Matrix of face (triangle) indices, |
[out] | angles | #facets by 3 eigen Matrix of internal angles for triangles, columns correspond to edges [1,2],[2,0],[0,1]. |
DerivedV | Vertices matrix type. |
DerivedF | Facets matrix type. |
DerivedK | Angles matrix type. |
InverseMapping< Index > invert_mapping | ( | Index | num_source_elements, |
Function | old_to_new, | ||
Index | num_target_elements = invalid<Index>() |
||
) |
Compute the target-to-source (i.e.
backward) mapping from an input source-to-target (i.e. forward) mapping.
invalid<Index>()
, no backward mapping will be created for that target element.[in] | num_source_elements | The number of source elements. |
[in] | old_to_new | Source-to-target mapping function. |
[in] | num_target_elements | The total number of target elements. If set to invalid<Index>() , it is automatically calculated from the forward mapping. |
Index | The index type. |
Function | Mapping function type. |
InverseMapping< Index > invert_mapping | ( | span< const Index > | old_to_new, |
Index | num_target_elements = invalid<Index>() |
||
) |
Compute the target-to-source (i.e.
backward) mapping from an input source-to-target (i.e. forward) mapping.
invalid<Index>()
, no backward mapping will be created for that target element.[in] | old_to_new | Source-to-target mapping. |
[in] | num_target_elements | The total number of target elements. If set to invalid<Index>() , it is automatically calculated from the forward mapping. |
Index | The index type. |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void map_attributes | ( | const SurfaceMesh< Scalar, Index > & | source_mesh, |
SurfaceMesh< Scalar, Index > & | target_mesh, | ||
span< const Index > | mapping_data, | ||
span< const Index > | mapping_offsets = {} , |
||
const MapAttributesOptions & | options = {} |
||
) |
Map attributes from the source mesh to the target mesh.
This is the most general version that supports many-to-many mapping. Collision policy settings in options
define the behavior when multiple source vertices are mapped to the same target vertex.
Scalar | The scalar type. |
Index | The index type. |
source_mesh | The source mesh. |
target_mesh | The target mesh. |
mapping_data | A flat array of source element indices. |
mapping_offsets | The offset index array into the mapping_data . Source element with index listed from mapping_data[mapping_offset[i]] to mapping_data[mapping_offset[i+1]] are mapped to target element i . If empty, source element with index mapping_data[i] is mapped to target element i . |
options | Option settings. |
MapAttributesOptions
. void skinning_deform | ( | SurfaceMesh< Scalar, Index > & | mesh, |
const lagrange::Attribute< Scalar > & | original_vertices, | ||
const std::vector< Eigen::Transform< Scalar, 3, Eigen::TransformTraits::Affine > > & | transforms, | ||
const Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > & | weights, | ||
const Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > & | weight_complement = {} |
||
) |
Performs linear blend skinning deformation on a mesh.
[in,out] | mesh | vertices of this mesh will be modified |
[in] | original_vertices | original positions of vertices |
[in] | transforms | vector of eigen affine transforms, describe the global movement of each handle/joint |
[in] | weights | |V| x |handle| weight matrix |
[in] | weight_complement | optional, acts as weights for an extra handle that does not move. |
void skinning_deform | ( | SurfaceMesh< Scalar, Index > & | mesh, |
const Attribute< Scalar > & | original_vertices, | ||
const std::vector< Eigen::Transform< Scalar, 3, Eigen::TransformTraits::Affine > > & | transforms | ||
) |
Performs linear blend skinning on a mesh, using weights information from the mesh attributes.
[in,out] | mesh | vertices of this mesh will be modified |
[in] | original_vertices | original positions of vertices |
[in] | transforms | vector of eigen affine transforms, describe the global movement of each handle/joint |
SkinningExtractNResult< Scalar, Index > skinning_extract_n | ( | const Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > & | weights, |
int | n, | ||
const Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > & | weight_complement = Eigen::Matrix<Scalar, Eigen::Dynamic, 1>() |
||
) |
From a weight matrix |V| x |H|, constructs a weight matrix |V| x n, where n is an arbitrary contraint (typically 4 or 8).
[in] | weights | |V| x |handle| weight matrix |
[in] | n | max number of weights for each vertex |
[in] | weight_complement | optional, acts as weights for an extra handle that does not move. |
lagrange::AttributeId weights_to_mesh_attribute | ( | SurfaceMesh< Scalar, Index > & | mesh, |
const Eigen::Matrix< WeightScalar, Eigen::Dynamic, Eigen::Dynamic > & | weights | ||
) |
Imports the weights matrix as weight attributes of the mesh.
[in,out] | mesh | Mesh to modify |
[in] | weights | weights matrix |
std::pair< lagrange::AttributeId, lagrange::AttributeId > weights_to_indexed_mesh_attribute | ( | SurfaceMesh< Scalar, Index > & | mesh, |
const Eigen::Matrix< WeightScalar, Eigen::Dynamic, Eigen::Dynamic > & | weights, | ||
int | n | ||
) |
Imports the weights matrix as indexed weight attributes of the mesh.
[in,out] | mesh | Mesh to modify |
[in] | weights | Weights matrix |
[in] | n | max weights per vertex |
std::string_view string_from_scalar | ( | ) |
Returns a human-readable string from any supported attribute value type.
Scalar | Can be any supported attribute value type. |
void visit_attribute_read | ( | const SurfaceMesh< Scalar, Index > & | mesh, |
AttributeId | id, | ||
Func && | func | ||
) |
Apply a function to a read-only mesh attribute.
[in] | mesh | Input mesh. |
[in] | id | Attribute id to apply the function to. |
func | Function to apply. |
AttributeBase &
as input? void visit_attribute_write | ( | SurfaceMesh< Scalar, Index > & | mesh, |
AttributeId | id, | ||
Func && | func | ||
) |
Apply a function to a writeable mesh attribute.
[in] | mesh | Input mesh. |
[in] | id | Attribute id to apply the function to. |
func | Function to apply. |
AttributeBase &
as input? Calculates the triangle areas.
[in] | mesh | Input triangle mesh. |
MeshType | Mesh type. |
Calculates the quad areas.
[in] | mesh | Input quad mesh. |
MeshType | Mesh type. |
BucketSortResult< Index > bucket_sort | ( | DisjointSets< Index > & | unified_indices, |
span< Index > | element_representative | ||
) |
Performs a bucket sort over a range of elements.
[in,out] | unified_indices | Disjoint sets covering the range of elements to sort. Due to path compression in the disjoint sets' find() method, this argument is not const. |
[out] | element_representative | Output buffer storing the representative index for each element in the range. Typically this will be the index buffer of a target indexed attribute. |
Index | Index type to sort. |
BucketSortOffset< Index > bucket_sort | ( | std::vector< Index > & | elements, |
Index | num_buckets, | ||
Function | get_representative | ||
) |
Perform a bucket sort over a range of elements in place.
[in,out] | elements | Elements to sort. |
[in] | num_buckets | Number of buckets (max element in the range + 1). |
[in] | get_representative | Function to get the representative bucket for a given element. |
Index | Index type. |
Function | Callback function type. |
Eigen::Matrix< Scalar, 3, 1 > compute_weighted_corner_normal | ( | SurfaceMesh< Scalar, Index > & | mesh, |
Index | ci, | ||
NormalWeightingType | weighting = NormalWeightingType::CornerTriangleArea |
||
) |
Compute weighted corner normal based on the weighting type.
[in] | mesh | The input mesh. |
[in] | ci | The target corner index. |
[in] | weighting | The weighting type. |
auto recompute_facet_normal_if_needed | ( | SurfaceMesh< Scalar, Index > & | mesh, |
std::string_view | facet_normal_attribute_name, | ||
bool | recompute_facet_normals | ||
) |
Compute facet normal attribute if necessary or as requested.
mesh | The input mesh. |
facet_normal_attribute_name | The facet normal attribute name. |
recompute_facet_normals | Whether to recompute facet normals if one already exists. |