Skip to content

Commit 431b9bb

Browse files
committed
WIP-FLASH: before trying to implement CGAL for io reading
1 parent 329769b commit 431b9bb

File tree

7 files changed

+47
-5
lines changed

7 files changed

+47
-5
lines changed

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
"shared_mutex": "cpp",
9494
"source_location": "cpp",
9595
"stack": "cpp",
96-
"valarray": "cpp"
96+
"valarray": "cpp",
97+
"*.inc": "cpp"
9798
}
9899
}

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ foreach(DEP_LIB ${DEPENDENCIES})
9999
)
100100
endforeach()
101101

102+
# # CGAL ( ctories(${SHARED_LIB_NAME} PUBLIC ${CGAL_INCLUDE_DIRS})
103+
102104
#--------------------------------------------------------------------------
103105
# executable for prototyping
104106
#--------------------------------------------------------------------------

deps/eigen

Submodule eigen updated from d3cd312 to 9f77ce4

src/diffCheck/IOManager.cc

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,43 @@ namespace diffCheck::io
3636

3737
std::shared_ptr<diffCheck::geometry::DFMesh> ReadPLYMeshFromFile(const std::string &filename)
3838
{
39+
// check if the ply is from Rhino by searching for the string "Rhinoceros"
40+
std::ifstream file(filename);
41+
std::string line;
42+
bool isRhino = false;
43+
while (std::getline(file, line))
44+
{
45+
if (line.find("Rhinoceros") != std::string::npos)
46+
{
47+
isRhino = true;
48+
break;
49+
}
50+
}
51+
file.close();
52+
std::cout << "isRhino: " << isRhino << std::endl;
53+
54+
// detect if the ply is of fixed variable lengths or not
55+
bool isFixedLength = false;
56+
std::ifstream file2(filename);
57+
std::string line2;
58+
while (std::getline(file2, line2))
59+
{
60+
if (line2.find("element vertex") != std::string::npos)
61+
{
62+
isFixedLength = true;
63+
break;
64+
}
65+
}
66+
file2.close();
67+
std::cout << "isFixedLength: " << isFixedLength << std::endl;
68+
69+
70+
71+
72+
73+
74+
75+
3976
std::shared_ptr<diffCheck::geometry::DFMesh> mesh = std::make_shared<diffCheck::geometry::DFMesh>();
4077
Eigen::MatrixXd V;
4178
Eigen::MatrixXd C;

src/diffCheck/IOManager.hh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
namespace diffCheck::io
1212
{
13-
// TODO: here we should add a class IOManager and the functions should be static
1413
/**
1514
* @brief Read a point cloud from a file
1615
*

src/diffCheckApp.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ int main()
88
std::shared_ptr<diffCheck::geometry::DFMesh> dfMeshPtr = std::make_shared<diffCheck::geometry::DFMesh>();
99

1010
// std::string pathCloud = R"(C:\Users\andre\Downloads\scan_data_normals.ply\scan_data_normals.ply)";
11-
std::string pathMesh = R"(C:\Users\andre\Downloads\crankshaft-hd-ply\Crankshaft HD.ply)";
11+
std::string pathMesh = R"(F:\diffCheck\temp\export_meesh_tri.ply)";
12+
// std::string pathMesh = R"(F:\diffCheck\temp\03_mesh.ply)";
13+
// std::string pathMesh = R"(C:\Users\andre\Downloads\crankshaft-hd-ply\Crankshaft HD.ply)";
14+
1215

1316
// dfPointCloudPtr->LoadFromPLY(pathCloud);
1417
dfMeshPtr->LoadFromPLY(pathMesh);

0 commit comments

Comments
 (0)