Lagrange
|
Various attribute processing utilities. More...
Classes | |
struct | WeldOptions |
Options for welding indexed attributes. More... | |
Functions | |
template<typename Scalar , typename Index > | |
void | weld_indexed_attribute (SurfaceMesh< Scalar, Index > &mesh, AttributeId attr_id, const WeldOptions &options={}) |
Weld an indexed attribute by combining all corners around a vertex with the same attribute value. More... | |
Attribute remapping | |
Mapping attributes between different element types.
| |
template<typename Scalar , typename Index > | |
AttributeId | map_attribute (SurfaceMesh< Scalar, Index > &mesh, AttributeId id, std::string_view new_name, AttributeElement new_element) |
Map attribute values to a new attribute with a different element type. More... | |
template<typename Scalar , typename Index > | |
AttributeId | map_attribute (SurfaceMesh< Scalar, Index > &mesh, std::string_view old_name, std::string_view new_name, AttributeElement new_element) |
Map attribute values to a new attribute with a different element type. More... | |
template<typename Scalar , typename Index > | |
AttributeId | map_attribute_in_place (SurfaceMesh< Scalar, Index > &mesh, AttributeId id, AttributeElement new_element) |
Map attribute values to a different element type. More... | |
template<typename Scalar , typename Index > | |
AttributeId | map_attribute_in_place (SurfaceMesh< Scalar, Index > &mesh, std::string_view name, AttributeElement new_element) |
Map attribute values to a different element type. More... | |
Index buffer unification | |
template<typename Scalar , typename Index > | |
SurfaceMesh< Scalar, Index > | unify_index_buffer (const SurfaceMesh< Scalar, Index > &mesh, const std::vector< AttributeId > &attribute_ids={}) |
Unify index buffers of the input mesh for all attributes specified in attribute_ids . More... | |
template<typename Scalar , typename Index > | |
SurfaceMesh< Scalar, Index > | unify_named_index_buffer (const SurfaceMesh< Scalar, Index > &mesh, const std::vector< std::string_view > &attribute_names) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
Various attribute processing utilities.
AttributeId map_attribute | ( | SurfaceMesh< Scalar, Index > & | mesh, |
AttributeId | id, | ||
std::string_view | new_name, | ||
AttributeElement | new_element | ||
) |
#include <lagrange/map_attribute.h>
Map attribute values to a new attribute with a different element type.
If the input attribute is a value attribute, its number of rows must match the number of target mesh element (or number of corners if the target is an indexed attribute).
[in,out] | mesh | Input mesh. Modified to add a new attribute. |
[in] | id | Id of the input attribute to map. |
[in] | new_name | Name of the new mesh attribute to create. |
[in] | new_element | New attribute element type. |
AttributeId map_attribute | ( | SurfaceMesh< Scalar, Index > & | mesh, |
std::string_view | old_name, | ||
std::string_view | new_name, | ||
AttributeElement | new_element | ||
) |
#include <lagrange/map_attribute.h>
Map attribute values to a new attribute with a different element type.
If the input attribute is a value attribute, its number of rows must match the number of target mesh element (or number of corners if the target is an indexed attribute).
[in,out] | mesh | Input mesh. Modified to add a new attribute. |
[in] | old_name | Name of the input attribute to map. |
[in] | new_name | Name of the new mesh attribute to create. |
[in] | new_element | New attribute element type. |
AttributeId map_attribute_in_place | ( | SurfaceMesh< Scalar, Index > & | mesh, |
AttributeId | id, | ||
AttributeElement | new_element | ||
) |
#include <lagrange/map_attribute.h>
Map attribute values to a different element type.
A new attribute with the new element type is created with the same name as the old one, and the old one is removed. If the input attribute is a value attribute, its number of rows must match the number of target mesh element (or number of corners if the target is an indexed attribute).
[in,out] | mesh | Input mesh. Modified to add a new attribute. |
[in] | id | Id of the input attribute to map. |
[in] | new_element | New attribute element type. |
AttributeId map_attribute_in_place | ( | SurfaceMesh< Scalar, Index > & | mesh, |
std::string_view | name, | ||
AttributeElement | new_element | ||
) |
#include <lagrange/map_attribute.h>
Map attribute values to a different element type.
A new attribute with the new element type is created with the same name as the old one, and the old one is removed. If the input attribute is a value attribute, its number of rows must match the number of target mesh element (or number of corners if the target is an indexed attribute).
[in,out] | mesh | Input mesh. Modified to add a new attribute. |
[in] | name | Name of the attribute to map. |
[in] | new_element | New attribute element type. |
SurfaceMesh< Scalar, Index > unify_index_buffer | ( | const SurfaceMesh< Scalar, Index > & | mesh, |
const std::vector< AttributeId > & | attribute_ids = {} |
||
) |
#include <lagrange/unify_index_buffer.h>
Unify index buffers of the input mesh
for all attributes specified in attribute_ids
.
attribute_id
will become vertex attributes in the output mesh under the same names.[in] | mesh | The input polygonal mesh. |
[in] | attribute_ids | The input indexed attribute ids to be unified. If empty, all indexed attributes are unified. |
attribute_ids
. SurfaceMesh< Scalar, Index > unify_named_index_buffer | ( | const SurfaceMesh< Scalar, Index > & | mesh, |
const std::vector< std::string_view > & | attribute_names | ||
) |
#include <lagrange/unify_index_buffer.h>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
[in] | mesh | The input polygonal mesh. |
[in] | attribute_names | The input indexed attribute names to be unified. If empty, all indexed attributes are unified. |
attribute_names
.void weld_indexed_attribute | ( | SurfaceMesh< Scalar, Index > & | mesh, |
AttributeId | attr_id, | ||
const WeldOptions & | options = {} |
||
) |
#include <lagrange/weld_indexed_attribute.h>
Weld an indexed attribute by combining all corners around a vertex with the same attribute value.
Scalar | The mesh scalar type. |
Index | The mesh index type. |
mesh | The source mesh. |
attr_id | The indexed attribute id. |