11#include " diffCheck.hh"
22
3- // #include <open3d/Open3D.h>
3+ #include < open3d/Open3D.h>
44
55#include < string>
66#include < iostream>
@@ -13,26 +13,26 @@ namespace diffCheck {
1313
1414 void testOpen3d ()
1515 {
16- // std::shared_ptr<open3d::geometry::PointCloud> cloud(new open3d::geometry::PointCloud());
17- // // print the number of points in the point cloud
18- // std::cout << "Point cloud has " << cloud->points_.size() << " points." << std::endl;
19- // std::cout << "testOpen3d check." << std::endl;
20-
21- // // fill the point cloud with random points
22- // cloud->points_.resize(100);
23- // for (auto &point : cloud->points_) {
24- // point = Eigen::Vector3d::Random();
25- // }
26- // // set the point cloud color to be light blue
27- // cloud->colors_.resize(100);
28- // for (auto &color : cloud->colors_) {
29- // color = Eigen::Vector3d(0.7, 0.7, 1.0);
30- // }
31- // // set the normal of the point cloud
32- // cloud->normals_.resize(100);
33- // for (auto &normal : cloud->normals_) {
34- // normal = Eigen::Vector3d(0.0, 0.0, 1.0);
35- // }
16+ std::shared_ptr<open3d::geometry::PointCloud> cloud (new open3d::geometry::PointCloud ());
17+ // print the number of points in the point cloud
18+ std::cout << " Point cloud has " << cloud->points_ .size () << " points." << std::endl;
19+ std::cout << " testOpen3d check." << std::endl;
20+
21+ // fill the point cloud with random points
22+ cloud->points_ .resize (100 );
23+ for (auto &point : cloud->points_ ) {
24+ point = Eigen::Vector3d::Random ();
25+ }
26+ // set the point cloud color to be light blue
27+ cloud->colors_ .resize (100 );
28+ for (auto &color : cloud->colors_ ) {
29+ color = Eigen::Vector3d (0.7 , 0.7 , 1.0 );
30+ }
31+ // set the normal of the point cloud
32+ cloud->normals_ .resize (100 );
33+ for (auto &normal : cloud->normals_ ) {
34+ normal = Eigen::Vector3d (0.0 , 0.0 , 1.0 );
35+ }
3636 }
3737
3838 void testLibigl ()
@@ -50,35 +50,41 @@ namespace diffCheck {
5050 // viewer.data().set_mesh(V, F);
5151 // viewer.launch();
5252
53- // ########################################
54- const Eigen::MatrixXd V= (Eigen::MatrixXd (8 ,3 )<<
55- 0.0 ,0.0 ,0.0 ,
56- 0.0 ,0.0 ,1.0 ,
57- 0.0 ,1.0 ,0.0 ,
58- 0.0 ,1.0 ,1.0 ,
59- 1.0 ,0.0 ,0.0 ,
60- 1.0 ,0.0 ,1.0 ,
61- 1.0 ,1.0 ,0.0 ,
62- 1.0 ,1.0 ,1.0 ).finished ();
63- const Eigen::MatrixXi F = (Eigen::MatrixXi (12 ,3 )<<
64- 0 ,6 ,4 ,
65- 0 ,2 ,6 ,
66- 0 ,3 ,2 ,
67- 0 ,1 ,3 ,
68- 2 ,7 ,6 ,
69- 2 ,3 ,7 ,
70- 4 ,6 ,7 ,
71- 4 ,7 ,5 ,
72- 0 ,4 ,5 ,
73- 0 ,5 ,1 ,
74- 1 ,5 ,7 ,
75- 1 ,7 ,3 ).finished ();
76-
77- // Plot the mesh
78- igl::opengl::glfw::Viewer viewer;
79- viewer.data ().set_mesh (V, F);
80- viewer.data ().set_face_based (true );
81- viewer.launch ();
53+ // show an example for visualizing a point cloud with libigl viewer
54+ // igl::opengl::glfw::Viewer viewer;
55+
56+
57+
58+
59+ // // ########################################
60+ // const Eigen::MatrixXd V= (Eigen::MatrixXd(8,3)<<
61+ // 0.0,0.0,0.0,
62+ // 0.0,0.0,1.0,
63+ // 0.0,1.0,0.0,
64+ // 0.0,1.0,1.0,
65+ // 1.0,0.0,0.0,
66+ // 1.0,0.0,1.0,
67+ // 1.0,1.0,0.0,
68+ // 1.0,1.0,1.0).finished();
69+ // const Eigen::MatrixXi F = (Eigen::MatrixXi(12,3)<<
70+ // 0,6,4,
71+ // 0,2,6,
72+ // 0,3,2,
73+ // 0,1,3,
74+ // 2,7,6,
75+ // 2,3,7,
76+ // 4,6,7,
77+ // 4,7,5,
78+ // 0,4,5,
79+ // 0,5,1,
80+ // 1,5,7,
81+ // 1,7,3).finished();
82+
83+ // // Plot the mesh
84+ // igl::opengl::glfw::Viewer viewer;
85+ // viewer.data().set_mesh(V, F);
86+ // viewer.data().set_face_based(true);
87+ // viewer.launch();
8288 }
8389
8490} // namespace diffCheck
0 commit comments