https://github.com/HTDerekLiu/surface_multigrid_code
Tip revision: adc49abe10a97200a3a5735bd370e98560091a37 authored by Hsueh-Ti Derek Liu on 16 March 2023, 20:37:42 UTC
Merge pull request #3 from alecjacobson/main
Merge pull request #3 from alecjacobson/main
Tip revision: adc49ab
compute_barycentric.h
#ifndef COMPUTE_BARYCENTRIC_h
#define COMPUTE_BARYCENTRIC_h
#include <Eigen/Core>
#include <iostream>
#include <math.h>
// Compute the barycentric coordinate of a 2D query point "p" with respect to all the elements in a 2D triangle mesh (UV, F).
// Inputs:
// p location of the query point in 2D
// UV #V-by-2 vertices of the 2D triangle mesh
// F #F-by-3 faces of the 2D triangle mesh
// Outputs:
// B #F-by-3 barycentric coordinates of p wrt each face F
void compute_barycentric(
const Eigen::VectorXd & p,
const Eigen::MatrixXd & UV,
const Eigen::MatrixXi & F,
Eigen::MatrixXd & B);
#endif