Lagrange
Loading...
Searching...
No Matches
compute_area.h
1/*
2 * Copyright 2023 Adobe. All rights reserved.
3 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License. You may obtain a copy
5 * of the License at http://www.apache.org/licenses/LICENSE-2.0
6 *
7 * Unless required by applicable law or agreed to in writing, software distributed under
8 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9 * OF ANY KIND, either express or implied. See the License for the specific language
10 * governing permissions and limitations under the License.
11 */
12
13#pragma once
14
15#include <lagrange/SurfaceMesh.h>
16
17#include <Eigen/Core>
18
19namespace lagrange {
27
32{
34 std::string_view output_attribute_name = "@facet_area";
35
37 bool use_signed_area = true;
38};
39
52template <typename Scalar, typename Index>
54
71template <typename Scalar, typename Index, int Dimension>
73 SurfaceMesh<Scalar, Index>& mesh,
74 const Eigen::Transform<Scalar, Dimension, Eigen::Affine>& transformation,
75 FacetAreaOptions options = {});
76
81{
83 std::string_view output_attribute_name = "@facet_vector_area";
84};
85
114template <typename Scalar, typename Index>
117 FacetVectorAreaOptions options = {});
118
133template <typename Scalar, typename Index>
135 SurfaceMesh<Scalar, Index>& mesh,
136 const Eigen::Transform<Scalar, 3, Eigen::Affine>& transformation,
137 FacetVectorAreaOptions options = {});
138
143{
146 std::string_view input_attribute_name = "@facet_area";
147
149 bool use_signed_area = true;
150};
151
164template <typename Scalar, typename Index>
166
183template <typename Scalar, typename Index, int Dimension>
184Scalar compute_mesh_area(
185 const SurfaceMesh<Scalar, Index>& mesh,
186 const Eigen::Transform<Scalar, Dimension, Eigen::Affine>& transformation,
187 MeshAreaOptions options = {});
188
203template <typename Scalar, typename Index>
205
207} // namespace lagrange
A general purpose polygonal mesh class.
Definition SurfaceMesh.h:73
uint32_t AttributeId
Identified to be used to access an attribute.
Definition AttributeFwd.h:73
@ Scalar
Mesh attribute must have exactly 1 channel.
Definition AttributeFwd.h:56
Scalar compute_uv_area(const SurfaceMesh< Scalar, Index > &mesh, MeshAreaOptions options={})
Compute UV mesh area.
Definition compute_area.cpp:429
AttributeId compute_facet_area(SurfaceMesh< Scalar, Index > &mesh, FacetAreaOptions options={})
Compute per-facet area.
Definition compute_area.cpp:307
Scalar compute_mesh_area(const SurfaceMesh< Scalar, Index > &mesh, MeshAreaOptions options={})
Compute mesh area.
Definition compute_area.cpp:407
AttributeId compute_facet_vector_area(SurfaceMesh< Scalar, Index > &mesh, FacetVectorAreaOptions options={})
Compute per-facet vector area.
Definition compute_area.cpp:325
Main namespace for Lagrange.
Option struct for computing per-facet area.
Definition compute_area.h:32
std::string_view output_attribute_name
Output attribute name for facet area.
Definition compute_area.h:34
bool use_signed_area
For 2D mesh only: whether the computed area should be signed.
Definition compute_area.h:37
Option struct for computing per-facet vector area.
Definition compute_area.h:81
std::string_view output_attribute_name
Output attribute name for facet vector area.
Definition compute_area.h:83
Option struct for computing mesh area.
Definition compute_area.h:143
std::string_view input_attribute_name
Precomputed facet area attribute name.
Definition compute_area.h:146
bool use_signed_area
For 2D mesh only: whether the computed facet area (if any) should be signed.
Definition compute_area.h:149