Skip to content

Commit 201db0b

Browse files
committed
Merged script fixes
2 parents f57ea11 + 3fa4526 commit 201db0b

File tree

198 files changed

+15975
-3287
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+15975
-3287
lines changed

CMakeLists.txt

Lines changed: 58 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,24 @@ set(DIR_EXT "${CMAKE_CURRENT_SOURCE_DIR}/ext")
99

1010
# Set options if top level
1111
if (PROJECT_IS_TOP_LEVEL)
12-
# Options for the project
12+
# Options to generate python bindings
13+
option(USE_PYBIND "Generate pybindings" ON)
14+
15+
# Alternative library options
1316
option(USE_MULTIPRECISION "Use high precision floating point" OFF)
14-
option(CHECK_VALIDITY "Check validity pre and post conditions" ON)
17+
option(USE_EMBREE "Use Embree for rendering" OFF)
18+
option(USE_SUITESPARSE "Use suite sparse methods for matrix inversion" ON)
19+
option(USE_COMISO "Use Comiso for field generation" ON)
20+
21+
# Visualization options
1522
option(ENABLE_VISUALIZATION "Generate viewers for visualization" ON)
1623
option(RENDER_TEXTURE "Render results" ON)
17-
option(USE_SUITESPARSE "Use suite sparse methods for matrix inversion" ON)
18-
option(USE_PYBIND "Generate pybindings" ON)
24+
25+
# Validity check options
1926
option(BUILD_CURVATURE_METRIC_TESTS "Build tests" ON)
20-
option(USE_EMBREE "Use Embree for rendering" OFF)
27+
option(CHECK_VALIDITY "Check validity pre and post conditions" ON)
2128

22-
# Set libigl and suitesparse options
29+
# Set default libigl and suitesparse options
2330
option(LIBIGL_PREDICATES "Use Predicates" ON)
2431
set ( SUITESPARSE_ENABLE_PROJECTS "suitesparse_config;cholmod;spqr" )
2532
option ( SUITESPARSE_USE_CUDA OFF )
@@ -40,6 +47,25 @@ if(USE_MULTIPRECISION)
4047
link_directories(${MPFR_LIBRARIES_DIR})
4148
endif()
4249

50+
# Optionally get frame field libraries
51+
if (USE_COMISO)
52+
add_compile_definitions(USE_COMISO)
53+
option(LIBIGL_COPYLEFT_COMISO "Use COSIMO" ON)
54+
set(COMISO_LIBS
55+
igl_copyleft::comiso
56+
)
57+
endif()
58+
59+
# Set libigl options for rendering if enabled
60+
if (RENDER_TEXTURE)
61+
option(LIBIGL_OPENGL "Use OpenGL" ON)
62+
option(LIBIGL_GLFW "Use GLFW" ON)
63+
option(LIBIGL_PNG "Use PNG" ON)
64+
endif()
65+
if (USE_EMBREE)
66+
option(LIBIGL_EMBREE "Use EMBREE" ON)
67+
endif()
68+
4369
# Set compile definitions
4470
add_compile_definitions(_USE_MATH_DEFINES)
4571
if(USE_MULTIPRECISION)
@@ -49,49 +75,56 @@ if(CHECK_VALIDITY)
4975
add_compile_definitions(CHECK_VALIDITY)
5076
endif()
5177
if (RENDER_TEXTURE)
52-
option(LIBIGL_OPENGL "Use OpenGL" ON)
53-
option(LIBIGL_GLFW "Use GLFW" ON)
54-
option(LIBIGL_PNG "Use PNG" ON)
5578
add_compile_definitions(RENDER_TEXTURE)
5679
endif()
5780
if (USE_EMBREE)
5881
add_compile_definitions(USE_EMBREE)
59-
option(LIBIGL_EMBREE "Use EMBREE" ON)
6082
endif()
6183
if(USE_PYBIND)
6284
add_compile_definitions(PYBIND)
6385
endif()
64-
65-
# Set suitesparse compile definitions
6686
# WARNING: This compile definition publicly links suitesparse into the
6787
# conformal ideal delaunay library
6888
if(USE_SUITESPARSE)
6989
add_compile_definitions(USE_SUITESPARSE)
90+
set(SUITESPARSE_LIBS
91+
SuiteSparse::SuiteSparseConfig
92+
SuiteSparse::SPQR
93+
SuiteSparse::CHOLMOD
94+
)
7095
endif()
7196

7297
# Get external libraries
73-
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src/util")
7498
include(conformal_ideal_delaunay)
7599
include(libigl)
76100
include(spectra)
77101
include(cli11)
102+
include(json)
103+
include(geometry-central)
78104

79-
# Optionally create visualization library
105+
# Optionally create rendering library
80106
if(RENDER_TEXTURE)
107+
# Build core rendering library
108+
# TODO: Move somewhere reasonable
81109
add_library(rendering
82-
src/util/visualization.cc
110+
src/optimization/util/visualization.cc
83111
)
112+
target_include_directories(rendering PUBLIC include/optimization/optimization/util)
84113
target_link_libraries(rendering PUBLIC
85114
igl::core
86115
igl::glfw
87116
igl::png
88117
plot
89118
)
90-
if(USE_EMBREE)
91-
target_link_libraries(rendering PUBLIC
92-
igl::embree
93-
)
94-
endif()
119+
120+
# Link in embree if enabled
121+
if(USE_EMBREE)
122+
target_link_libraries(rendering PUBLIC
123+
igl::embree
124+
)
125+
endif()
126+
127+
# Change rendering libraries from null to singleton
95128
set(RENDER_LIBRARIES
96129
rendering
97130
)
@@ -106,50 +139,13 @@ if(ENABLE_VISUALIZATION)
106139
)
107140
endif()
108141

109-
# Install executables to bin directory
110-
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
111-
112-
# Make main cpp library
113-
add_subdirectory(src)
114-
115-
# Build executables
116-
add_subdirectory(src/app)
117-
118-
# Build pybind optimization functions
142+
# Optionally build pybind
119143
if(USE_PYBIND)
120144
include(pybind11)
121-
add_library(optimization_py MODULE
122-
src/penner_optimization_pybind.cpp
123-
)
124-
125-
# Link libraries
126-
target_link_libraries(optimization_py PUBLIC
127-
PennerOptimizationLib
128-
pybind11::module
129-
${RENDER_LIBRARIES}
130-
)
131-
132-
# Set pybinding settings
133-
set_target_properties(optimization_py PROPERTIES LIBRARY_OUTPUT_DIRECTORY
134-
${PROJECT_SOURCE_DIR}/py
135-
)
136-
set_target_properties(optimization_py PROPERTIES PREFIX
137-
"${PYTHON_MODULE_PREFIX}"
138-
)
139145
endif()
140146

141-
# Optionally build tests (only valid for double precision)
142-
if((BUILD_CURVATURE_METRIC_TESTS) AND (NOT USE_MULTIPRECISION))
143-
include(Catch2)
147+
# Install executables to bin directory
148+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
144149

145-
# Build testing executable
146-
add_executable(CurvatureMetricTests
147-
src/tests/tests.cpp
148-
)
149-
target_link_libraries(CurvatureMetricTests PRIVATE
150-
PennerOptimizationLib
151-
Catch2::Catch2WithMain
152-
)
153-
set(TEST_DATA_ROOT "${PROJECT_SOURCE_DIR}/src/tests/regression/")
154-
target_compile_definitions(CurvatureMetricTests PUBLIC TEST_DATA_DIR=\"${TEST_DATA_ROOT}\")
155-
endif()
150+
# Make main cpp library
151+
add_subdirectory(src)

cmake/geometry-central.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
if(TARGET geometry-central)
2+
return()
3+
endif()
4+
5+
include(FetchContent)
6+
FetchContent_Declare(
7+
geometry-central
8+
SYSTEM
9+
GIT_REPOSITORY https://github.com/nmwsharp/geometry-central.git
10+
)
11+
FetchContent_MakeAvailable(geometry-central)

cmake/json.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
include(FetchContent)
2+
FetchContent_Declare(
3+
json
4+
SYSTEM
5+
GIT_REPOSITORY https://github.com/nlohmann/json.git
6+
)
7+
FetchContent_MakeAvailable(json)
8+

figures/fig-all.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

figures/fig-comparison.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

figures/fig-disk.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

figures/fig-examples.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

figures/fig-initial.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

figures/fig-interpolation.sh

Lines changed: 0 additions & 10 deletions
This file was deleted.

figures/fig-objectives.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)