Datasets:

Modalities:
Image
Text
Formats:
text
Size:
< 1K
Libraries:
Datasets
License:
File size: 703 Bytes
5b89cb9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <test_common.h>
#include <igl/heat_geodesics.h>
#include <igl/upsample.h>
#include <igl/avg_edge_length.h>

TEST_CASE("heat_geodesic: upsampled cube", "[igl]")
{
  Eigen::MatrixXd V;
  Eigen::MatrixXi F;

  igl::read_triangle_mesh(test_common::data_path("cube.obj"), V, F);
  igl::upsample(V,F,3);

  int vid = 0;
  igl::HeatGeodesicsData<double> data;
  igl::heat_geodesics_precompute(V,F,data);
  Eigen::VectorXd dist;
  igl::heat_geodesics_solve(data, (Eigen::VectorXi(1,1)<<vid).finished(), dist);
  
  double avg_edge = igl::avg_edge_length(V,F);

  // Check the adjacent corners
  for (int i=0; i<6; i++) {
  REQUIRE((V.row(i)-V.row(0)).norm() == Approx(dist(i)).margin(avg_edge));
  }

}