https://github.com/HTDerekLiu/surface_multigrid_code
Revision db5c7fa56b977d3f1ac0ac11ed875f75229f2d27 authored by eriszhang on 08 August 2021, 03:27:39 UTC, committed by eriszhang on 08 August 2021, 03:27:39 UTC
1 parent d366192
Raw File
Tip revision: db5c7fa56b977d3f1ac0ac11ed875f75229f2d27 authored by eriszhang on 08 August 2021, 03:27:39 UTC
add
Tip revision: db5c7fa
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
back to top