[Bf-blender-cvs] [31ebf10f1b4] sculpt-mode-features: initial implementation of libQex-based quad remeshing

Martin Felke noreply at git.blender.org
Tue Apr 16 20:00:29 CEST 2019


Commit: 31ebf10f1b4e8292dd3d78b2c7a0d3a96c9c1ec0
Author: Martin Felke
Date:   Tue Apr 16 19:58:18 2019 +0200
Branches: sculpt-mode-features
https://developer.blender.org/rB31ebf10f1b4e8292dd3d78b2c7a0d3a96c9c1ec0

initial implementation of libQex-based quad remeshing

note, still crashes often... has some memory alloc/free issues

===================================================================

M	CMakeLists.txt
M	build_files/build_environment/CMakeLists.txt
M	build_files/build_environment/cmake/harvest.cmake
A	build_files/build_environment/cmake/igl.cmake
A	build_files/build_environment/cmake/lapack.cmake
A	build_files/build_environment/cmake/openmesh.cmake
A	build_files/build_environment/cmake/qex.cmake
M	build_files/build_environment/cmake/versions.cmake
A	build_files/build_environment/patches/openmesh.diff
A	build_files/build_environment/patches/qex.diff
A	build_files/cmake/Modules/FindIgl.cmake
A	build_files/cmake/Modules/FindLAPACK.cmake
A	build_files/cmake/Modules/FindOpenMesh.cmake
A	build_files/cmake/Modules/FindQex.cmake
M	build_files/cmake/macros.cmake
M	build_files/cmake/platform/platform_unix.cmake
M	intern/CMakeLists.txt
A	intern/qex/CMakeLists.txt
A	intern/qex/igl_capi.cc
A	intern/qex/igl_capi.h
A	intern/qex/qex_capi.cc
A	intern/qex/qex_capi.h
M	release/scripts/startup/bl_ui/properties_data_modifier.py
M	source/blender/blenkernel/BKE_remesh.h
M	source/blender/blenkernel/CMakeLists.txt
A	source/blender/blenkernel/intern/remesh_quad.c
M	source/blender/makesdna/DNA_modifier_types.h
M	source/blender/makesrna/intern/rna_modifier.c
M	source/blender/modifiers/CMakeLists.txt
M	source/blender/modifiers/intern/MOD_remesh.c

===================================================================

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b7441174e23..de3cd222b8b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -396,6 +396,9 @@ endif()
 option(WITH_CPU_SSE              "Enable SIMD instruction if they're detected on the host machine" ON)
 mark_as_advanced(WITH_CPU_SSE)
 
+option(WITH_QEX			"Enable libQEx support" ON)
+
+
 # Cycles
 option(WITH_CYCLES					"Enable Cycles Render Engine" ON)
 option(WITH_CYCLES_STANDALONE		"Build Cycles standalone application" OFF)
diff --git a/build_files/build_environment/CMakeLists.txt b/build_files/build_environment/CMakeLists.txt
index 1760e00e150..aff7a1d7461 100644
--- a/build_files/build_environment/CMakeLists.txt
+++ b/build_files/build_environment/CMakeLists.txt
@@ -151,4 +151,9 @@ if(UNIX)
 	include(cmake/sqlite.cmake)
 endif()
 
+include(cmake/openmesh.cmake)
+include(cmake/lapack.cmake)
+include(cmake/igl.cmake)
+include(cmake/qex.cmake)
+
 include(cmake/harvest.cmake)
diff --git a/build_files/build_environment/cmake/harvest.cmake b/build_files/build_environment/cmake/harvest.cmake
index a281eb900e3..712ae6dcbd2 100644
--- a/build_files/build_environment/cmake/harvest.cmake
+++ b/build_files/build_environment/cmake/harvest.cmake
@@ -198,4 +198,13 @@ harvest(xvidcore/lib ffmpeg/lib "*.a")
 harvest(embree/include embree/include "*.h")
 harvest(embree/lib embree/lib "*.a")
 
+harvest(openmesh/include openmesh/include "*")
+harvest(openmesh/lib openmesh/lib "*.a")
+harvest(lapack/lib lapack/lib "*.a")
+harvest(lapack/include lapack/include "*.h")
+harvest(igl/include igl/include "*")
+harvest(igl/lib igl/lib "*.a")
+harvest(qex/include qex/include "*.h")
+harvest(qex/lib qex/lib "*.a")
+
 endif()
diff --git a/build_files/build_environment/cmake/igl.cmake b/build_files/build_environment/cmake/igl.cmake
new file mode 100644
index 00000000000..057a9d226e8
--- /dev/null
+++ b/build_files/build_environment/cmake/igl.cmake
@@ -0,0 +1,71 @@
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+set(IGL_EXTRA_ARGS
+	-DLIBIGL_BUILD_PYTHON=OFF
+	-DLIBIGL_BUILD_TESTS=OFF
+	-DLIBIGL_BUILD_TUTORIALS=OFF
+	-DLIBIGL_USE_STATIC_LIBRARY=ON
+	-DLIBIGL_WITHOUT_COPYLEFT=OFF
+	-DLIBIGL_WITH_CGAL=OFF
+	-DLIBIGL_WITH_COMISO=ON
+	-DLIBIGL_WITH_CORK=OFF
+	-DLIBIGL_WITH_EMBREE=OFF
+	-DLIBIGL_WITH_MATLAB=OFF
+	-DLIBIGL_WITH_MOSEK=OFF
+	-DLIBIGL_WITH_OPENGL=OFF
+	-DLIBIGL_WITH_OPENGL_GLFW=OFF
+	-DLIBIGL_WITH_OPENGL_GLFW_IMGUI=OFF
+	-DLIBIGL_WITH_PNG=OFF
+	-DLIBIGL_WITH_PYTHON=OFF
+	-DLIBIGL_WITH_TETGEN=OFF
+        -DLIBIGL_WITH_TRIANGLE=OFF
+	-DLIBIGL_WITH_XML=OFF
+        -DBLAS_LIBRARIES=${LIBDIR}/lapack/lib/libblas.a
+        -DCMAKE_BUILD_TYPE=Debug
+)
+
+ExternalProject_Add(external_igl
+	URL ${IGL_URI}
+	DOWNLOAD_DIR ${DOWNLOAD_DIR}
+        URL_HASH SHA256=${IGL_HASH}
+	PREFIX ${BUILD_DIR}/igl
+	CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/igl -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${IGL_EXTRA_ARGS}
+	INSTALL_DIR ${LIBDIR}/igl
+)
+
+ExternalProject_Add_Step(external_igl after_install
+        COMMAND ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/igl/src/external_igl/include/igl/copyleft/comiso
+                                                   ${LIBDIR}/igl/include/igl/copyleft/comiso
+
+        COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/igl/src/external_igl-build/libigl_comiso.a
+                                              ${LIBDIR}/igl/lib/libigl_comiso.a
+
+        COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/igl/src/external_igl-build/libCoMISo.a
+                                            ${LIBDIR}/igl/lib/libCoMISo.a
+
+        COMMAND ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/igl/src/external_igl/external/eigen/Eigen
+                                                    ${LIBDIR}/igl/include/eigen/Eigen
+
+        DEPENDEES install
+)
+
+add_dependencies(
+        external_igl
+        external_lapack
+)
diff --git a/build_files/build_environment/cmake/lapack.cmake b/build_files/build_environment/cmake/lapack.cmake
new file mode 100644
index 00000000000..d3632a0313e
--- /dev/null
+++ b/build_files/build_environment/cmake/lapack.cmake
@@ -0,0 +1,31 @@
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+set(LAPACK_EXTRA_ARGS
+        #-DOPENMESH_CORE_LIBRARY=${LIBDIR}/openmesh/lib/OpenMesh/libOpenMeshCore.a
+)
+
+ExternalProject_Add(external_lapack
+        URL ${LAPACK_URI}
+        DOWNLOAD_DIR ${DOWNLOAD_DIR}
+        URL_HASH SHA256=${LAPACK_HASH}
+        PREFIX ${BUILD_DIR}/lapack
+       # PATCH_COMMAND ${PATCH_CMD} -p 0 -d ${BUILD_DIR}/qex/src/external_qex < ${PATCH_DIR}/qex.diff
+        CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/lapack -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${LAPACK_EXTRA_ARGS}
+        INSTALL_DIR ${LIBDIR}/lapack
+)
diff --git a/build_files/build_environment/cmake/openmesh.cmake b/build_files/build_environment/cmake/openmesh.cmake
new file mode 100644
index 00000000000..312a6780380
--- /dev/null
+++ b/build_files/build_environment/cmake/openmesh.cmake
@@ -0,0 +1,45 @@
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+set(OPENMESH_EXTRA_ARGS
+	-DBUILD_APPS=OFF
+	-DDISABLE_QMAKE_BUILD=ON
+)
+
+ExternalProject_Add(external_openmesh
+	URL ${OPENMESH_URI}
+	DOWNLOAD_DIR ${DOWNLOAD_DIR}
+        URL_HASH SHA256=${OPENMESH_HASH}
+	PREFIX ${BUILD_DIR}/openmesh
+        PATCH_COMMAND ${PATCH_CMD} -p 0 -d ${BUILD_DIR}/openmesh/src/external_openmesh < ${PATCH_DIR}/openmesh.diff
+        CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openmesh -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${OPENMESH_EXTRA_ARGS}
+        INSTALL_DIR ${LIBDIR}/openmesh
+)
+
+if (BUILD_MODE STREQUAL Debug)
+ExternalProject_Add_Step(external_openmesh after_install
+        COMMAND ${CMAKE_COMMAND} -E rename ${LIBDIR}/openmesh/lib/OpenMesh/libOpenMeshCored.a
+                                           ${LIBDIR}/openmesh/lib/OpenMesh/libOpenMeshCore.a
+
+        COMMAND ${CMAKE_COMMAND} -E rename ${LIBDIR}/openmesh/lib/OpenMesh/libOpenMeshToolsd.a
+                                           ${LIBDIR}/openmesh/lib/OpenMesh/libOpenMeshTools.a
+
+        DEPENDEES install
+)
+endif()
+
diff --git a/build_files/build_environment/cmake/qex.cmake b/build_files/build_environment/cmake/qex.cmake
new file mode 100644
index 00000000000..80e374794c1
--- /dev/null
+++ b/build_files/build_environment/cmake/qex.cmake
@@ -0,0 +1,52 @@
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+set(QEX_EXTRA_ARGS
+        -DOPENMESH_CORE_LIBRARY=${LIBDIR}/openmesh/lib/OpenMesh/libOpenMeshCore.a
+        -DOPENMESH_INCLUDE_DIR=${LIBDIR}/openmesh/include
+        -DOPENMESH_LIBRARY_DIR=${LIBDIR}/openmesh/lib/OpenMesh
+        -DOPENMESH_TOOLS_LIBRARY=${LIBDIR}/openmesh/lib/OpenMesh/libOpenMeshTools.a
+)
+
+ExternalProject_Add(external_qex
+	URL ${QEX_URI}
+	DOWNLOAD_DIR ${DOWNLOAD_DIR}
+        URL_HASH SHA256=${QEX_HASH}
+	PREFIX ${BUILD_DIR}/qex
+        PATCH_COMMAND ${PATCH_CMD} -p 0 -d ${BUILD_DIR}/qex/src/external_qex < ${PATCH_DIR}/qex.diff
+        CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/qex -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${QEX_EXTRA_ARGS}
+        INSTALL_DIR ${LIBDIR}/qex
+)
+
+#grr, INSTALL(TARGETS has no exclude pattern, so removing unnecessary empty dirs here
+ExternalProject_Add_Step(external_qex after_install
+        COMMAND ${CMAKE_COMMAND} -E remove_directory ${LIBDIR}/qex/lib/src
+ 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list