Blender V4.3
doublearea.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2013 Alec Jacobson
2 * 2023 Blender Authors
3 *
4 * SPDX-License-Identifier: MPL-2.0 */
5
10#pragma once
11
12#include <Eigen/Dense>
13
14namespace slim {
15
16/* DOUBLEAREA computes twice the area for each input triangle
17 *
18 * Templates:
19 * DerivedV derived type of eigen matrix for V (e.g. derived from
20 * MatrixXd)
21 * DerivedF derived type of eigen matrix for F (e.g. derived from
22 * MatrixXi)
23 * DeriveddblA derived type of eigen matrix for dblA (e.g. derived from
24 * MatrixXd)
25 * Inputs:
26 * V #V by dim list of mesh vertex positions
27 * F #F by simplex_size list of mesh faces (must be triangles)
28 * Outputs:
29 * dblA #F list of triangle double areas (SIGNED only for 2D input)
30 *
31 * Known bug: For dim==3 complexity is O(#V + #F)!! Not just O(#F). This is a big deal
32 * if you have 1million unreferenced vertices and 1 face
33 */
34template<typename DerivedV, typename DerivedF, typename DeriveddblA>
35inline void doublearea(const Eigen::PlainObjectBase<DerivedV> &V,
36 const Eigen::PlainObjectBase<DerivedF> &F,
37 Eigen::PlainObjectBase<DeriveddblA> &dblA);
38
39/* Same as above but use instrinsic edge lengths rather than (V,F) mesh
40 * Inputs:
41 * l #F by dim list of edge lengths using
42 * for triangles, columns correspond to edges 23,31,12
43 * Outputs:
44 * dblA #F list of triangle double areas
45 */
46template<typename Derivedl, typename DeriveddblA>
47inline void doublearea(const Eigen::PlainObjectBase<Derivedl> &l,
48 Eigen::PlainObjectBase<DeriveddblA> &dblA);
49
50} // namespace slim
51
52#include "doublearea.cpp"
ATTR_WARN_UNUSED_RESULT const BMLoop * l
void doublearea(const Eigen::PlainObjectBase< DerivedV > &V, const Eigen::PlainObjectBase< DerivedF > &F, Eigen::PlainObjectBase< DeriveddblA > &dblA)
CCL_NAMESPACE_BEGIN struct Window V