Skip to content

Commit

Permalink
Update (pfmephisto#1)
Browse files Browse the repository at this point in the history
* Polygonal Surface reconstruction
using CGAL

* Initial methods to convert point clouds to Speckle objects.
Untested

* Added Gurobi Solver

* Initial clustering

* Changed progress bar

* Working Embree-based ray tracing.

* Implementation of Markov Clustering in C++ using Eigen.

* Added ray visualisation
Changed plane origin

* Removing Python dependency in clustering

* Reenabeling OpenMP
Update MC params
Flipping of normal vectors
Clamped point cloud

* Renaming files to use C++ file extension

* Updating file references

* Adding PCL to CMake

* Adding HDF5 and H5pp as well as downgrading to C++17

* Fixing Eigen3 dependency inclusion.

* Dataset class added

* Intermediate Image projection

* Added Normal construction

* Custom depth to 3d function

* Initial registration pipeline

* Registering point cloud

* Updates to IPC

* Updated Progress bar

* Updated Display Function

* Fixed Transformation Inversion

* Added Size method to Dataset class

* Fixed inverse transformation

* Setting height, width and dense fields

* Updated interface

* Initial neural net support

* Yolo v8 Implementation

* Yolo v8 Model export file

* Viewer, Progressbar

* Added simple path constructor to Dataset class for use in Python

* Restructured Yolo in to pre-, main and post-process

* Updated refine and fit plane methods

* Downsampling, Regin growing, restructured Yolo pipeline

* Added Surface Mesh class and display method

* Custom accumulators

* Octree-based merging of point clouds

* Save and load methods

* Region growing

* Updated Total time formatting

* Filter method

* Updated crop plate with Surface Mesh support

* Surfacemesh reconstruction

* Added functions

* Added new PointCloud class and methods

* Changed PCL path

* updated test file
  • Loading branch information
pfmephisto authored Feb 26, 2024
1 parent b3834e1 commit 205162b
Show file tree
Hide file tree
Showing 108 changed files with 21,174 additions and 3,492 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,10 @@ imgui.ini
*.png
.polyscope.ini
**/__pycache__/**/*
**/*.lp
**/*.lp


# Ignore machine learning data
*.onnx
*.pt
*.pcd
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,9 @@
[submodule "extern/pcl"]
path = extern/pcl
url = [email protected]:PointCloudLibrary/pcl.git
[submodule "extern/fmt"]
path = extern/fmt
url = [email protected]:fmtlib/fmt.git
[submodule "extern/nexus"]
path = extern/nexus
url = [email protected]:project-arcana/nexus.git
209 changes: 181 additions & 28 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,29 @@ project(linkml)

set(LIB_PROJECT_NAME "${PROJECT_NAME}_lib")
set(PYBIND_PROJECT_NAME "${PROJECT_NAME}_py")
set(TEST_PROJECT_NAME "${PROJECT_NAME}_test")


# ===============================================
# global settings

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
message("CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

option(CXX "enable C++ compilation" ON)

if(CXX)
enable_language(CXX)
endif()

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

# ===============================================
# options

Expand All @@ -30,6 +44,11 @@ endif()

option(LIN_ENABLE_WERROR "if true, enables -Werror, /WX" OFF)

# enable tests
option(LINKML_SAMPLES_TESTS "if true, builds linkml tests" ON)




# ===============================================
# compiler and linker flags
Expand Down Expand Up @@ -101,8 +120,13 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BIN_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${BIN_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${BIN_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${BIN_DIR})
# Set CMAKE_POSITION_INDEPENDENT_CODE to ON
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
#set(GLOW_BIN_DIR ${CMAKE_SOURCE_DIR}/bin)

# REMOVED: this is not needed anymore
set(CGAL_DO_NOT_WARN_ABOUT_CMAKE_BUILD_TYPE On)

## ===============================================
## disable glfw additionals
#option(GLFW_BUILD_EXAMPLES OFF)
Expand All @@ -114,7 +138,92 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${BIN_DIR})

# set(ENV{CUDACXX} "/usr/local/cuda/bin/nvcc")

# ===============================================s

# ===============================================
# find packages

find_package( OpenCV REQUIRED )
if (OpenCV_FOUND)
message(STATUS "Using OpenCV - ${OpenCV_VERSION} - ${OpenCV_INCLUDE_DIRS}")
set("OPENCV_LOG_LEVEL" "WARNING")
include_directories(${OpenCV_INCLUDE_DIRS})
link_directories(${OpenCV_LIBRARY_DIRS})
add_definitions(${OpenCV_DEFINITIONS})
endif()
# CGAL and its components
find_package(CGAL REQUIRED)

# Boost and its components
find_package(Boost REQUIRED)
if(NOT Boost_FOUND)

message(
STATUS
"NOTICE: This project requires the Boost library, and will not be compiled."
)

return()

endif()

find_package(Eigen3 3.3 REQUIRED) #(requires 3.1.0 or greater)
include(CGAL_Eigen3_support)
if(NOT TARGET CGAL::Eigen3_support)
message(
STATUS
"NOTICE: This project requires Eigen 3.1 (or greater) and will not be compiled."
)
return()
endif()

find_package( TBB REQUIRED )
include(CGAL_TBB_support)

find_package(SCIP REQUIRED)
include(CGAL_SCIP_support)

find_package(embree 3.12.2 REQUIRED)

IF (EMBREE_ISPC_SUPPORT)

OPTION(ENABLE_ISPC_SUPPORT "Build ISPC version of find_embree tutorial." OFF)

# this configures the ADD_EMBREE_ISPC_EXECUTABLE from Embree
IF (ENABLE_ISPC_SUPPORT)
SET(ISPC_TARGETS "sse2;sse4;avx;avx2")
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../common/cmake" ${CMAKE_MODULE_PATH})
INCLUDE(ispc)

get_target_property(embree_include_dir embree INTERFACE_INCLUDE_DIRECTORIES)
INCLUDE_DIRECTORIES_ISPC(${embree_include_dir})
ADD_EMBREE_ISPC_EXECUTABLE(find_embree_ispc find_embree_ispc.cpp find_embree_ispc.ispc)
TARGET_LINK_LIBRARIES(find_embree_ispc embree)
ENDIF()
ENDIF()


find_package(GUROBI REQUIRED)
if (GUROBI_FOUND)
message(STATUS "Using Gurobi Solver")
add_compile_definitions(CGAL_USE_GUROBI=1)
include_directories(${GUROBI_INCLUDE_DIRS})
endif()

find_package(PCL REQUIRED PATHS /usr/local NO_DEFAULT_PATH)
if(PCL_FOUND)
message(STATUS "Using PCL - ${PCL_VERSION}")
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
endif()


list(APPEND CMAKE_MODULE_PATH "./cmake/FindHDF5.cmake") # Replaces the bundled FindHDF5.cmake module
find_package(HDF5 1.10 COMPONENTS C HL REQUIRED)



# ===============================================
# add submodules
add_subdirectory(extern/clean-core)
add_subdirectory(extern/typed-geometry)
Expand All @@ -128,20 +237,17 @@ add_subdirectory(extern/pybind11)
add_subdirectory(extern/polyscope)
add_subdirectory(extern/glpk)
add_subdirectory(extern/lpsolve)
add_subdirectory(extern/scip)
add_subdirectory(extern/soplex)
# add_subdirectory(extern/scip)
# add_subdirectory(extern/cgal)
# add_subdirectory(extern/pcl)





#add_subdirectory(extern/glfw)
#add_subdirectory(extern/glow)
#add_subdirectory(extern/imgui)
#add_subdirectory(extern/glow-extras)

find_package( OpenCV REQUIRED )
# add_subdirectory(extern/glfw)
# add_subdirectory(extern/glow)
# add_subdirectory(extern/imgui)
# add_subdirectory(extern/glow-extras)
add_subdirectory(extern/fmt)
add_subdirectory(extern/nexus)
# add_subdirectory(extern/Open3D)

# ===============================================
# configure executable
Expand All @@ -152,7 +258,6 @@ file(GLOB_RECURSE LIB_SOURCES

file(GLOB_RECURSE LIB_HEADERS
"src/*.hh"
"src/*.h"
)

list(FILTER LIB_SOURCES EXCLUDE REGEX ".*py.cpp")
Expand All @@ -169,7 +274,13 @@ include_directories( ${OpenCV_INCLUDE_DIRS} )

add_library(${LIB_PROJECT_NAME} STATIC ${LIB_SOURCES} ${LIB_HEADERS})
set_target_properties(${LIB_PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
target_link_libraries(${LIB_PROJECT_NAME} PRIVATE pybind11::embed)
target_link_libraries(${LIB_PROJECT_NAME}
PRIVATE
pybind11::embed
optimized ${GUROBI_CXX_LIBRARY}
debug ${GUROBI_CXX_DEBUG_LIBRARY}
HDF5::HDF5
)
target_link_libraries(${LIB_PROJECT_NAME} PUBLIC
clean-core
typed-geometry
Expand All @@ -178,29 +289,36 @@ target_link_libraries(${LIB_PROJECT_NAME} PUBLIC
task-dispatcher
rich-log
polymesh
nanoflann
polyscope
glpk
lpsolve
scip
nanoflann
# scip
embree
soplex
Eigen3::Eigen3
CGAL::Eigen3_support
CGAL::SCIP_support
CGAL::TBB_support
${GUROBI_LIBRARY}
# CGAL::GLPK_support
# pcl
${PCL_LIBRARIES}
${PCL_COMMON_LIBRARIES}
# ${PCL_IO_LIBRARIES}
# glfw
# glow
# imgui
# glow-extras
fmt
nexus

${OpenCV_LIBS}

${COMMON_LINKER_FLAGS}
)



target_include_directories(${LIB_PROJECT_NAME} PUBLIC "src")
target_compile_options(${LIB_PROJECT_NAME} PUBLIC ${COMMON_COMPILER_FLAGS})


# dependency grouping in the IDE
foreach(TARGET_NAME
clean-core
Expand All @@ -214,20 +332,55 @@ foreach(TARGET_NAME
polyscope
glpk
lpsolve
scip
# scip
# glfw
# glow
# imgui
# glow-extras
soplex
# glfw
# glow
# imgui
# glow-extras

)
set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "Extern")
endforeach()


# ===============================================
# main libary
target_include_directories(${LIB_PROJECT_NAME} PUBLIC "src")
target_compile_options(${LIB_PROJECT_NAME} PUBLIC ${COMMON_COMPILER_FLAGS})


# ===============================================
# pyind11
pybind11_add_module("${PYBIND_PROJECT_NAME}" src/linkmlpy.cpp)
target_link_libraries("${PYBIND_PROJECT_NAME}" PRIVATE ${LIB_PROJECT_NAME})


# ===============================================
# tests
if (LINKML_SAMPLES_TESTS)

file(GLOB_RECURSE TEST_SOURCES
"tests/*.cc"
"tests/*.hh"
)

source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${TEST_SOURCES})

add_executable("${TEST_PROJECT_NAME}" ${TEST_SOURCES})

target_link_libraries("${TEST_PROJECT_NAME}" PUBLIC
${LIB_PROJECT_NAME}
nexus
)

target_include_directories("${TEST_PROJECT_NAME}" PUBLIC "tests")

if(MSVC)
target_compile_options("${TEST_PROJECT_NAME}" PUBLIC /MP /FC)
else()
target_compile_options("${TEST_PROJECT_NAME}" PUBLIC -Wall)
endif()

endif()

Loading

0 comments on commit 205162b

Please sign in to comment.