|
Lagrange
|
Main namespace for Lagrange. More...
Namespaces | |
| namespace | image |
| Basic image data structure. | |
| namespace | internal |
| nullptr_t, size_t, ptrdiff_t basic_ostream bad_weak_ptr extent, remove_extent, is_array, is_void, common_type move, forward, swap | |
| namespace | io |
| Mesh input/output. | |
| namespace | partitioning |
| Mesh partitioning using METIS. | |
| namespace | raycasting |
| Raycasting operations. | |
| namespace | subdivision |
| Subdivision surfaces. | |
| namespace | ui |
| Lagrange UI Viewer and mini 3D engine. | |
Classes | |
| class | ActingMeshGeometry |
| class | AdjacencyList |
| Adjacency list. More... | |
| class | Attribute |
| Derived attribute class that stores the actual information. More... | |
| class | AttributeBase |
| Base handle for attributes. More... | |
| struct | AttributeFilter |
| Helper object to filter attributes based on name, id, usage or element type. More... | |
| struct | AttributeMatcher |
| Helper object to match attributes based on usage, element type, and number of channels. More... | |
| struct | AttributeName |
| class | Attributes |
| Legacy attribute class. More... | |
| struct | BadCastError |
| An exception of this type is thrown when a lagrange::safe_cast<> fails. More... | |
| class | BitField |
| Bit field utility class. More... | |
| struct | ChainEdgesOptions |
| Options for chain_directed_edges and chain_undirected_edges. More... | |
| struct | ChainEdgesResult |
| Result struct holding the loops and chains extracted from a set of edges. More... | |
| struct | CloseSmallHolesOptions |
| Option struct for closing small holes. More... | |
| struct | ComponentOptions |
| Options to control connected components computation. More... | |
| struct | ComputePointcloudPCAOptions |
| class | Connectivity |
| class | copy_on_write_ptr |
| A handle type with copy-on-write semantics. More... | |
| struct | CornerNormalOptions |
| Option struct for computing per-corner mesh normals. More... | |
| struct | DihedralAngleOptions |
| Option struct for computing dihedral angles. More... | |
| struct | DijkstraDistanceOptions |
| Option struct for compute_dijkstra_distance. More... | |
| class | DisjointSets |
| Disjoint sets computation. More... | |
| class | DisjointSetsWithSize |
| struct | EdgeLengthOptions |
| struct | EdgeManifoldOptions |
| Option struct for computing edge manifold flags. More... | |
| class | EdgeType |
| struct | Error |
| Base exception for errors thrown by Lagrange functions. More... | |
| class | ExactPredicates |
| class | ExactPredicatesShewchuk |
| struct | FacetAreaOptions |
| Option struct for computing per-facet area. More... | |
| struct | FacetCentroidOptions |
| Option struct for computing per-facet centroid. More... | |
| struct | FacetCircumcenterOptions |
| struct | FacetNormalOptions |
| Option struct for computing per-facet mesh normals. More... | |
| struct | FacetVectorAreaOptions |
| struct | Frustum |
| An array of four planes that define a frustum. More... | |
| struct | FrustumSelectionOptions |
| Option struct for selecting facets. More... | |
| class | function_ref |
| A lightweight non-owning reference to a callable. More... | |
| class | function_ref< R(Args...)> |
| Specialization for function types. More... | |
| class | GenuineMeshGeometry |
| struct | GreedyColoringOptions |
| Option struct for computing dihedral angles. More... | |
| class | IndexedAttribute |
| Derived attribute class that stores the actual information. More... | |
| class | IndexedAttributes |
| Legacy indexed attribute class. More... | |
| struct | IsolineOptions |
| Options for isoline extraction/trimming. More... | |
| class | Mesh |
| struct | MeshAreaOptions |
| Option struct for computing mesh area. More... | |
| class | MeshBase |
| struct | MeshCentroidOptions |
| Option struct for computing mesh centroid. More... | |
| struct | MeshCovarianceOptions |
| Options struct for computing mesh covariance. More... | |
| class | MeshGeometry |
| class | MeshNavigation |
| This class is used to navigate elements of a mesh. More... | |
| struct | MeshTrait |
| MeshTrait class provide compiler check for different mesh types. More... | |
| struct | NormalOptions |
| Option struct for computing indexed mesh normals. More... | |
| struct | OrderedPairHash |
| Compute an order-dependent hash of a pair of values. More... | |
| struct | OrderedPairHash< std::pair< U, V > > |
| struct | OrientationOptions |
| Option struct for computing if edges are oriented. More... | |
| struct | OrientOptions |
| Options for orienting the facets of a mesh. More... | |
| struct | ParsingError |
| An exception of this type is thrown when a parsing error occurs. More... | |
| struct | PointcloudPCAOutput |
| class | ProgressCallback |
| A simple thread-safe progress callback. More... | |
| struct | RemapVerticesOptions |
| Remap vertices options. More... | |
| struct | RemoveDuplicateFacetOptions |
| Options for remove_duplicate_facets. More... | |
| struct | RemoveDuplicateVerticesOptions |
| Option struct for remove_duplicate_vertices. More... | |
| struct | RemoveNullAreaFacetsOptions |
| Option struct for remove_null_area_facets. More... | |
| struct | RescaleUVOptions |
| struct | SamplePointsOnSurfaceOutput |
| class | ScopedLogLevel |
| Changes the level of logger to something else in a scope. More... | |
| class | ScopedTimer |
| Similar to a VerboseTimer, but uses RAII to call tick()/tock(). More... | |
| struct | SeamEdgesOptions |
| Options for computing seam edges. More... | |
| struct | SelectFacetsByNormalSimilarityOptions |
| Option struct for selecting facets based on normal similarity. More... | |
| struct | SeparateByComponentsOptions |
Option settings for separate_by_components. More... | |
| struct | SeparateByFacetGroupsOptions |
Option settings for separate_by_facet_groups. More... | |
| class | SharedSpan |
| Shared span with ownership tracking. More... | |
| class | SilentMultiTimer |
| A timer that keeps track of a total time as well as intervals. More... | |
| class | SilentTimer |
| A timer that does not print after tock() More... | |
| class | SmallVector |
| Hybrid vector that uses the stack upto a maximum size, and the heap beyond that. More... | |
| struct | SplitLongEdgesOptions |
| struct | StackSet |
| Stack-allocated set with a maximum size. More... | |
| struct | StackVector |
| Stack-allocated vector with a maximum size. More... | |
| struct | StaticAssertableBool |
| Compilers might complain about static_assert(false, ""). More... | |
| struct | SubmeshOptions |
| Options for extract submesh. More... | |
| class | SurfaceMesh |
| A general purpose polygonal mesh class. More... | |
| struct | TangentBitangentOptions |
| Option struct for computing tangent and bitangent vectors. More... | |
| struct | TangentBitangentResult |
| Result type of the compute_tangent_bitangent function. More... | |
| struct | ThickenAndCloseOptions |
| Options for thicken_and_close_mesh. More... | |
| struct | TransformOptions |
| Options available when applying affine transforms to a mesh. More... | |
| struct | TriangulationOptions |
| struct | UnflipUVOptions |
| struct | UVChartOptions |
| struct | UVDistortionOptions |
| Option struct for compute uv distortion. More... | |
| struct | UVMeshOptions |
| class | value_ptr |
| Smart pointer with value semantics. More... | |
| class | VerboseTimer |
| Creates a verbose timer that prints after tock(). More... | |
| struct | VertexManifoldOptions |
| Option struct for computing manifold flags. More... | |
| struct | VertexNormalOptions |
| Option struct for computing per-vertex mesh normals. More... | |
| struct | VertexValenceOptions |
| Option struct for computing vertex valence. More... | |
Typedefs | |
| using | AttributeId = uint32_t |
| Identified to be used to access an attribute. | |
| using | Vertices2D = Eigen::Matrix<double, Eigen::Dynamic, 2, Eigen::RowMajor> |
| using | Vertices3D = Eigen::Matrix<double, Eigen::Dynamic, 3, Eigen::RowMajor> |
| using | Vertices2Df = Eigen::Matrix<float, Eigen::Dynamic, 2, Eigen::RowMajor> |
| using | Vertices3Df = Eigen::Matrix<float, Eigen::Dynamic, 3, Eigen::RowMajor> |
| using | Triangles = Eigen::Matrix<int, Eigen::Dynamic, 3, Eigen::RowMajor> |
| using | Quads = Eigen::Matrix<int, Eigen::Dynamic, 4, Eigen::RowMajor> |
| using | TriangleMesh3D = Mesh<Vertices3D, Triangles> |
| using | TriangleMesh2D = Mesh<Vertices2D, Triangles> |
| using | TriangleMesh3Df = Mesh<Vertices3Df, Triangles> |
| using | TriangleMesh2Df = Mesh<Vertices2Df, Triangles> |
| using | QuadMesh3D = Mesh<Vertices3D, Quads> |
| using | QuadMesh2D = Mesh<Vertices2D, Quads> |
| using | QuadMesh3Df = Mesh<Vertices3Df, Quads> |
| using | QuadMesh2Df = Mesh<Vertices2Df, Quads> |
| template<class T> | |
| using | ScalarOf = typename T::Scalar |
| template<class T> | |
| using | IndexOf = typename T::Index |
| template<class T> | |
| using | VertexArrayOf = typename T::VertexArray |
| template<class T> | |
| using | FacetArrayOf = typename T::FacetArray |
| template<class T> | |
| using | AttributeArrayOf = typename T::AttributeArray |
| template<typename Index, typename T> | |
| using | EdgeMap = std::unordered_map<EdgeType<Index>, T> |
| template<typename Index> | |
| using | EdgeSet = std::unordered_set<EdgeType<Index>> |
| template<typename MeshType> | |
| using | EdgeFacetMap |
| template<typename T> | |
| using | SafeVector = std::vector<T> |
| using | SurfaceMesh32f = SurfaceMesh<float, uint32_t> |
| using | SurfaceMesh32d = SurfaceMesh<double, uint32_t> |
| using | SurfaceMesh64f = SurfaceMesh<float, uint64_t> |
| using | SurfaceMesh64d = SurfaceMesh<double, uint64_t> |
| template<class T, span_CONFIG_EXTENT_TYPE Extent = ::nonstd::dynamic_extent> | |
| using | span = ::nonstd::span<T, Extent> |
| A bounds-safe view for sequences of objects. | |
| using | extent_t = span_CONFIG_EXTENT_TYPE |
| Span extent type. | |
| using | timestamp_type = std::chrono::time_point<std::chrono::steady_clock> |
Typedefs | |
| template<typename Scalar> | |
| using | RowMatrix = Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> |
| Type alias for row-major Eigen matrices. | |
| template<typename Scalar> | |
| using | RowMatrixView = Eigen::Map<RowMatrix<Scalar>, Eigen::Unaligned> |
| Type alias for row-major matrix views. | |
| template<typename Scalar> | |
| using | ConstRowMatrixView = const Eigen::Map<const RowMatrix<Scalar>, Eigen::Unaligned> |
| Type alias for row-major const matrix view. | |
| template<typename Scalar> | |
| using | Vector = Eigen::Matrix<Scalar, Eigen::Dynamic, 1> |
| Type alias for one-dimensional column Eigen vectors. | |
| template<typename Scalar> | |
| using | VectorView = Eigen::Map<Vector<Scalar>, Eigen::Unaligned> |
| Type alias for row-major vector view. | |
| template<typename Scalar> | |
| using | ConstVectorView = const Eigen::Map<const Vector<Scalar>, Eigen::Unaligned> |
| Type alias for row-major const vector view. | |
Enumerations | |
| enum | AttributeElement : int { Vertex = (1 << 0) , Facet = (1 << 1) , Edge = (1 << 2) , Corner = (1 << 3) , Value = (1 << 4) , Indexed = (1 << 5) } |
| Type of element to which the attribute is attached. More... | |
| enum class | AttributeUsage : uint16_t { Vector = (1 << 0) , Scalar = (1 << 1) , Position = (1 << 2) , Normal = (1 << 3) , Tangent = (1 << 4) , Bitangent = (1 << 5) , Color = (1 << 6) , UV = (1 << 7) , VertexIndex = (1 << 8) , FacetIndex = (1 << 9) , CornerIndex = (1 << 10) , EdgeIndex = (1 << 11) , String = (1 << 12) } |
| Usage tag indicating how the attribute should behave under mesh transformations. More... | |
| enum class | AttributeCreatePolicy : uint8_t { ErrorIfReserved , Force } |
| Policy for attribute creation with reserved attribute names. More... | |
| enum class | AttributeGrowthPolicy : uint8_t { ErrorIfExternal , AllowWithinCapacity , WarnAndCopy , SilentCopy } |
| Policy for growing external attribute buffers. More... | |
| enum class | AttributeShrinkPolicy : uint8_t { ErrorIfExternal , IgnoreIfExternal , WarnAndCopy , SilentCopy } |
| Policy for shrinking external attribute buffers. More... | |
| enum class | AttributeWritePolicy : uint8_t { ErrorIfReadOnly , WarnAndCopy , SilentCopy } |
| Policy for attempting to write to read-only external buffers. More... | |
| enum class | AttributeExportPolicy : uint8_t { CopyIfExternal , CopyIfUnmanaged , KeepExternalPtr , ErrorIfExternal } |
| Policy for exporting attributes that are views onto external buffers. More... | |
| enum class | AttributeCopyPolicy : uint8_t { CopyIfExternal , KeepExternalPtr , ErrorIfExternal } |
| Policy for copying attribute that are views onto external buffers. More... | |
| enum class | AttributeDeletePolicy : uint8_t { ErrorIfReserved , Force } |
| Policy for attribute deletion of reserved attribute names. More... | |
| enum class | AttributeCastPolicy : uint8_t { RemapInvalidIndices , RemapInvalidAlways , DoNotRemapInvalid } |
| Policy for remapping invalid values when casting to a different value type. More... | |
| enum class | AttributeReorientPolicy : uint8_t { None , Reorient } |
| Policy for updating attribute values when reorienting mesh facets. More... | |
| enum class | AttributeRefPolicy : uint8_t { Default , Force } |
| Policy for retrieving writable references to attribute buffers. More... | |
| enum class | AttributeValueType : uint8_t { LA_X_attribute_value_type_enum } |
| Enum describing at runtime the value type of an attribute. More... | |
| enum class | DistortionMetric { Dirichlet , InverseDirichlet , SymmetricDirichlet , AreaRatio , MIPS } |
| UV distortion metric type. More... | |
| enum class | NormalWeightingType : char { Uniform = 0 , CornerTriangleArea = 1 , Angle = 2 } |
| Weighting types for averaging corner normals around a vertex. More... | |
| enum class | ReorderingMethod { Lexicographic , Morton , Hilbert , None } |
| Mesh reordering method to apply before decimation. More... | |
| enum class | ConnectivityType { Vertex , Edge } |
| This type defines the condition when two facets are considered as "connected". More... | |
| enum class | MappingPolicy { Average , KeepFirst , Error } |
| Mapping policy control the behavior when two or more elements are mapped into the same output element. More... | |
| enum class | Orientation : short { Positive = 1 , Zero = 0 , Negative = -1 } |
Functions | |
| constexpr AttributeId | invalid_attribute_id () |
| Invalid attribute id. | |
| template<typename AttributeArray, typename Archive> | |
| void | serialize (Attributes< AttributeArray > &attributes, Archive &ar) |
| template<typename ValueType> | |
| constexpr AttributeValueType | make_attribute_value_type () |
| Creates an enum describing an attribute value type. | |
| template<typename ToScalar, typename ToIndex, typename FromScalar, typename FromIndex> | |
| SurfaceMesh< ToScalar, ToIndex > | cast (const SurfaceMesh< FromScalar, FromIndex > &source_mesh, const AttributeFilter &convertible_attributes={}, std::vector< std::string > *converted_attributes_names=nullptr) |
| Cast a mesh to a mesh of different scalar and/or index type. | |
| template<typename ToValueType, typename Scalar, typename Index> | |
| AttributeId | cast_attribute (SurfaceMesh< Scalar, Index > &mesh, AttributeId source_id, std::string_view target_name) |
| Cast an attribute in place to a different value type. | |
| template<typename ToValueType, typename Scalar, typename Index> | |
| AttributeId | cast_attribute (SurfaceMesh< Scalar, Index > &mesh, std::string_view source_name, std::string_view target_name) |
| Cast an attribute in place to a different value type. | |
| template<typename ToValueType, typename Scalar, typename Index> | |
| AttributeId | cast_attribute_in_place (SurfaceMesh< Scalar, Index > &mesh, AttributeId attribute_id) |
| Cast an attribute in place to a different value type. | |
| template<typename ToValueType, typename Scalar, typename Index> | |
| AttributeId | cast_attribute_in_place (SurfaceMesh< Scalar, Index > &mesh, std::string_view name) |
| Cast an attribute in place to a different value type. | |
| template<typename DerivedF, typename DerivedC, typename DerivedE, typename DerivedN> | |
| void | chain_corners_around_edges (const Eigen::MatrixBase< DerivedF > &facets, const Eigen::MatrixBase< DerivedC > &corner_to_edge, Eigen::PlainObjectBase< DerivedE > &edge_to_corner, Eigen::PlainObjectBase< DerivedN > &next_corner_around_edge) |
| Chains facet corners around edges of a mesh. | |
| template<typename DerivedF, typename DerivedE, typename DerivedN> | |
| void | chain_corners_around_vertices (typename DerivedF::Scalar num_vertices, const Eigen::MatrixBase< DerivedF > &facets, Eigen::PlainObjectBase< DerivedE > &vertex_to_corner, Eigen::PlainObjectBase< DerivedN > &next_corner_around_vertex) |
| Chains facet corners around vertices of a mesh. | |
| template<typename Scalar, typename Index> | |
| SurfaceMesh< Scalar, Index > | combine_meshes (std::initializer_list< const SurfaceMesh< Scalar, Index > * > meshes, bool preserve_attributes=true) |
| Combine multiple meshes into a single mesh. | |
| template<typename Scalar, typename Index> | |
| SurfaceMesh< Scalar, Index > | combine_meshes (span< const SurfaceMesh< Scalar, Index > > meshes, bool preserve_attributes=true) |
| Combine multiple meshes into a single mesh. | |
| template<typename Scalar, typename Index> | |
| SurfaceMesh< Scalar, Index > | combine_meshes (size_t num_meshes, function_ref< const SurfaceMesh< Scalar, Index > &(size_t)> get_mesh, bool preserve_attributes=true) |
| Combine multiple meshes into a single mesh. | |
| template<typename Derived1, typename Derived2> | |
| void | move_data (Eigen::DenseBase< Derived1 > &from, Eigen::DenseBase< Derived2 > &to) |
| Move data from one Eigen obj to another. | |
| template<class T> | |
| std::shared_ptr< T > | to_shared_ptr (std::unique_ptr< T > &&ptr) |
| Helper for automatic type deduction for unique_ptr to shared_ptr conversion. | |
| template<typename Scalar, typename Index> | |
| AttributeId | compute_facet_area (SurfaceMesh< Scalar, Index > &mesh, FacetAreaOptions options={}) |
| Compute per-facet area. | |
| template<typename Scalar, typename Index, int Dimension> | |
| AttributeId | compute_facet_area (SurfaceMesh< Scalar, Index > &mesh, const Eigen::Transform< Scalar, Dimension, Eigen::Affine > &transformation, FacetAreaOptions options={}) |
| Compute per-facet area. | |
| template<typename Scalar, typename Index> | |
| AttributeId | compute_facet_vector_area (SurfaceMesh< Scalar, Index > &mesh, FacetVectorAreaOptions options={}) |
| Compute per-facet vector area. | |
| template<typename Scalar, typename Index> | |
| Scalar | compute_mesh_area (const SurfaceMesh< Scalar, Index > &mesh, MeshAreaOptions options={}) |
| Compute mesh area. | |
| template<typename Scalar, typename Index, int Dimension> | |
| Scalar | compute_mesh_area (const SurfaceMesh< Scalar, Index > &mesh, const Eigen::Transform< Scalar, Dimension, Eigen::Affine > &transformation, MeshAreaOptions options={}) |
| Compute mesh area. | |
| template<typename Scalar, typename Index> | |
| Scalar | compute_uv_area (const SurfaceMesh< Scalar, Index > &mesh, MeshAreaOptions options={}) |
| Compute UV mesh area. | |
| template<typename PointType> | |
| auto | compute_barycentric_coordinates (const Eigen::MatrixBase< PointType > &v0, const Eigen::MatrixBase< PointType > &v1, const Eigen::MatrixBase< PointType > &v2, const Eigen::MatrixBase< PointType > &p) -> Eigen::Matrix< typename PointType::Scalar, 3, 1 > |
| template<typename Scalar, typename Index> | |
| AttributeId | compute_facet_centroid (SurfaceMesh< Scalar, Index > &mesh, FacetCentroidOptions options={}) |
| Compute per-facet centroid. | |
| template<typename Scalar, typename Index> | |
| void | compute_mesh_centroid (const SurfaceMesh< Scalar, Index > &mesh, span< Scalar > centroid, MeshCentroidOptions options={}) |
| Compute mesh centroid, where mesh centroid is defined as the weighted sum of facet centroids. | |
| template<typename Scalar, typename Index> | |
| size_t | compute_components (SurfaceMesh< Scalar, Index > &mesh, ComponentOptions options={}) |
| Compute connected components of an input mesh. | |
| template<typename Scalar, typename Index> | |
| size_t | compute_components (SurfaceMesh< Scalar, Index > &mesh, span< const Index > blocker_elements, ComponentOptions options={}) |
| Compute connected components of an input mesh. | |
| template<typename Scalar, typename Index> | |
| AttributeId | compute_dihedral_angles (SurfaceMesh< Scalar, Index > &mesh, const DihedralAngleOptions &options={}) |
| Computes dihedral angles for each edge in the mesh. | |
| template<typename Scalar, typename Index> | |
| std::optional< std::vector< Index > > | compute_dijkstra_distance (SurfaceMesh< Scalar, Index > &mesh, const DijkstraDistanceOptions< Scalar, Index > &options={}) |
| Computes dijkstra distance from a seed facet. | |
| template<typename Scalar, typename Index> | |
| AttributeId | compute_edge_lengths (SurfaceMesh< Scalar, Index > &mesh, const EdgeLengthOptions &options={}) |
| Computes edge lengths attribute. | |
| template<typename Scalar, typename Index> | |
| AttributeId | compute_facet_circumcenter (SurfaceMesh< Scalar, Index > &mesh, FacetCircumcenterOptions options={}) |
| Compute per-facet circumcenter. | |
| template<typename Scalar, typename Index> | |
| AdjacencyList< Index > | compute_facet_facet_adjacency (SurfaceMesh< Scalar, Index > &mesh) |
| Compute facet-facet adjacency information based on shared edges. | |
| template<typename Scalar, typename Index> | |
| AttributeId | compute_facet_normal (SurfaceMesh< Scalar, Index > &mesh, FacetNormalOptions options={}) |
| Compute facet normals. | |
| template<typename Scalar, typename Index> | |
| AttributeId | compute_greedy_coloring (SurfaceMesh< Scalar, Index > &mesh, const GreedyColoringOptions &options={}) |
| Compute a greedy graph coloring of the mesh. | |
| template<typename MeshType, typename Cloud, typename Indices> | |
| auto | compute_lift_operator_from_sampling (const MeshType &mesh, const Cloud &closest_points, const Indices &element_indices) |
| This compute the sparse bilinear map from mesh vertex attributes to point cloud attributes. | |
| template<typename MeshType, typename ClosestPoints> | |
| auto | compute_lift_operator_from_projections (const MeshType &mesh, const ClosestPoints &projections) |
| This compute the sparse bilinear map from mesh vertex attributes to point cloud attributes. | |
| template<typename Scalar, typename Index> | |
| std::array< std::array< Scalar, 3 >, 3 > | compute_mesh_covariance (const SurfaceMesh< Scalar, Index > &mesh, const MeshCovarianceOptions &options={}) |
| Compute the covariance matrix w.r.t. | |
| template<typename Scalar, typename Index> | |
| AttributeId | compute_normal (SurfaceMesh< Scalar, Index > &mesh, function_ref< bool(Index)> is_edge_smooth, span< const Index > cone_vertices={}, NormalOptions options={}) |
| Compute smooth normals based on specified sharp edges and cone vertices. | |
| template<typename Scalar, typename Index> | |
| AttributeId | compute_normal (SurfaceMesh< Scalar, Index > &mesh, function_ref< bool(Index, Index)> is_edge_smooth, span< const Index > cone_vertices={}, NormalOptions options={}) |
| Compute smooth normals based on specified sharp edges and cone vertices. | |
| template<typename Scalar, typename Index> | |
| AttributeId | compute_normal (SurfaceMesh< Scalar, Index > &mesh, Scalar feature_angle_threshold, span< const Index > cone_vertices={}, NormalOptions options={}) |
| Compute smooth normal based on specified dihedral angle threshold and cone vertices. | |
| template<typename Scalar> | |
| PointcloudPCAOutput< Scalar > | compute_pointcloud_pca (span< const Scalar > points, ComputePointcloudPCAOptions options={}) |
| Finds the principal components for a pointcloud. | |
| template<typename Scalar, typename Index> | |
| AttributeId | compute_seam_edges (SurfaceMesh< Scalar, Index > &mesh, AttributeId indexed_attribute_id, const SeamEdgesOptions &options={}) |
| Computes the seam edges for a given indexed attribute. | |
| template<typename Scalar, typename Index> | |
| TangentBitangentResult | compute_tangent_bitangent (SurfaceMesh< Scalar, Index > &mesh, TangentBitangentOptions options={}) |
| Compute mesh tangent and bitangent vectors orthogonal to the input mesh normals. | |
| template<typename Scalar, typename Index> | |
| size_t | compute_uv_charts (SurfaceMesh< Scalar, Index > &mesh, const UVChartOptions &options={}) |
| Compute UV charts of an input mesh. | |
| template<typename Scalar, typename Index> | |
| AttributeId | compute_uv_distortion (SurfaceMesh< Scalar, Index > &mesh, const UVDistortionOptions &options={}) |
| Compute uv distortion using the selected distortion measure. | |
| template<typename Scalar, typename Index> | |
| std::vector< std::pair< int32_t, int32_t > > | compute_uv_tile_list (const SurfaceMesh< Scalar, Index > &mesh) |
| Extract the list of all UV tiles that a mesh's parametrization spans. | |
| template<typename Scalar, typename Index> | |
| AttributeId | compute_vertex_normal (SurfaceMesh< Scalar, Index > &mesh, VertexNormalOptions options={}) |
| Compute per-vertex normals based on specified weighting type. | |
| template<typename Scalar, typename Index> | |
| AttributeId | compute_vertex_valence (SurfaceMesh< Scalar, Index > &mesh, VertexValenceOptions options={}) |
| Compute vertex valence. | |
| template<typename Scalar, typename Index> | |
| AdjacencyList< Index > | compute_vertex_vertex_adjacency (SurfaceMesh< Scalar, Index > &mesh) |
| Compute vertex-vertex adjacency information. | |
| template<typename Scalar, typename Index> | |
| AttributeId | compute_weighted_corner_normal (SurfaceMesh< Scalar, Index > &mesh, CornerNormalOptions option={}) |
| Compute corner normals. | |
| template<typename GeometryType> | |
| std::unique_ptr< Connectivity< GeometryType > > | compute_connectivity (const GeometryType &geometry) |
| template<typename DerivedF, typename DerivedC> | |
| Eigen::Index | corner_to_edge_mapping (const Eigen::MatrixBase< DerivedF > &F, Eigen::PlainObjectBase< DerivedC > &C2E) |
| Computes a mapping from mesh corners (k*f+i) to unique edge ids. | |
| template<typename DerivedV, typename DerivedF> | |
| std::unique_ptr< Mesh< DerivedV, DerivedF > > | create_empty_mesh () |
| template<typename DerivedV, typename DerivedF> | |
| auto | create_mesh (const Eigen::MatrixBase< DerivedV > &vertices, const Eigen::MatrixBase< DerivedF > &facets) |
| This function create a new mesh given the vertex and facet arrays by copying data into the Mesh object. | |
| template<typename DerivedV, typename DerivedF> | |
| std::unique_ptr< Mesh< DerivedV, DerivedF > > | create_mesh (Eigen::PlainObjectBase< DerivedV > &&vertices, Eigen::PlainObjectBase< DerivedF > &&facets) |
| This function create a new mesh given the vertex and facet arrays by moving data into the Mesh object. | |
| template<typename DerivedV, typename DerivedF> | |
| std::unique_ptr< Mesh< DerivedV, DerivedF > > | create_mesh (const Eigen::MatrixBase< DerivedV > &vertices, Eigen::MatrixBase< DerivedF > &&facets) |
| template<typename DerivedV, typename DerivedF> | |
| std::unique_ptr< Mesh< DerivedV, DerivedF > > | create_mesh (Eigen::MatrixBase< DerivedV > &&vertices, const Eigen::MatrixBase< DerivedF > &facets) |
| template<typename VertexArray, typename FacetArray> | |
| auto | wrap_with_mesh (const Eigen::MatrixBase< VertexArray > &vertices, const Eigen::MatrixBase< FacetArray > &facets) |
| This method creates a Mesh object that wraps around vertices and facets. | |
| template<typename VertexArray, typename FacetArray> | |
| void | wrap_with_mesh (const Eigen::MatrixBase< VertexArray > &&, const Eigen::MatrixBase< FacetArray > &&) |
| template<typename VertexArray, typename FacetArray> | |
| void | wrap_with_mesh (const Eigen::MatrixBase< VertexArray > &, const Eigen::MatrixBase< FacetArray > &&) |
| template<typename VertexArray, typename FacetArray> | |
| void | wrap_with_mesh (const Eigen::MatrixBase< VertexArray > &&, const Eigen::MatrixBase< FacetArray > &) |
| std::unique_ptr< TriangleMesh3D > LA_CORE_API | create_cube () |
| std::unique_ptr< TriangleMesh3D > LA_CORE_API | create_quad (bool with_center_vertex) |
| std::unique_ptr< TriangleMesh3D > LA_CORE_API | create_sphere (double refine_order=2) |
| template<typename MeshType> | |
| EdgeFacetMap< MeshType > | compute_edge_facet_map_in_active_facets (const MeshType &mesh, const std::unordered_set< typename MeshType::Index > &active_facets) |
| template<typename MeshType> | |
| EdgeFacetMap< MeshType > | compute_edge_facet_map_in_active_vertices (const MeshType &mesh, const std::unordered_set< typename MeshType::Index > &active_vertices) |
| template<typename Scalar, typename Index, typename DerivedV, typename DerivedF> | |
| SurfaceMesh< Scalar, Index > | eigen_to_surface_mesh (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F) |
| Create a SurfaceMesh from a igl-style pair of matrices (V, F). | |
| template<typename Scalar, typename Index> | |
| std::vector< std::vector< Index > > | extract_boundary_loops (const SurfaceMesh< Scalar, Index > &mesh) |
| Extract boundary loops from a surface mesh. | |
| template<typename Scalar, typename Index> | |
| SurfaceMesh< Scalar, Index > | extract_submesh (const SurfaceMesh< Scalar, Index > &mesh, span< const Index > selected_facets, const SubmeshOptions &options={}) |
| Extract a submesh that consists of a subset of the facets of the source mesh. | |
| template<typename Scalar, typename Index> | |
| std::vector< AttributeId > | filtered_attribute_ids (const SurfaceMesh< Scalar, Index > &mesh, const AttributeFilter &options) |
| Create a list of attribute ids corresponding to the given filter. | |
| template<typename Scalar, typename Index> | |
| SurfaceMesh< Scalar, Index > | filter_attributes (SurfaceMesh< Scalar, Index > source_mesh, const AttributeFilter &options={}) |
| Filters the attributes of mesh according to user specifications. | |
| template<typename Scalar, typename Index> | |
| std::optional< AttributeId > | find_matching_attribute (const SurfaceMesh< Scalar, Index > &mesh, const AttributeMatcher &options) |
| Finds the first attribute with the specified usage/element type/number of channels. | |
| template<typename Scalar, typename Index> | |
| std::optional< AttributeId > | find_matching_attribute (const SurfaceMesh< Scalar, Index > &mesh, AttributeUsage usage) |
| template<typename Scalar, typename Index> | |
| std::optional< AttributeId > | find_matching_attribute (const SurfaceMesh< Scalar, Index > &mesh, BitField< AttributeElement > element_types) |
| template<typename Scalar, typename Index> | |
| std::vector< AttributeId > | find_matching_attributes (const SurfaceMesh< Scalar, Index > &mesh, const AttributeMatcher &options) |
| Finds all attributes with the specified usage/element type/number of channels. | |
| template<typename Scalar, typename Index> | |
| std::vector< AttributeId > | find_matching_attributes (const SurfaceMesh< Scalar, Index > &mesh, AttributeUsage usage) |
| Finds all attributes with the specified usage. | |
| template<typename Scalar, typename Index> | |
| std::vector< AttributeId > | find_matching_attributes (const SurfaceMesh< Scalar, Index > &mesh, BitField< AttributeElement > element_types) |
| Finds all attributes with the specified element types. | |
| template<typename _VertexArray, typename _FacetArray, typename Archive> | |
| void | serialize (std::shared_ptr< MeshGeometry< _VertexArray, _FacetArray > > &geometry, Archive &ar) |
| template<typename DerivedF> | |
| EdgeType< typename DerivedF::Scalar > | get_opposite_edge (const Eigen::PlainObjectBase< DerivedF > &facets, typename DerivedF::Scalar fid, typename DerivedF::Scalar vid) |
| template<typename Scalar, typename Index> | |
| SurfaceMesh< Scalar, Index > | trim_by_isoline (const SurfaceMesh< Scalar, Index > &mesh, const IsolineOptions &options={}) |
| Trim a mesh by the isoline of an implicit function defined on the mesh vertices/corners. | |
| template<typename Scalar, typename Index> | |
| SurfaceMesh< Scalar, Index > | extract_isoline (const SurfaceMesh< Scalar, Index > &mesh, const IsolineOptions &options={}) |
| Extract the isoline of an implicit function defined on the mesh vertices/corners. | |
| LA_CORE_API spdlog::logger & | logger () |
| Retrieves the current logger. | |
| LA_CORE_API void | set_logger (std::shared_ptr< spdlog::logger > logger) |
| Setup a logger object to be used by Lagrange. | |
| template<typename _VertexArray, typename _FacetArray, typename Archive> | |
| void | serialize (Mesh< _VertexArray, _FacetArray > &mesh, Archive &ar) |
| template<size_t Dimension, typename Scalar, typename Index> | |
| Eigen::AlignedBox< Scalar, static_cast< int >(Dimension)> | mesh_bbox (const SurfaceMesh< Scalar, Index > &mesh) |
| Compute the axis-aligned bounding box of a mesh. | |
| template<typename Scalar, typename Index> | |
| void | close_small_holes (SurfaceMesh< Scalar, Index > &mesh, CloseSmallHolesOptions options={}) |
| Close small topological holes. | |
| template<typename Scalar, typename Index> | |
| std::vector< Index > | detect_degenerate_facets (const SurfaceMesh< Scalar, Index > &mesh) |
| Detects degenerate facets in a mesh. | |
| template<typename Scalar, typename Index> | |
| void | remove_degenerate_facets (SurfaceMesh< Scalar, Index > &mesh) |
| Removes degenerate facets from a mesh. | |
| template<typename Scalar, typename Index> | |
| void | remove_duplicate_facets (SurfaceMesh< Scalar, Index > &mesh, const RemoveDuplicateFacetOptions &opts={}) |
| Remove duplicate facets in the mesh. | |
| template<typename Scalar, typename Index> | |
| void | remove_duplicate_vertices (SurfaceMesh< Scalar, Index > &mesh, const RemoveDuplicateVerticesOptions &options={}) |
| Removes duplicate vertices from a mesh. | |
| template<typename Scalar, typename Index> | |
| void | remove_isolated_vertices (SurfaceMesh< Scalar, Index > &mesh) |
| Removes isolated vertices of a mesh. | |
| template<typename Scalar, typename Index> | |
| void | remove_null_area_facets (SurfaceMesh< Scalar, Index > &mesh, const RemoveNullAreaFacetsOptions &options={}) |
| Removes all facets with unsigned area <= options.null_area_threshold. | |
| template<typename Scalar, typename Index> | |
| void | remove_short_edges (SurfaceMesh< Scalar, Index > &mesh, Scalar threshold=0) |
| Collapse all edges shorter than a given tolerance. | |
| template<typename Scalar, typename Index> | |
| void | remove_topologically_degenerate_facets (SurfaceMesh< Scalar, Index > &mesh) |
| Remove topologically degenerate facets (i.e. | |
| template<typename Scalar, typename Index> | |
| void | rescale_uv_charts (SurfaceMesh< Scalar, Index > &mesh, const RescaleUVOptions &options={}) |
| Rescale UV charts such that they are isotropic to their 3D images. | |
| template<typename Scalar, typename Index> | |
| void | resolve_nonmanifoldness (SurfaceMesh< Scalar, Index > &mesh) |
| Resolve both non-manifold vertices and non-manifold edges in the input mesh. | |
| template<typename Scalar, typename Index> | |
| void | resolve_vertex_nonmanifoldness (SurfaceMesh< Scalar, Index > &mesh) |
| Resolve nonmanifold vertices by pulling disconnected 1-ring neighborhood apart. | |
| template<typename Scalar, typename Index> | |
| void | split_long_edges (SurfaceMesh< Scalar, Index > &mesh, SplitLongEdgesOptions options={}) |
Split edges that are longer than options.max_edge_length. | |
| template<typename Scalar, typename Index> | |
| void | unflip_uv_triangles (SurfaceMesh< Scalar, Index > &mesh, const UnflipUVOptions &options={}) |
| Unflip flipped UV triangles. | |
| template<typename Scalar, typename Index, typename MeshType> | |
| SurfaceMesh< Scalar, Index > | to_surface_mesh_copy (const MeshType &mesh) |
| Convert a legacy mesh object to a surface mesh object. | |
| template<typename Scalar, typename Index, typename MeshType> | |
| SurfaceMesh< Scalar, Index > | to_surface_mesh_wrap (MeshType &&mesh) |
| Wrap a legacy mesh object as a surface mesh object. | |
| template<typename MeshType, typename Scalar, typename Index> | |
| std::unique_ptr< MeshType > | to_legacy_mesh (const SurfaceMesh< Scalar, Index > &mesh) |
| Convert a surface mesh object to a legacy mesh object. | |
| template<typename _VertexArray, typename _FacetArray, typename Archive> | |
| void | serialize (MeshGeometry< _VertexArray, _FacetArray > &geometry, Archive &ar) |
| template<size_t Dimension = 3, typename Scalar, typename Index> | |
| auto | normalize_mesh_with_transform (SurfaceMesh< Scalar, Index > &mesh, const TransformOptions &options={}) -> Eigen::Transform< Scalar, Dimension, Eigen::Affine > |
| Normalize a mesh to fit in a unit box centered at the origin. | |
| template<typename Scalar, typename Index> | |
| void | normalize_mesh (SurfaceMesh< Scalar, Index > &mesh, const TransformOptions &options={}) |
| Normalize a mesh to fit in a unit box centered at the origin. | |
| template<size_t Dimension = 3, typename Scalar, typename Index> | |
| auto | normalize_meshes_with_transform (span< SurfaceMesh< Scalar, Index > * > meshes, const TransformOptions &options={}) -> Eigen::Transform< Scalar, Dimension, Eigen::Affine > |
| Normalize a list of meshes to fit in a unit box centered at the origin. | |
| template<typename Scalar, typename Index> | |
| void | normalize_meshes (span< SurfaceMesh< Scalar, Index > * > meshes, const TransformOptions &options={}) |
| Normalize a list of meshes to fit in a unit box centered at the origin. | |
| template<typename Scalar, typename Index> | |
| void | orient_outward (lagrange::SurfaceMesh< Scalar, Index > &mesh, const OrientOptions &options={}) |
| Orient the facets of a mesh so that the signed volume of each connected component is positive or negative. | |
| template<typename Scalar, typename Index> | |
| bool | is_oriented (const SurfaceMesh< Scalar, Index > &mesh) |
| Check if a mesh is oriented. | |
| template<typename Scalar, typename Index> | |
| AttributeId | compute_edge_is_oriented (SurfaceMesh< Scalar, Index > &mesh, const OrientationOptions &options={}) |
| Compute a mesh attribute indicating whether an edge is oriented. | |
| template<typename Scalar, typename Index> | |
| void | permute_facets (SurfaceMesh< Scalar, Index > &mesh, span< const Index > new_to_old) |
| Reorder facets of a mesh based on a given permutation. | |
| template<typename Scalar, typename Index> | |
| void | permute_vertices (SurfaceMesh< Scalar, Index > &mesh, span< const Index > new_to_old) |
| Reorder vertices of a mesh based on a given permutation. | |
| template<typename Scalar, typename Index> | |
| void | remap_vertices (SurfaceMesh< Scalar, Index > &mesh, span< const Index > forward_mapping, RemapVerticesOptions options={}) |
| Remap vertices of a mesh based on provided forward mapping. | |
| template<typename Scalar, typename Index> | |
| void | reorder_mesh (SurfaceMesh< Scalar, Index > &mesh, ReorderingMethod method) |
| Mesh reordering to improve cache locality. | |
| template<typename MeshType> | |
| SamplePointsOnSurfaceOutput< MeshType > | sample_points_on_surface (MeshType &mesh, const typename MeshType::Index approx_num_points, const typename MeshType::IndexList &active_facets) |
| template<typename MeshType> | |
| SamplePointsOnSurfaceOutput< MeshType > | sample_points_on_surface (MeshType &mesh, const typename MeshType::Index approx_num_points, const std::vector< bool > &is_facet_active) |
| template<typename MeshType> | |
| SamplePointsOnSurfaceOutput< MeshType > | sample_points_on_surface (MeshType &mesh, const typename MeshType::Index approx_num_points) |
| template<typename PointType> | |
| auto | segment_segment_squared_distance (const Eigen::MatrixBase< PointType > &U0, const Eigen::MatrixBase< PointType > &U1, const Eigen::MatrixBase< PointType > &V0, const Eigen::MatrixBase< PointType > &V1, Eigen::PlainObjectBase< PointType > &closest_pointU, Eigen::PlainObjectBase< PointType > &closest_pointV, ScalarOf< PointType > &lambdaU, ScalarOf< PointType > &lambdaV) -> ScalarOf< PointType > |
| Computes the squared distance between two N-d line segments, and the closest pair of points whose separation is this distance. | |
| template<typename Scalar, typename Index> | |
| AttributeId | select_facets_by_normal_similarity (SurfaceMesh< Scalar, Index > &mesh, const Index seed_facet_id, const SelectFacetsByNormalSimilarityOptions &options={}) |
| Given a seed facet, selects facets around it based on the change in triangle normals. | |
| template<typename Scalar, typename Index> | |
| bool | select_facets_in_frustum (SurfaceMesh< Scalar, Index > &mesh, const Frustum< Scalar > &frustum, const FrustumSelectionOptions &options={}) |
| Select all facets that intersect the cone/frustrum bounded by 4 planes defined by (n_i, p_i), where n_i is the plane normal and p_i is a point on the plane. | |
| template<typename Scalar, typename Index> | |
| std::vector< SurfaceMesh< Scalar, Index > > | separate_by_components (const SurfaceMesh< Scalar, Index > &mesh, const SeparateByComponentsOptions &options={}) |
| Separate a mesh by connected components. | |
| template<typename Scalar, typename Index> | |
| std::vector< SurfaceMesh< Scalar, Index > > | separate_by_facet_groups (const SurfaceMesh< Scalar, Index > &mesh, size_t num_groups, span< const Index > facet_group_indices, const SeparateByFacetGroupsOptions &options={}) |
| Extract a set of submeshes based on facet groups. | |
| template<typename Scalar, typename Index> | |
| std::vector< SurfaceMesh< Scalar, Index > > | separate_by_facet_groups (const SurfaceMesh< Scalar, Index > &mesh, span< const Index > facet_group_indices, const SeparateByFacetGroupsOptions &options={}) |
| Extract a set of submeshes based on facet groups. | |
| template<typename Scalar, typename Index> | |
| std::vector< SurfaceMesh< Scalar, Index > > | separate_by_facet_groups (const SurfaceMesh< Scalar, Index > &mesh, size_t num_groups, function_ref< Index(Index)> get_facet_group, const SeparateByFacetGroupsOptions &options={}) |
| Extract a set of submeshes based on facet groups. | |
| template<typename Scalar, typename Index> | |
| void | split_facets_by_material (SurfaceMesh< Scalar, Index > &mesh, std::string_view material_attribute_name) |
| Split mesh facets based on material labels. | |
| template<typename Scalar, typename Index> | |
| SurfaceMesh< Scalar, Index > | thicken_and_close_mesh (SurfaceMesh< Scalar, Index > input_mesh, const ThickenAndCloseOptions &options={}) |
| Thicken a mesh by offsetting it, and close the shape into a thick 3D solid. | |
| template<typename Scalar, typename Index> | |
| int | compute_euler (const SurfaceMesh< Scalar, Index > &mesh) |
| Compute Euler characteristic of a mesh. | |
| template<typename Scalar, typename Index> | |
| bool | is_closed (const SurfaceMesh< Scalar, Index > &mesh) |
| Check if a mesh is closed. | |
| template<typename Scalar, typename Index> | |
| bool | is_vertex_manifold (const SurfaceMesh< Scalar, Index > &mesh) |
| Check if a mesh is vertex-manifold. | |
| template<typename Scalar, typename Index> | |
| bool | is_edge_manifold (const SurfaceMesh< Scalar, Index > &mesh) |
| Check if a mesh is edge-manifold. | |
| template<typename Scalar, typename Index> | |
| bool | is_manifold (const SurfaceMesh< Scalar, Index > &mesh) |
| Check if a mesh is both vertex-manifold and edge-manifold. | |
| template<typename Scalar, typename Index> | |
| AttributeId | compute_vertex_is_manifold (SurfaceMesh< Scalar, Index > &mesh, const VertexManifoldOptions &options={}) |
Compute a mesh attribute of value type uint8_t indicating vertex manifoldness. | |
| template<typename Scalar, typename Index> | |
| AttributeId | compute_edge_is_manifold (SurfaceMesh< Scalar, Index > &mesh, const EdgeManifoldOptions &options={}) |
Compute a mesh attribute of value type uint8_t indicating edge manifoldness. | |
| template<typename Scalar, typename Index, int Dimension> | |
| void | transform_mesh (SurfaceMesh< Scalar, Index > &mesh, const Eigen::Transform< Scalar, Dimension, Eigen::Affine > &transform, const TransformOptions &options={}) |
| Apply an affine transform \( M \) to a mesh in-place. | |
| template<typename Scalar, typename Index, int Dimension> | |
| SurfaceMesh< Scalar, Index > | transformed_mesh (SurfaceMesh< Scalar, Index > mesh, const Eigen::Transform< Scalar, Dimension, Eigen::Affine > &transform, const TransformOptions &options={}) |
| Apply an affine transform to a mesh and return the transformed mesh. | |
| template<typename Scalar, typename Index> | |
| void | triangulate_polygonal_facets (SurfaceMesh< Scalar, Index > &mesh, const TriangulationOptions &options={}) |
| Triangulate polygonal facets of a mesh using a prescribed set of rules. | |
| LA_CORE_API void | set_breakpoint_enabled (bool enabled) |
| Sets whether to trigger a debugger breakpoint on assert failure. | |
| LA_CORE_API bool | is_breakpoint_enabled () |
| Returns whether to trigger a debugger breakpoint on assert failure. | |
| LA_CORE_API void | trigger_breakpoint () |
| Call to explicitly trigger a debugger breakpoint. | |
| LA_CORE_API bool | assertion_failed (const char *function, const char *file, unsigned int line, const char *condition, std::string_view message) |
| 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. | |
| LA_CORE_API void | enable_fpe () |
| Enable floating-point exceptions (useful for debugging). | |
| LA_CORE_API void | disable_fpe () |
| Disable previously-enabled fpe. | |
| template<typename R, typename... Args> | |
| constexpr void | swap (function_ref< R(Args...)> &lhs, function_ref< R(Args...)> &rhs) noexcept |
Swaps the referred callables of lhs and rhs. | |
| template<typename R, typename... Args> | |
| function_ref (R(*)(Args...)) -> function_ref< R(Args...)> | |
| Deduce function_ref type from a function pointer. | |
| template<typename Scalar> | |
| Scalar | sqr_minimum_distance (const Eigen::Vector2< Scalar > &a, const Eigen::Vector2< Scalar > &b, const Eigen::Vector2< Scalar > &p) |
| Returns the squared minimum distance between 2d line segment ab and point p. | |
| template<typename Scalar> | |
| std::array< Scalar, 2 > | triangle_circumcenter_2d (span< const Scalar, 2 > p1, span< const Scalar, 2 > p2, span< const Scalar, 2 > p3) |
| template<typename Scalar> | |
| Eigen::Vector2< Scalar > | triangle_circumcenter_2d (const Eigen::Vector2< Scalar > &p1, const Eigen::Vector2< Scalar > &p2, const Eigen::Vector2< Scalar > &p3) |
| template<typename Scalar> | |
| Eigen::Vector2< Scalar > | triangle_circumcenter (const Eigen::Vector2< Scalar > &p1, const Eigen::Vector2< Scalar > &p2, const Eigen::Vector2< Scalar > &p3) |
| template<typename Scalar, int _Rows, int _Cols> | |
| Scalar | cos_angle_between (const Eigen::Matrix< Scalar, _Rows, _Cols > &v1, const Eigen::Matrix< Scalar, _Rows, _Cols > &v2) |
| Returns the cosine of the angle between two 3d vectors. | |
| template<typename Scalar, int _Rows, int _Cols> | |
| Scalar | angle_between (const Eigen::Matrix< Scalar, _Rows, _Cols > &v1, const Eigen::Matrix< Scalar, _Rows, _Cols > &v2) |
| Returns the angle between two 3d vectors. | |
| template<typename Scalar, int _Rows, int _Cols> | |
| Eigen::Matrix< Scalar, _Rows, _Cols > | project_on_line (const Eigen::Matrix< Scalar, _Rows, _Cols > &v1, const Eigen::Matrix< Scalar, _Rows, _Cols > &v2) |
| Project the vector v1 on the line defined by its vector v2. | |
| template<typename Scalar, int _Rows, int _Cols> | |
| Eigen::Matrix< Scalar, _Rows, _Cols > | project_on_plane (const Eigen::Matrix< Scalar, _Rows, _Cols > &v, const Eigen::Matrix< Scalar, _Rows, _Cols > &n) |
| Project the vector on the plane defined by its normal n. | |
| template<typename Scalar, int _Rows, int _Cols> | |
| Scalar | projected_cos_angle_between (const Eigen::Matrix< Scalar, _Rows, _Cols > &v1, const Eigen::Matrix< Scalar, _Rows, _Cols > &v2, const Eigen::Matrix< Scalar, _Rows, _Cols > &n) |
| Returns the angle between the vectors v1 and v2 projected on the plane defined by its normal n. | |
| template<typename Scalar, int _Rows, int _Cols> | |
| Scalar | projected_angle_between (const Eigen::Matrix< Scalar, _Rows, _Cols > &v1, const Eigen::Matrix< Scalar, _Rows, _Cols > &v2, const Eigen::Matrix< Scalar, _Rows, _Cols > &n) |
| Returns the angle between the vectors v1 and v2 projected on the plane defined by its normal n. | |
| template<typename MeshType> | |
| auto | vector_between (const MeshType &mesh, typename MeshType::Index v1, typename MeshType::Index v2) |
| Returns the vector from v1 to v2. | |
| template<typename Scalar> | |
| void | orthogonal_frame (const Eigen::Matrix< Scalar, 3, 1 > &x, Eigen::Matrix< Scalar, 3, 1 > &y, Eigen::Matrix< Scalar, 3, 1 > &z) |
| Build an orthogonal frame given a single vector. | |
| template<typename Scalar> | |
| Eigen::Vector3< Scalar > | triangle_circumcenter_3d (const Eigen::Vector3< Scalar > &p1, const Eigen::Vector3< Scalar > &p2, const Eigen::Vector3< Scalar > &p3) |
| Returns the circumcenter of a 3D triangle. | |
| template<class T> | |
| void | hash_combine (size_t &seed, const T &v) |
| Hash an object v and combine it with an existing hash value seed. | |
| template<typename T> | |
| constexpr T | invalid () |
| You can use invalid<T>() to get a value that can represent "invalid" values, such as invalid indices or invalid float data. | |
| template<typename PointType> | |
| bool | point_on_segment (const Eigen::MatrixBase< PointType > &p, const Eigen::MatrixBase< PointType > &a, const Eigen::MatrixBase< PointType > &b) |
| Test if a point lies exactly on a segment [a,b] using exact predicates. | |
| template<typename PointType, typename PointType2> | |
| auto | point_segment_squared_distance (const Eigen::MatrixBase< PointType > &point, const Eigen::MatrixBase< PointType2 > &V0, const Eigen::MatrixBase< PointType2 > &V1, Eigen::PlainObjectBase< PointType > &closest_point, ScalarOf< PointType > &lambda0, ScalarOf< PointType > &lambda1) -> ScalarOf< PointType > |
| Computes the point closest to a given point in a nd segment. | |
| template<typename PointType> | |
| auto | point_segment_squared_distance (const Eigen::MatrixBase< PointType > &point, const Eigen::MatrixBase< PointType > &V0, const Eigen::MatrixBase< PointType > &V1) -> ScalarOf< PointType > |
| Computes the point closest to a given point in a nd segment. | |
| template<typename PointType, typename PointType2> | |
| auto | point_triangle_squared_distance (const Eigen::MatrixBase< PointType > &point, const Eigen::MatrixBase< PointType2 > &V0, const Eigen::MatrixBase< PointType2 > &V1, const Eigen::MatrixBase< PointType2 > &V2, Eigen::PlainObjectBase< PointType > &closest_point, ScalarOf< PointType > &lambda0, ScalarOf< PointType > &lambda1, ScalarOf< PointType > &lambda2) -> ScalarOf< PointType > |
| Computes the point closest to a given point in a nd triangle. | |
| template<typename PointType> | |
| auto | point_triangle_squared_distance (const Eigen::MatrixBase< PointType > &point, const Eigen::MatrixBase< PointType > &V0, const Eigen::MatrixBase< PointType > &V1, const Eigen::MatrixBase< PointType > &V2) -> ScalarOf< PointType > |
| Computes the squared distance between a point and a nd triangle. | |
| template<typename Scalar> | |
| Scalar | quad_area_2d (span< const Scalar, 2 > a, span< const Scalar, 2 > b, span< const Scalar, 2 > c, span< const Scalar, 2 > d) |
| Compute 2D quad signed area. | |
| template<typename Scalar> | |
| Scalar | quad_area_3d (span< const Scalar, 3 > a, span< const Scalar, 3 > b, span< const Scalar, 3 > c, span< const Scalar, 3 > d) |
| Compute 3D quad area. | |
| template<typename Index> | |
| internal::Range< Index > | range (Index end) |
| Returns an iterable object representing the range [0, end). | |
| template<typename Index> | |
| internal::Range< Index > | range (Index begin, Index end) |
| Returns an iterable object representing the range [begin, end). | |
| template<typename Index> | |
| internal::SparseRange< Index > | range_sparse (Index max, const std::vector< Index > &active) |
| Returns an iterable object representing a subset of the range [0, max). | |
| template<typename TargetType, typename SourceType> | |
| constexpr auto | safe_cast (SourceType value) -> std::enable_if_t<!std::is_same< SourceType, TargetType >::value, TargetType > |
Perform safe cast from SourceType to TargetType, where "safe" means: | |
| template<typename T> | |
| constexpr T | safe_cast (T value) |
| Safe cast specialization for TargetType == SourceType. | |
| template<typename TargetType> | |
| constexpr TargetType | safe_cast (bool value) |
| Safe cast specialization for bool. | |
| template<typename T, typename U> | |
| constexpr T | safe_cast_enum (const U u) |
| Casting an enum to scalar and vice versa. | |
| template<typename Callback> | |
| sg_detail::scope_guard< Callback > | make_scope_guard (Callback &&callback) noexcept(std::is_nothrow_constructible< Callback, Callback && >::value) |
| Creates a scope guard around a callable object. | |
| template<typename T, typename Y> | |
| SharedSpan< T > | make_shared_span (const std::shared_ptr< Y > &r, T *element_ptr, size_t size) |
| Created a SharedSpan object around an internal buffer of a parent object. | |
| 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) |
| template<typename Scalar, size_t N, typename Derived> | |
| void | vector_to_eigen (const std::vector< std::array< Scalar, N > > &from, Eigen::PlainObjectBase< Derived > &to) |
| template<typename Scalar, typename Derived> | |
| void | vector_to_eigen (const std::vector< std::pair< Scalar, Scalar > > &from, Eigen::PlainObjectBase< Derived > &to) |
| template<typename Scalar, int N, typename Derived> | |
| void | vector_to_eigen (const std::vector< Eigen::Matrix< Scalar, N, 1 > > &from, Eigen::PlainObjectBase< Derived > &to) |
| template<typename Scalar, int N, typename Derived> | |
| void | vector_to_eigen (const std::vector< Eigen::Matrix< Scalar, 1, N > > &from, Eigen::PlainObjectBase< Derived > &to) |
| template<typename Scalar> | |
| void | vector_to_eigen (const std::vector< Scalar > &from, Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > &to) |
| template<typename Scalar, typename Derived> | |
| void | flat_vector_to_eigen (const std::vector< Scalar > &from, Eigen::PlainObjectBase< Derived > &to, size_t rows, size_t cols, int row_major_flag=Eigen::RowMajor) |
| template<typename Derived, typename Scalar, size_t N> | |
| void | eigen_to_vector (const Eigen::MatrixBase< Derived > &from, std::vector< std::array< Scalar, N > > &to) |
| template<typename Derived, typename Scalar> | |
| void | eigen_to_vector (const Eigen::MatrixBase< Derived > &from, std::vector< std::pair< Scalar, Scalar > > &to) |
| template<typename Derived, typename Scalar> | |
| void | eigen_to_flat_vector (const Eigen::MatrixBase< Derived > &from, std::vector< Scalar > &to, int row_major_flag=Eigen::RowMajor) |
| LA_CORE_API std::vector< std::string > | string_split (const std::string &str, char delimiter) |
| Split a std::string using a prescribed delimiter. | |
| LA_CORE_API bool | starts_with (std::string_view str, std::string_view prefix) |
| Checks if the string begins with the given prefix. | |
| LA_CORE_API bool | ends_with (std::string_view str, std::string_view suffix) |
| Checks if the string ends with the given suffix. | |
| LA_CORE_API std::string | to_lower (std::string str) |
| Convert a string to lowercase. | |
| LA_CORE_API std::string | to_upper (std::string str) |
| Convert a string to uppercase. | |
| template<typename... Args> | |
| std::string | string_format (fmt::format_string< Args... > format, Args &&... args) |
| Format args according to the format string fmt, and return the result as a string. | |
| void | get_timestamp (timestamp_type *t) |
| timestamp_type | get_timestamp () |
| double | timestamp_diff_in_seconds (timestamp_type start, timestamp_type end) |
| double | timestamp_diff_in_seconds (timestamp_type start) |
| template<typename Scalar> | |
| Scalar | triangle_area_3d (span< const Scalar, 3 > a, span< const Scalar, 3 > b, span< const Scalar, 3 > c) |
| Compute 3D triangle area. | |
| template<typename Scalar> | |
| Scalar | triangle_area_2d (span< const Scalar, 2 > a, span< const Scalar, 2 > b, span< const Scalar, 2 > c) |
| Compute 2D triangle signed area. | |
| template<typename Scalar> | |
| Orientation | triangle_orientation (span< const Scalar, 2 > a, span< const Scalar, 2 > b, span< const Scalar, 2 > c) |
| Compute orientation of a 2D triangle. | |
| template<DistortionMetric metric, typename Scalar> | |
| Scalar | triangle_uv_distortion (span< const Scalar, 3 > V0, span< const Scalar, 3 > V1, span< const Scalar, 3 > V2, span< const Scalar, 2 > v0, span< const Scalar, 2 > v1, span< const Scalar, 2 > v2) |
| Compute uv distortion of a single triangle. | |
| template<typename Scalar> | |
| Scalar | triangle_uv_distortion (span< const Scalar, 3 > V0, span< const Scalar, 3 > V1, span< const Scalar, 3 > V2, span< const Scalar, 2 > v0, span< const Scalar, 2 > v1, span< const Scalar, 2 > v2, DistortionMetric metric) |
| Compute uv distortion of a single triangle. | |
| template<typename Scalar> | |
| Scalar | to_degrees (Scalar rad=1) |
| Convert radians to degrees. | |
| template<typename Scalar> | |
| Scalar | to_radians (Scalar deg=1) |
| Convert degrees to radians. | |
| template<typename T> | |
| int | sign (T val) |
| Get the sign of the value Returns either -1, 0, or 1. | |
| template<typename Scalar> | |
| Scalar | gaussian (Scalar x, Scalar sigma, Scalar center=0) |
| Simple evaluation of Gaussian function. | |
| template<class T, class... Args> | |
| value_ptr< T > | make_value_ptr (Args &&... args) |
| Helper function to create a value_ptr for a given type. | |
| template<typename Scalar, typename Index, typename UVScalar = Scalar> | |
| SurfaceMesh< UVScalar, Index > | uv_mesh_ref (SurfaceMesh< Scalar, Index > &mesh, const UVMeshOptions &options={}) |
| Extract a UV mesh reference from an input mesh. | |
| template<typename Scalar, typename Index, typename UVScalar = Scalar> | |
| SurfaceMesh< UVScalar, Index > | uv_mesh_view (const SurfaceMesh< Scalar, Index > &mesh, const UVMeshOptions &options={}) |
| Extract a UV mesh view from an input mesh. | |
| template<typename TargetScalar, typename TargetIndex, typename SourceScalar, typename SourceIndex> | |
| SurfaceMesh< TargetScalar, TargetIndex > | cast (const SurfaceMesh< SourceScalar, SourceIndex > &source_mesh, const AttributeFilter &convertible_attributes, std::vector< std::string > *converted_attributes_names) |
| template<typename Scalar, typename Index> | |
| size_t | compute_vertex_based_components (SurfaceMesh< Scalar, Index > &mesh, AttributeId id, span< const Index > blocker_vertices) |
| template<typename Scalar, typename Index> | |
| size_t | compute_edge_based_components (SurfaceMesh< Scalar, Index > &mesh, AttributeId id, span< const Index > blocker_edges) |
| void | exactinit () |
| double | orient2d (const double *pa, const double *pb, const double *pc) |
| double | orient3d (const double *pa, const double *pb, const double *pc, const double *pd) |
| double | incircle (const double *pa, const double *pb, const double *pc, const double *pd) |
| double | insphere (const double *pa, const double *pb, const double *pc, const double *pd, const double *pe) |
| int | grow_expansion (int elen, REAL *e, REAL b, REAL *h) |
| int | grow_expansion_zeroelim (int elen, REAL *e, REAL b, REAL *h) |
| int | expansion_sum (int elen, REAL *e, int flen, REAL *f, REAL *h) |
| int | expansion_sum_zeroelim1 (int elen, REAL *e, int flen, REAL *f, REAL *h) |
| int | expansion_sum_zeroelim2 (int elen, REAL *e, int flen, REAL *f, REAL *h) |
| int | fast_expansion_sum (int elen, REAL *e, int flen, REAL *f, REAL *h) |
| int | fast_expansion_sum_zeroelim (int elen, REAL *e, int flen, REAL *f, REAL *h) |
| int | linear_expansion_sum (int elen, REAL *e, int flen, REAL *f, REAL *h) |
| int | linear_expansion_sum_zeroelim (int elen, REAL *e, int flen, REAL *f, REAL *h) |
| int | scale_expansion (int elen, REAL *e, REAL b, REAL *h) |
| int | scale_expansion_zeroelim (int elen, REAL *e, REAL b, REAL *h) |
| int | compress (int elen, REAL *e, REAL *h) |
| REAL | estimate (int elen, REAL *e) |
| REAL | orient2dfast (REAL *pa, REAL *pb, REAL *pc) |
| REAL | orient2dexact (REAL *pa, REAL *pb, REAL *pc) |
| REAL | orient2dslow (REAL *pa, REAL *pb, REAL *pc) |
| REAL | orient2dadapt (const REAL *pa, const REAL *pb, const REAL *pc, REAL detsum) |
| REAL | orient2d (const REAL *pa, const REAL *pb, const REAL *pc) |
| REAL | orient3dfast (REAL *pa, REAL *pb, REAL *pc, REAL *pd) |
| REAL | orient3dexact (REAL *pa, REAL *pb, REAL *pc, REAL *pd) |
| REAL | orient3dslow (REAL *pa, REAL *pb, REAL *pc, REAL *pd) |
| REAL | orient3dadapt (const REAL *pa, const REAL *pb, const REAL *pc, const REAL *pd, REAL permanent) |
| REAL | orient3d (const REAL *pa, const REAL *pb, const REAL *pc, const REAL *pd) |
| REAL | incirclefast (REAL *pa, REAL *pb, REAL *pc, REAL *pd) |
| REAL | incircleexact (REAL *pa, REAL *pb, REAL *pc, REAL *pd) |
| REAL | incircleslow (REAL *pa, REAL *pb, REAL *pc, REAL *pd) |
| REAL | incircleadapt (const REAL *pa, const REAL *pb, const REAL *pc, const REAL *pd, REAL permanent) |
| REAL | incircle (const REAL *pa, const REAL *pb, const REAL *pc, const REAL *pd) |
| REAL | inspherefast (REAL *pa, REAL *pb, REAL *pc, REAL *pd, REAL *pe) |
| REAL | insphereexact (const REAL *pa, const REAL *pb, const REAL *pc, const REAL *pd, const REAL *pe) |
| REAL | insphereslow (REAL *pa, REAL *pb, REAL *pc, REAL *pd, REAL *pe) |
| REAL | insphereadapt (const REAL *pa, const REAL *pb, const REAL *pc, const REAL *pd, const REAL *pe, REAL permanent) |
| REAL | insphere (const REAL *pa, const REAL *pb, const REAL *pc, const REAL *pd, const REAL *pe) |
| template<typename Scalar, typename Index, int Dimension> | |
| void | transform_mesh_internal (SurfaceMesh< Scalar, Index > &mesh, const Eigen::Transform< Scalar, Dimension, Eigen::Affine > &transform, const TransformOptions &options, const BitField< AttributeUsage > &included_usages) |
| template<typename Scalar, typename Index> | |
| void | append_triangles_from_quad (const SurfaceMesh< Scalar, Index > &mesh, Index f, std::vector< Index > &new_to_old_corners, std::vector< Index > &new_to_old_facets) |
| template<typename Scalar, typename Index> | |
| Eigen::Vector3< Scalar > | facet_normal (const SurfaceMesh< Scalar, Index > &mesh, Index f) |
| template<typename Scalar, typename Index> | |
| auto | find_best_2d_axes (const SurfaceMesh< Scalar, Index > &mesh, Index f) |
| template<typename Scalar, typename Index> | |
| void | append_triangles_from_polygon (SurfaceMesh< Scalar, Index > &mesh, Index f, std::vector< std::array< Scalar, 2 > > &polygon, mapbox::detail::Earcut< Index > &earcut, std::vector< Index > &new_to_old_corners, std::vector< Index > &new_to_old_facets) |
| template<typename Scalar, typename Index> | |
| void | triangulate_polygonal_facets_earcut (SurfaceMesh< Scalar, Index > &mesh) |
| template<typename Scalar, typename Index> | |
| void | triangulate_polygonal_facets_centroid_fan (SurfaceMesh< Scalar, Index > &mesh) |
| LA_SURFACE_MESH_SCALAR_X (triangle_uv_distortion, 0) | |
| template<typename Scalar, typename Index> | |
| void | weld_indexed_attribute (SurfaceMesh< Scalar, Index > &mesh, AttributeId attr_id, const WeldOptions &options) |
| template<typename DerivedV, typename DerivedE> | |
| void | save_graph_off (const fs::path &filename, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedE > &E) |
| Saves a 2D undirected graph (V,E) using off format. | |
| template<typename DerivedV, typename DerivedE> | |
| void | save_graph (const fs::path &filename, const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedE > &E) |
| Saves a 2D undirected graph (V,E) based on filename extension. | |
Sequential iteration for read operations | |
| template<std::underlying_type_t< AttributeElement > mask = BitField<AttributeElement>::all(), typename Visitor, typename Scalar, typename Index> | |
| void | seq_foreach_named_attribute_read (const SurfaceMesh< Scalar, Index > &mesh, Visitor &&vis) |
| Applies a function to each attribute of a mesh. | |
| template<std::underlying_type_t< AttributeElement > mask = BitField<AttributeElement>::all(), typename Visitor, typename Scalar, typename Index> | |
| void | seq_foreach_attribute_read (const SurfaceMesh< Scalar, Index > &mesh, Visitor &&vis) |
| Applies a function to each attribute of a mesh. | |
Sequential iteration for write operations | |
| template<std::underlying_type_t< AttributeElement > mask = BitField<AttributeElement>::all(), typename Visitor, typename Scalar, typename Index> | |
| void | seq_foreach_named_attribute_write (SurfaceMesh< Scalar, Index > &mesh, Visitor &&vis) |
| Applies a function to each attribute of a mesh. | |
| template<std::underlying_type_t< AttributeElement > mask = BitField<AttributeElement>::all(), typename Visitor, typename Scalar, typename Index> | |
| void | seq_foreach_attribute_write (SurfaceMesh< Scalar, Index > &mesh, Visitor &&vis) |
| Applies a function to each attribute of a mesh. | |
Parallel iteration for read operations | |
| template<std::underlying_type_t< AttributeElement > mask = BitField<AttributeElement>::all(), typename Visitor, typename Scalar, typename Index> | |
| void | par_foreach_named_attribute_read (const SurfaceMesh< Scalar, Index > &mesh, Visitor &&vis) |
| Applies a function in parallel to each attribute of a mesh. | |
| template<std::underlying_type_t< AttributeElement > mask = BitField<AttributeElement>::all(), typename Visitor, typename Scalar, typename Index> | |
| void | par_foreach_attribute_read (const SurfaceMesh< Scalar, Index > &mesh, Visitor &&vis) |
| Applies a function in parallel to each attribute of a mesh. | |
Parallel iteration for write operations | |
| template<std::underlying_type_t< AttributeElement > mask = BitField<AttributeElement>::all(), typename Visitor, typename Scalar, typename Index> | |
| void | par_foreach_named_attribute_write (SurfaceMesh< Scalar, Index > &mesh, Visitor &&vis) |
| Applies a function in parallel to each attribute of a mesh. | |
| template<std::underlying_type_t< AttributeElement > mask = BitField<AttributeElement>::all(), typename Visitor, typename Scalar, typename Index> | |
| void | par_foreach_attribute_write (SurfaceMesh< Scalar, Index > &mesh, Visitor &&vis) |
| Applies a function in parallel to each attribute of a mesh. | |
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. | |
| 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. | |
| 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. | |
| 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. | |
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. | |
| 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. | |
Generic attribute views | |
| template<typename ValueType> | |
| RowMatrixView< ValueType > | matrix_ref (Attribute< ValueType > &attribute) |
| Returns a writable view of a given attribute in the form of an Eigen matrix. | |
| template<typename ValueType> | |
| ConstRowMatrixView< ValueType > | matrix_view (const Attribute< ValueType > &attribute) |
| Returns a read-only view of a given attribute in the form of an Eigen matrix. | |
| template<typename ValueType> | |
| VectorView< ValueType > | vector_ref (Attribute< ValueType > &attribute) |
| Returns a writable view of a scalar attribute in the form of an Eigen vector. | |
| template<typename ValueType> | |
| ConstVectorView< ValueType > | vector_view (const Attribute< ValueType > &attribute) |
| Returns a read-only view of a scalar attribute in the form of an Eigen vector. | |
| template<typename ValueType> | |
| RowMatrixView< ValueType > | reshaped_ref (Attribute< ValueType > &attribute, size_t num_cols) |
| Returns a writable view of a given single-channel attribute in the form of an Eigen matrix with a prescribed number of columns. | |
| template<typename ValueType> | |
| ConstRowMatrixView< ValueType > | reshaped_view (const Attribute< ValueType > &attribute, size_t num_cols) |
| Returns a read-only view of a given single-channel attribute in the form of an Eigen matrix with a prescribed number of columns. | |
Generic attribute views (mesh) | |
| template<typename ValueType, typename Scalar, typename Index> | |
| RowMatrixView< ValueType > | attribute_matrix_ref (SurfaceMesh< Scalar, Index > &mesh, std::string_view name) |
| Returns a writable view of a mesh attribute in the form of an Eigen matrix. | |
| template<typename ValueType, typename Scalar, typename Index> | |
| RowMatrixView< ValueType > | attribute_matrix_ref (SurfaceMesh< Scalar, Index > &mesh, AttributeId id) |
| Returns a writable view of a mesh attribute in the form of an Eigen matrix. | |
| template<typename ValueType, typename Scalar, typename Index> | |
| ConstRowMatrixView< ValueType > | attribute_matrix_view (const SurfaceMesh< Scalar, Index > &mesh, std::string_view name) |
| Returns a read-only view of a mesh attribute in the form of an Eigen matrix. | |
| template<typename ValueType, typename Scalar, typename Index> | |
| ConstRowMatrixView< ValueType > | attribute_matrix_view (const SurfaceMesh< Scalar, Index > &mesh, AttributeId id) |
| Returns a read-only view of a mesh attribute in the form of an Eigen matrix. | |
| template<typename ValueType, typename Scalar, typename Index> | |
| VectorView< ValueType > | attribute_vector_ref (SurfaceMesh< Scalar, Index > &mesh, std::string_view name) |
| Returns a writable view of a mesh attribute in the form of an Eigen vector. | |
| template<typename ValueType, typename Scalar, typename Index> | |
| VectorView< ValueType > | attribute_vector_ref (SurfaceMesh< Scalar, Index > &mesh, AttributeId id) |
| Returns a writable view of a mesh attribute in the form of an Eigen vector. | |
| template<typename ValueType, typename Scalar, typename Index> | |
| ConstVectorView< ValueType > | attribute_vector_view (const SurfaceMesh< Scalar, Index > &mesh, std::string_view name) |
| Returns a read-only view of a mesh attribute in the form of an Eigen vector. | |
| template<typename ValueType, typename Scalar, typename Index> | |
| ConstVectorView< ValueType > | attribute_vector_view (const SurfaceMesh< Scalar, Index > &mesh, AttributeId id) |
| Returns a read-only view of a mesh attribute in the form of an Eigen vector. | |
Specific attribute views | |
| template<typename Scalar, typename Index> | |
| RowMatrixView< Scalar > | vertex_ref (SurfaceMesh< Scalar, Index > &mesh) |
| Returns a writable view of the mesh vertices in the form of an Eigen matrix. | |
| template<typename Scalar, typename Index> | |
| ConstRowMatrixView< Scalar > | vertex_view (const SurfaceMesh< Scalar, Index > &mesh) |
| Returns a read-only view of the mesh vertices in the form of an Eigen matrix. | |
| template<typename Scalar, typename Index> | |
| RowMatrixView< Index > | facet_ref (SurfaceMesh< Scalar, Index > &mesh) |
| Returns a writable view of a mesh facets in the form of an Eigen matrix. | |
| template<typename Scalar, typename Index> | |
| ConstRowMatrixView< Index > | facet_view (const SurfaceMesh< Scalar, Index > &mesh) |
| Returns a read-only view of a mesh facets in the form of an Eigen matrix. | |
Main namespace for Lagrange.
This header exposes functionality of previously registered mesh types To register new mesh type, include <lagrange/ui/utils/mesh.impl.h> and call register_mesh_type<MeshType>
Events triggered by the default systems Use ui::on<Event>(registry, [](Event& e){}) to register a listener Use ui::publish<Event>(registry, args ...) to trigger a custom event See <lagrange/ui/utils/events.h> for more details.
Private methods.
Utility functions that don't belong anywhere else.
Evaluates a function for each mesh element and stores the result as an attribute.
Consider refactoring this file if it becomes too big, or categories emerge.
| using EdgeFacetMap |
|
strong |
|
strong |
| void chain_corners_around_edges | ( | const Eigen::MatrixBase< DerivedF > & | facets, |
| const Eigen::MatrixBase< DerivedC > & | corner_to_edge, | ||
| Eigen::PlainObjectBase< DerivedE > & | edge_to_corner, | ||
| Eigen::PlainObjectBase< DerivedN > & | next_corner_around_edge ) |
Chains facet corners around edges of a mesh.
The mesh is assumed have polygonal faces of constant degree k. There are C = F * k facet corners in this mesh.
| [in] | facets | F x k array of facet indices. |
| [in] | corner_to_edge | C x 1 array mapping facet corners to edge indices. |
| [out] | edge_to_corner | E x 1 array of first facet corner in the chain starting from a given edge. |
| [out] | next_corner_around_edge | C x 1 array of next facet corner in the chain at a given facet corner. |
| DerivedF | Type of facet array. |
| DerivedC | Type of corner to edge vector. |
| DerivedE | Type of edge to corner vector. |
| DerivedN | Type of next corner vector. |
| void chain_corners_around_vertices | ( | typename DerivedF::Scalar | num_vertices, |
| const Eigen::MatrixBase< DerivedF > & | facets, | ||
| Eigen::PlainObjectBase< DerivedE > & | vertex_to_corner, | ||
| Eigen::PlainObjectBase< DerivedN > & | next_corner_around_vertex ) |
Chains facet corners around vertices of a mesh.
The mesh is assumed have polygonal faces of constant degree k. There are C = F * k facet corners in this mesh.
| [in] | num_vertices | Number of vertices in the mesh. This information is necessary since there may be isolated vertices, and thus computing it from the facet array may be misleading. |
| [in] | facets | F x k array of facet indices. |
| [out] | vertex_to_corner | E x 1 array of first facet corner in the chain starting from a given vertex. |
| [out] | next_corner_around_vertex | C x 1 array of next facet corner in the chain at a given facet corner. |
| DerivedF | Type of facet array. |
| DerivedE | Type of vertex to corner vector. |
| DerivedN | Type of next corner vector. |
| void move_data | ( | Eigen::DenseBase< Derived1 > & | from, |
| Eigen::DenseBase< Derived2 > & | to ) |
Move data from one Eigen obj to another.
Both objects will be in valid state after the move.
| auto compute_lift_operator_from_sampling | ( | const MeshType & | mesh, |
| const Cloud & | closest_points, | ||
| const Indices & | element_indices ) |
This compute the sparse bilinear map from mesh vertex attributes to point cloud attributes.
Input points are supposed to lie on facets on the input mesh. Each row of element_indices is a input triangle index of which the point at the same row is supposed to lie. It uses barycentric coordinates on each triangle to fill in coeffs of a sparse matrix which is then returned. This bilinear sparse mapping (a.k.a. the returned sparse matrix) can used extend mesh defined fields to fields defined in R^3. This is useful for interpolating positions or scalar curvatures to a sampled point cloud for example. This is suited for use with sampling functions like random_sample_uniform that naturally build the third arg.
| [in] | mesh | Input triangular mesh. |
| [in] | closest_points | Input point cloud. should lie on input mesh. |
| [in] | element_indices | Input mesh triangle indices for each point of the input point cloud. |
| auto compute_lift_operator_from_projections | ( | const MeshType & | mesh, |
| const ClosestPoints & | projections ) |
This compute the sparse bilinear map from mesh vertex attributes to point cloud attributes.
It uses barycentric coordinates on each triangle to fill in coeffs of a sparse matrix which is then returned. This bilinear sparse mapping (a.k.a. the returned sparse matrix) can used extend mesh defined fields to fields defined in R^3. This is useful for interpolating positions or scalar curvatures to a sampled point cloud for example. This is suited for use with bvh structure whose data return by batch_query can be used as the second arg.
| [in] | mesh | input triangular mesh. |
| [in] | projections | projections data returned by a call to BVH batch_query. |
| Eigen::Index corner_to_edge_mapping | ( | const Eigen::MatrixBase< DerivedF > & | F, |
| Eigen::PlainObjectBase< DerivedC > & | C2E ) |
Computes a mapping from mesh corners (k*f+i) to unique edge ids.
| [in] | F | F x k matrix of facet indices. |
| [out] | C2E | F*k vector of unique edge ids per corner. |
| DerivedF | Type of facet array. |
| DerivedC | Type of corner to edge vector. |
| auto create_mesh | ( | const Eigen::MatrixBase< DerivedV > & | vertices, |
| const Eigen::MatrixBase< DerivedF > & | facets ) |
This function create a new mesh given the vertex and facet arrays by copying data into the Mesh object.
Both arrays can be of type Eigen::Matrix or Eigen::Map.
| std::unique_ptr< Mesh< DerivedV, DerivedF > > create_mesh | ( | Eigen::PlainObjectBase< DerivedV > && | vertices, |
| Eigen::PlainObjectBase< DerivedF > && | facets ) |
This function create a new mesh given the vertex and facet arrays by moving data into the Mesh object.
Both arrays must be of type Eigen::Matrix.
| auto wrap_with_mesh | ( | const Eigen::MatrixBase< VertexArray > & | vertices, |
| const Eigen::MatrixBase< FacetArray > & | facets ) |
This method creates a Mesh object that wraps around vertices and facets.
Warning: vertices and facets are referenced instead of copied, and thus they have to be valid throughout the duration of the lifetime of the object. It is the user's responsibility of ensure it is the case.
| Scalar cos_angle_between | ( | const Eigen::Matrix< Scalar, _Rows, _Cols > & | v1, |
| const Eigen::Matrix< Scalar, _Rows, _Cols > & | v2 ) |
Returns the cosine of the angle between two 3d vectors.
Assumes both vectors are normalized (unit vector).
| Eigen::Matrix< Scalar, _Rows, _Cols > project_on_line | ( | const Eigen::Matrix< Scalar, _Rows, _Cols > & | v1, |
| const Eigen::Matrix< Scalar, _Rows, _Cols > & | v2 ) |
Project the vector v1 on the line defined by its vector v2.
Assumes the vector v2 is normalized (unit vector).
| Eigen::Matrix< Scalar, _Rows, _Cols > project_on_plane | ( | const Eigen::Matrix< Scalar, _Rows, _Cols > & | v, |
| const Eigen::Matrix< Scalar, _Rows, _Cols > & | n ) |
Project the vector on the plane defined by its normal n.
Assumes the normal n is a unit vector.
| Scalar projected_cos_angle_between | ( | const Eigen::Matrix< Scalar, _Rows, _Cols > & | v1, |
| const Eigen::Matrix< Scalar, _Rows, _Cols > & | v2, | ||
| const Eigen::Matrix< Scalar, _Rows, _Cols > & | n ) |
Returns the angle between the vectors v1 and v2 projected on the plane defined by its normal n.
Assumes the normal n is a unit vector.
| Scalar projected_angle_between | ( | const Eigen::Matrix< Scalar, _Rows, _Cols > & | v1, |
| const Eigen::Matrix< Scalar, _Rows, _Cols > & | v2, | ||
| const Eigen::Matrix< Scalar, _Rows, _Cols > & | n ) |
Returns the angle between the vectors v1 and v2 projected on the plane defined by its normal n.
Assumes the normal n is a unit vector.
| auto vector_between | ( | const MeshType & | mesh, |
| typename MeshType::Index | v1, | ||
| typename MeshType::Index | v2 ) |
Returns the vector from v1 to v2.
| [in] | v1 | first vertex index (from). |
| [in] | v2 | second vertex index (to) |
| void orthogonal_frame | ( | const Eigen::Matrix< Scalar, 3, 1 > & | x, |
| Eigen::Matrix< Scalar, 3, 1 > & | y, | ||
| Eigen::Matrix< Scalar, 3, 1 > & | z ) |
Build an orthogonal frame given a single vector.
| [in] | x | First vector of the frame. |
| [out] | y | Second vector of the frame. |
| [out] | z | Third vector of the frame. |
| Scalar | Scalar type. |
| Eigen::Vector3< Scalar > triangle_circumcenter_3d | ( | const Eigen::Vector3< Scalar > & | p1, |
| const Eigen::Vector3< Scalar > & | p2, | ||
| const Eigen::Vector3< Scalar > & | p3 ) |
Returns the circumcenter of a 3D triangle.
| Scalar | Scalar type. |
| [in] | p1 | First vertex of the triangle. |
| [in] | p2 | Second vertex of the triangle. |
| [in] | p3 | Third vertex of the triangle. |
| bool point_on_segment | ( | const Eigen::MatrixBase< PointType > & | p, |
| const Eigen::MatrixBase< PointType > & | a, | ||
| const Eigen::MatrixBase< PointType > & | b ) |
Test if a point lies exactly on a segment [a,b] using exact predicates.
If the points are collinear, each individual coordinate is examined to determine if the query point lies inside the segment or outside of it.
| [in] | p | Query point. |
| [in] | a | First segment endpoint. |
| [in] | b | Second segment endpoint. |
| PointType | Point type. |
| auto point_segment_squared_distance | ( | const Eigen::MatrixBase< PointType > & | point, |
| const Eigen::MatrixBase< PointType2 > & | V0, | ||
| const Eigen::MatrixBase< PointType2 > & | V1, | ||
| Eigen::PlainObjectBase< PointType > & | closest_point, | ||
| ScalarOf< PointType > & | lambda0, | ||
| ScalarOf< PointType > & | lambda1 ) -> ScalarOf<PointType> |
Computes the point closest to a given point in a nd segment.
| [in] | point | the query point |
| [in] | V0 | first extremity of the segment |
| [in] | V1 | second extremity of the segment |
| [out] | closest_point | the point closest to point in the segment [V0, V1] |
| [out] | lambda0 | barycentric coordinate of the closest point relative to V0 |
| [out] | lambda1 | barycentric coordinate of the closest point relative to V1 |
| PointType | the class that represents the points. |
V0, V1] | auto point_segment_squared_distance | ( | const Eigen::MatrixBase< PointType > & | point, |
| const Eigen::MatrixBase< PointType > & | V0, | ||
| const Eigen::MatrixBase< PointType > & | V1 ) -> ScalarOf<PointType> |
Computes the point closest to a given point in a nd segment.
| [in] | point | the query point |
| [in] | V0 | first extremity of the segment |
| [in] | V1 | second extremity of the segment |
| PointType | the class that represents the points. |
V0, V1] | auto point_triangle_squared_distance | ( | const Eigen::MatrixBase< PointType > & | point, |
| const Eigen::MatrixBase< PointType2 > & | V0, | ||
| const Eigen::MatrixBase< PointType2 > & | V1, | ||
| const Eigen::MatrixBase< PointType2 > & | V2, | ||
| Eigen::PlainObjectBase< PointType > & | closest_point, | ||
| ScalarOf< PointType > & | lambda0, | ||
| ScalarOf< PointType > & | lambda1, | ||
| ScalarOf< PointType > & | lambda2 ) -> ScalarOf<PointType> |
Computes the point closest to a given point in a nd triangle.
See http://www.geometrictools.com/LibMathematics/Distance/Distance.html
| [in] | point | the query point |
| [in] | V0 | first vertex of the triangle |
| [in] | V1 | second vertex of the triangle |
| [in] | V2 | third vertex of the triangle |
| [out] | closest_point | the point closest to point in the triangle (V0, V1, V2) |
| [out] | lambda0 | barycentric coordinate of the closest point relative to V0 |
| [out] | lambda1 | barycentric coordinate of the closest point relative to V1 |
| [out] | lambda2 | barycentric coordinate of the closest point relative to V2 |
| PointType | the class that represents the points. |
V0, V1, V2) | auto point_triangle_squared_distance | ( | const Eigen::MatrixBase< PointType > & | point, |
| const Eigen::MatrixBase< PointType > & | V0, | ||
| const Eigen::MatrixBase< PointType > & | V1, | ||
| const Eigen::MatrixBase< PointType > & | V2 ) -> ScalarOf<PointType> |
Computes the squared distance between a point and a nd triangle.
See http://www.geometrictools.com/LibMathematics/Distance/Distance.html
| [in] | point | the query point |
| [in] | V0 | first vertex of the triangle |
| [in] | V1 | second vertex of the triangle |
| [in] | V2 | third vertex of the triangle |
| PointType | the class that represents the points. |
V0, V1, V2) | Scalar quad_area_2d | ( | span< const Scalar, 2 > | a, |
| span< const Scalar, 2 > | b, | ||
| span< const Scalar, 2 > | c, | ||
| span< const Scalar, 2 > | d ) |
Compute 2D quad signed area.
| Scalar | The scalar type. |
| a,b,c,d | Quad vertex coordinates in counterclockwise order. |
| Scalar quad_area_3d | ( | span< const Scalar, 3 > | a, |
| span< const Scalar, 3 > | b, | ||
| span< const Scalar, 3 > | c, | ||
| span< const Scalar, 3 > | d ) |
Compute 3D quad area.
| Scalar | The scalar type. |
| a,b,c,d | Quad vertex coordinates in counterclockwise order. |
| Scalar triangle_area_3d | ( | span< const Scalar, 3 > | a, |
| span< const Scalar, 3 > | b, | ||
| span< const Scalar, 3 > | c ) |
Compute 3D triangle area.
| Scalar | The scalar type. |
| a,b,c | Triangle vertex coordinates in counterclockwise order. |
| Scalar triangle_area_2d | ( | span< const Scalar, 2 > | a, |
| span< const Scalar, 2 > | b, | ||
| span< const Scalar, 2 > | c ) |
Compute 2D triangle signed area.
| Scalar | The scalar type. |
| a,b,c | Triangle vertex coordinates in counterclockwise order. |
| Orientation triangle_orientation | ( | span< const Scalar, 2 > | a, |
| span< const Scalar, 2 > | b, | ||
| span< const Scalar, 2 > | c ) |
Compute orientation of a 2D triangle.
| Scalar | The scalar type. |
| a,b,c | 2D coordinates of the triangle. |
Orientation::Positive if positively oriented. Orientation::Negative if negatively oriented. Orientation::Zero if the triangle is degenerate. | Scalar triangle_uv_distortion | ( | span< const Scalar, 3 > | V0, |
| span< const Scalar, 3 > | V1, | ||
| span< const Scalar, 3 > | V2, | ||
| span< const Scalar, 2 > | v0, | ||
| span< const Scalar, 2 > | v1, | ||
| span< const Scalar, 2 > | v2 ) |
Compute uv distortion of a single triangle.
Let φ be the mapping from the 3D triangle (V0, V1, V2) to the uv triangle (v0, v1, v2), and let J = ∇φ be its Jacobian. A distortion metric measures the amount of deviation from isotropic or conformal mapping. It can often be expressed concisely in terms of the singular values, (s0, s1) of J. Here are a list of supported distortion metrics:
| metric | The type of distortion metric to use. |
| Scalar | The scalar type. |
| V0,V1,V2 | The coordinates of the 3D triangle. |
| v0,v1,v2 | The coordinates of the uv triangle. |
| Scalar triangle_uv_distortion | ( | span< const Scalar, 3 > | V0, |
| span< const Scalar, 3 > | V1, | ||
| span< const Scalar, 3 > | V2, | ||
| span< const Scalar, 2 > | v0, | ||
| span< const Scalar, 2 > | v1, | ||
| span< const Scalar, 2 > | v2, | ||
| DistortionMetric | metric ) |
Compute uv distortion of a single triangle.
| Scalar | The scalar type. |
| V0,V1,V2 | The coordinates of the 3D triangle. |
| v0,v1,v2 | The coordinates of the uv triangle. |
| metric | The distorsion metric to compute. |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Convert radians to degrees.
Use either as to_degrees(x) or x * to_degrees<double>();
Convert degrees to radians.
Use either as to_degrees(x) or x * to_degrees<double>();
| void save_graph_off | ( | const fs::path & | filename, |
| const Eigen::MatrixBase< DerivedV > & | V, | ||
| const Eigen::MatrixBase< DerivedE > & | E ) |
Saves a 2D undirected graph (V,E) using off format.
| [in] | filename | Target filename path. |
| [in] | V | V x 2 array of vertices positions. |
| [in] | E | E x 2 array of edge indices. |
| DerivedV | Vertex array type. |
| DerivedE | Edge array type. |
| void save_graph | ( | const fs::path & | filename, |
| const Eigen::MatrixBase< DerivedV > & | V, | ||
| const Eigen::MatrixBase< DerivedE > & | E ) |
Saves a 2D undirected graph (V,E) based on filename extension.
For now only .off is supported.
| [in] | filename | Target filename path. |
| [in] | V | V x 2 array of vertices positions. |
| [in] | E | E x 2 array of edge indices. |
| DerivedV | Vertex array type. |
| DerivedE | Edge array type. |