Skip to content

Commit

Permalink
WIP: Merge branch 'registration-dev' of github.com:diffCheckOrg/diffC…
Browse files Browse the repository at this point in the history
…heck into registration-dev
  • Loading branch information
DamienGilliard committed Mar 29, 2024
2 parents 98dc20f + 5351a97 commit e1ae188
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 23 deletions.
4 changes: 1 addition & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@
[submodule "deps/eigen"]
path = deps/eigen
url = https://gitlab.com/libeigen/eigen.git
[submodule "deps/boost"]
path = deps/boost
url = https://github.com/diffCheckOrg/submodule-boost.git
branch = master
10 changes: 4 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ download_submodule_project(eigen)
add_subdirectory(deps/eigen)
target_link_libraries(${SHARED_LIB_NAME} PUBLIC Eigen3::Eigen)

# Open3D (pre-built binaries) -----------------------------------------------------
# Open3D (from system) -----------------------------------------------------
# The options need to be the same as Open3D's default
# If Open3D is configured and built with custom options, you'll also need to
# specify the same custom options.
Expand All @@ -63,8 +63,6 @@ else()
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
endif()

download_submodule_project(open3d)
set(Open3D_DIR ${CMAKE_CURRENT_SOURCE_DIR}/deps/open3d/win/0_18/CMake)
find_package(Open3D 0.18.0 REQUIRED)

# print the version debug or release of the package
Expand All @@ -87,9 +85,9 @@ if(WIN32)
endif()
endif()

# Boost (header only) -----------------------------------------------------
download_submodule_project(boost)
target_link_directories(${SHARED_LIB_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/deps/boost/win/1_89/include/boost-1_85)
# Boost (from system) -----------------------------------------------------
# download and install from https://sourceforge.net/projects/boost/files/boost-binaries/1.84.0/boost_1_84_0-msvc-14.3-64.exe/download
find_package(Boost REQUIRED)

# print boost include dir
message(STATUS "Boost include dir: ${Boost_INCLUDE_DIRS}")
Expand Down
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,32 @@ gantt
## 3rd party libraries

The project uses the following 3rd party libraries:
- `Open3d 0.18.0` for 3D point cloud processing as pre-build binaries ([store here](https://github.com/diffCheckOrg/submodule-open3d.git))
- `Eigen` for linear algebra
- `Open3d 0.18.0` for 3D point cloud processing it needs to be installed from source [from here](https://github.com/isl-org/Open3D/releases/download/v0.18.0/open3d-devel-windows-amd64-0.18.0.zip), unzip the file and by following the instructions below:
```terminal
cd open3d
mkdir build
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX="C:\Program Files\Open3D" -S . -B build
cmake --build build --config Release --target ALL_BUILD
cmake --build build --config Release --target INSTALL
```
- `Eigen` for linear algebra (needed by `Open3d`)
- `CGAL` for general geometric processing and IO
- `Boost` for general utilities as pre-build binaries ([store here](https://github.com/diffCheckOrg/submodule-boost.git))
- `Boost` for general utilities, it needs to be installed from source [from the repo](https://github.com/boostorg/boost) as such:
```terminal
git clone --recursive https://github.com/boostorg/boost.git
cd boost
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX="C:\Program Files\Boost" -S . -B build
cmake --build build --config Release --target ALL_BUILD
cmake --build build --config Release --target INSTALL
```

## How to build c++ project
To build and test the project, follow the following steps:

```terminal
cmake/config.bat
cmake/build.bat
./build/bin/Release/diffCheckApp.exe <-- for prototyping
./build/bin/diffCheckApp.exe <-- for prototyping
```

## Prototype diffCheck in C++
Expand Down
2 changes: 1 addition & 1 deletion cmake/config.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cmake -S . -B build
cmake -S . -B build -G "Visual Studio 16 2019" -A x64
2 changes: 2 additions & 0 deletions src/diffCheck.hh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#pragma once


// include CGAL

#include <open3d/Open3D.h>

// diffCheck includes
Expand Down
10 changes: 1 addition & 9 deletions src/diffCheckApp.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

#include "diffCheck.hh"


#include <open3d/Open3D.h>
#include <open3d/io/PointCloudIO.h>
#include <open3d/io/TriangleMeshIO.h>
Expand All @@ -12,22 +11,15 @@

int main()
{
std::shared_ptr<diffCheck::geometry::DFPointCloud> dfPointCloudPtr = std::make_shared<diffCheck::geometry::DFPointCloud>();
std::shared_ptr<diffCheck::geometry::DFPointCloud> dfPointCloudFromMeshPtr = std::make_shared<diffCheck::geometry::DFPointCloud>();
std::shared_ptr<diffCheck::geometry::DFPointCloud> dfPointCloudPtr = std::make_shared<diffCheck::geometry::DFPointCloud>();
std::shared_ptr<diffCheck::geometry::DFMesh> dfMeshPtr = std::make_shared<diffCheck::geometry::DFMesh>();

std::string pathCloud = R"(C:\Users\andre\Downloads\scan_data_normals.ply\scan_data_normals.ply)";
std::string pathMesh = R"(F:\diffCheck\assets\dataset\mesh_fromRh_unfixedLength.ply)";
// std::string pathMesh = R"(F:\diffCheck\temp\03_mesh.ply)";

// create a sphere from o3d
auto mesh = open3d::geometry::TriangleMesh::CreateSphere(1.0, 4);
dfMeshPtr->LoadFromPLY(pathMesh);


dfMeshPtr->Cvt2DFMesh(mesh);

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

std::shared_ptr<diffCheck::visualizer::Visualizer> vis = std::make_shared<diffCheck::visualizer::Visualizer>();
Expand Down

0 comments on commit e1ae188

Please sign in to comment.