|
Lagrange
|
Utility functions. More...
Topics | |
| Assert and errors | |
| Assertions and exceptions. | |
| Miscellaneous | |
| Useful functions that don't have their place anywhere else. | |
| Warnings | |
| Managing compiler warnings. | |
Classes | |
| class | AdjacencyList< Index > |
| Adjacency list. More... | |
| class | BitField< EnumType_ > |
| Bit field utility class. More... | |
| struct | ChainEdgesOptions |
| Options for chain_directed_edges and chain_undirected_edges. More... | |
| struct | ChainEdgesResult< Index > |
| Result struct holding the loops and chains extracted from a set of edges. More... | |
| class | DisjointSets< IndexType > |
| Disjoint sets computation. More... | |
| class | SmallVector< T, N > |
| Hybrid vector that uses the stack upto a maximum size, and the heap beyond that. More... | |
| struct | StackSet< T, N > |
| Stack-allocated set with a maximum size. More... | |
| struct | StackVector< T, N > |
| Stack-allocated vector with a maximum size. More... | |
Functions | |
| template<typename Index> | |
| ChainEdgesResult< Index > | chain_directed_edges (const span< const Index > edges, const ChainEdgesOptions &options={}) |
| Chain a set of directed edges into loops and chains. | |
| template<typename Index> | |
| ChainEdgesResult< Index > | chain_undirected_edges (const span< const Index > edges, const ChainEdgesOptions &options={}) |
| Chain a set of undirected edges into loops and chains. | |
| template<typename Scalar> | |
| Eigen::Matrix3< Scalar > | compute_normal_cotransform (const Eigen::Transform< Scalar, 3, Eigen::Affine > &transform) |
| Computes the normal (cotransform) matrix for a 3D affine transform. | |
| template<typename Scalar> | |
| Eigen::Matrix2< Scalar > | compute_normal_cotransform (const Eigen::Transform< Scalar, 2, Eigen::Affine > &transform) |
| Computes the normal (cotransform) matrix for a 2D affine transform. | |
| template<class T, size_t N> | |
| bool | operator== (const StackSet< T, N > &lhs, const StackSet< T, N > &rhs) |
| template<class T, size_t N> | |
| bool | operator== (const StackVector< T, N > &lhs, const StackVector< T, N > &rhs) |
Utility functions.
A simple loop is defined as a set of connected edges whose starting and ending vertex is the same.
All vertices involved in a simple loop has exact two incident edges. For example, the letter O contains one simple loop.
An ear loop is defined as a set of connected edges whose starting and ending vertex is the same. All vertices except the start/end vertex has exact two incident edges. For example, the digit 8 contains two ear loops.
A chain is defined as a set of connected edges whose starting and ending vertex is different. All vertices in a chain except the end points have exactly two incident edges. For example, the digit 2 contains one chain.
A chain is called a simple chain its both of its end points are not connected to any other edges. I.e. they have degree 1. For example, the = sign has two simple chains.
A chain is called a hanging chain if one of its end vertices is not connected to any other edges. For example, the digit 6 contains 1 hanging chain and a ear loop.
| ChainEdgesResult< Index > chain_directed_edges | ( | const span< const Index > | edges, |
| const ChainEdgesOptions & | options = {} ) |
#include <lagrange/utils/chain_edges.h>
Chain a set of directed edges into loops and chains.
This methods guarantees that all simple loops and simple chains are extracted. This method will also iteratively extract all ear loops and hanging chains.
| Index | The Index type. |
| edges | The input set of edges. |
| options | Options controlling the behavior of this function. |
Both loops and chains are stored as an array of edges indices if options.output_edge_index is true, otherwise, they are an array of vertex indices.
If options.output_edge_vertex is false and options.close_loop_with_identical_vertices is true, the first and last vertices of a loop is identical.
| ChainEdgesResult< Index > chain_undirected_edges | ( | const span< const Index > | edges, |
| const ChainEdgesOptions & | options = {} ) |
#include <lagrange/utils/chain_edges.h>
Chain a set of undirected edges into loops and chains.
This methods guarantees that all simple loops and simple chains are extracted. This method will also iteratively extract all ear loops and hanging chains.
| Index | The Index type. |
| edges | The input set of edges. |
| options | Options controlling the behavior of this function. |
Both loops and chains are stored as an array of edges indices if options.output_edge_index is true, otherwise, they are an array of vertex indices.
If options.output_edge_vertex is false and options.close_loop_with_identical_vertices is true, the first and last vertices of a loop is identical.
| Eigen::Matrix3< Scalar > compute_normal_cotransform | ( | const Eigen::Transform< Scalar, 3, Eigen::Affine > & | transform | ) |
#include <lagrange/utils/compute_normal_cotransform.h>
Computes the normal (cotransform) matrix for a 3D affine transform.
For transforming normals correctly under an affine transform M, one should use det(M) * M^{-T}, which equals the cofactor matrix of the linear part of M.
| [in] | transform | Input 3D affine transform. Since the translation part does not affect normal transformation, it is ignored and only the linear part is used. |
| Scalar | Scalar type. |
| Eigen::Matrix2< Scalar > compute_normal_cotransform | ( | const Eigen::Transform< Scalar, 2, Eigen::Affine > & | transform | ) |
#include <lagrange/utils/compute_normal_cotransform.h>
Computes the normal (cotransform) matrix for a 2D affine transform.
| [in] | transform | Input 2D affine transform. Since the translation part does not affect normal transformation, it is ignored and only the linear part is used. |
| Scalar | Scalar type. |