Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helper functor in PolygonalCalculus to project vertices onto their tangent plane. #1730

Merged
merged 22 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .github/workflows/build-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
CONFIG_GLOBAL: -DBUILD_EXAMPLES=true -DBUILD_TESTING=true -DDGTAL_RANDOMIZED_TESTING_THRESHOLD=10 -DWITH_EIGEN=true
CONFIG_LINUX: -DWITH_OPENMP=true -DWITH_GMP=true -DWITH_FFTW3=true -DWITH_CGAL=true -DWITH_LIBIGL=true -DWARNING_AS_ERROR=ON -DWITH_HDF5=true -DWITH_QGLVIEWER=true -DWITH_CAIRO=true -DWITH_ITK=true -DDGTAL_ENABLE_FLOATING_POINT_EXCEPTIONS=true -DBUILD_POLYSCOPE_EXAMPLES=true
CONFIG_MAC: -DWITH_GMP=true -DBUILD_POLYSCOPE_EXAMPLES=true -DWITH_CGAL=true -DWITH_LIBIGL=true
CONFIG_WINDOWS: -DWITH_OPENMP=true -DENABLE_CONAN=true #-DWITH_FFTW3=true #-DWITH_CAIRO=true #-DWITH_ITK=true -DWITH_GMP=true
CONFIG_WINDOWS: -DWITH_OPENMP=true #-DWITH_GMP=true #-DWITH_FFTW3=true #-DWITH_CAIRO=true #-DWITH_ITK=true

jobs:
build:
Expand Down Expand Up @@ -44,17 +44,18 @@ jobs:
id: conan
uses: turtlebrowser/get-conan@main
with:
version: 1.57.0
version: 2.4.0

- name: Create conan default profile
if: matrix.os == 'windows-latest'
run: conan profile new default --detect

run: |
conan profile detect --force

- uses: actions/cache@v4
if: matrix.os == 'windows-latest'
with:
path: ~/.conan
key: ${{ runner.os }}-conan-${{ matrix.BUILD_TYPE }}
key: ${{ runner.os }}-conan2-${{ matrix.BUILD_TYPE }}

- name: Get white list of tests
run: |
Expand All @@ -80,7 +81,9 @@ jobs:
if: matrix.os == 'windows-latest'
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} $CONFIG_GLOBAL $CONFIG_WINDOWS -DDGTAL_RANDOMIZED_TESTING_WHITELIST="${{ steps.whitelist.outputs.WHITELIST }}"
run: |
conan install $GITHUB_WORKSPACE --build=missing
cmake $GITHUB_WORKSPACE -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} $CONFIG_GLOBAL $CONFIG_WINDOWS -DDGTAL_RANDOMIZED_TESTING_WHITELIST="${{ steps.whitelist.outputs.WHITELIST }}"

- name: Build
working-directory: ${{runner.workspace}}/build
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/buildAndDocumentation-PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ on:

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Debug
TESTBLACKLIST: "(testLinearStructure|testIntegerConverter|testArithmeticalDSSComputerOnSurfels)"
CONFIG_GLOBAL: -DBUILD_EXAMPLES=true -DBUILD_TESTING=true -DDGTAL_RANDOMIZED_TESTING_THRESHOLD=10 -DWITH_EIGEN=true
CONFIG_LINUX: -DUSE_CCACHE=NO -DWITH_OPENMP=true -DWITH_GMP=true -DWITH_CGAL=true -DWITH_LIBIGL=true -DWITH_FFTW3=true -DWARNING_AS_ERROR=ON -DWITH_HDF5=true -DWITH_QGLVIEWER=true -DWITH_CAIRO=true -DWITH_ITK=true -DDGTAL_ENABLE_FLOATING_POINT_EXCEPTIONS=true -DBUILD_POLYSCOPE_EXAMPLES=true
CONFIG_MAC: -DUSE_CCACHE=NO -DWITH_GMP=true -DBUILD_POLYSCOPE_EXAMPLES=true -DWITH_CGAL=true -DWITH_LIBIGL=true
CONFIG_WINDOWS: -DWITH_OPENMP=true -DENABLE_CONAN=true #-DWITH_FFTW3=true #-DWITH_CAIRO=true #-DWITH_ITK=true -DWITH_GMP=true
CONFIG_WINDOWS: -DWITH_OPENMP=true #-DWITH_GMP=true #-DWITH_FFTW3=true #-DWITH_CAIRO=true #-DWITH_ITK=true

jobs:
build:
Expand Down Expand Up @@ -45,17 +44,19 @@ jobs:
id: conan
uses: turtlebrowser/get-conan@main
with:
version: 1.57.0
version: 2.4.0

- name: Create conan default profile
if: matrix.os == 'windows-latest'
run: conan profile new default --detect
run: |
conan profile detect --force


- uses: actions/cache@v4
if: matrix.os == 'windows-latest'
with:
path: ~/.conan
key: ${{ runner.os }}-conan-${{ matrix.BUILD_TYPE }}
path: ~/.conan2
key: ${{ runner.os }}-conan2-${{ matrix.BUILD_TYPE }}

- name: Get white list of tests
run: |
Expand All @@ -81,7 +82,9 @@ jobs:
if: matrix.os == 'windows-latest'
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} $CONFIG_GLOBAL $CONFIG_WINDOWS -DDGTAL_RANDOMIZED_TESTING_WHITELIST="${{ steps.whitelist.outputs.WHITELIST }}"
run: |
conan install $GITHUB_WORKSPACE --build=missing
cmake $GITHUB_WORKSPACE -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} $CONFIG_GLOBAL $CONFIG_WINDOWS -DDGTAL_RANDOMIZED_TESTING_WHITELIST="${{ steps.whitelist.outputs.WHITELIST }}"

- name: Build
working-directory: ${{runner.workspace}}/build
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/pythonBindings-PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,18 @@ jobs:
id: conan
uses: turtlebrowser/get-conan@main
with:
version: 1.57.0
version: 2.4.0

- name: Install dependancies (conan - Windows 2/2)
if: matrix.os == 'windows-latest'
run: conan profile new default --detect

run: |
conan profile detect --force

- uses: actions/cache@v3
if: matrix.os == 'windows-latest'
with:
path: ~/.conan
key: ${{ runner.os }}-conan-${{ matrix.BUILD_TYPE }}
path: ~/.conan2
key: ${{ runner.os }}-conan2-${{ matrix.BUILD_TYPE }}


- name: Create Build Environment
Expand All @@ -80,7 +81,9 @@ jobs:
if: matrix.os == 'windows-latest'
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} $CONFIG_PYTHON $CONFIG_GLOBAL $CONFIG_WINDOWS
run: |
conan install $GITHUB_WORKSPACE --build=missing
cmake $GITHUB_WORKSPACE -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} $CONFIG_PYTHON $CONFIG_GLOBAL $CONFIG_WINDOWS


- name: Build
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/pythonBindings-Pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,19 @@ jobs:
id: conan
uses: turtlebrowser/get-conan@main
with:
version: 1.57.0
version: 2.4.0

- name: Install dependancies (conan - Windows 2/2)
if: matrix.os == 'windows-latest'
run: conan profile new default --detect
run: |
conan profile new default --detect
conan install . --output-folder=build --build=missing

- uses: actions/cache@v3
if: matrix.os == 'windows-latest'
with:
path: ~/.conan
key: ${{ runner.os }}-conan-${{ matrix.BUILD_TYPE }}
key: ${{ runner.os }}-conan2-${{ matrix.BUILD_TYPE }}

- name: Install python dependancies
shell: bash
Expand Down
20 changes: 15 additions & 5 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
- Major update: C++17 is now required for DGtal. (David Coeurjolly,
[#1682](https://github.com/DGtal-team/DGtal/pull/1682))
- Mandatory dependencies and some optional ones can be setup by
conan.io, especially on windows, new `ENABLE_CONAN` cmake
conan.io, especially on Windows, new `ENABLE_CONAN` cmake
option to activate this. (David Coeurjolly,
[#1689](https://github.com/DGtal-team/DGtal/pull/1689))
- Faster build using CPM for dependency download and ccache with the cmake `USE_CCACHE=YES`option
(ccache must be installed). (David Coeurjolly, [#1696](https://github.com/DGtal-team/DGtal/pull/1696))
- Better documentation style using doxygen-awesome.css. (David Coeurjolly,
[#1697](https://github.com/DGtal-team/DGtal/pull/1697))
[#1697](https://github.com/DGtal-team/DGtal/pull/1697))

- *Geometry*
- New implicit shape from point cloud using LibIGL Winding Numbers. (David Coeurjolly,
Expand All @@ -23,18 +23,23 @@
[#1699](https://github.com/DGtal-team/DGtal/pull/1699))
- Python bindings and Pypi deploy are now handled by Github-Actions (Bastien Doignies,
[#1721](https://github.com/DGtal-team/DGtal/pull/1721))
- Add CMake option DGTAL_WRAP_PYTHON (Pablo Hernandez-Cerdan,
[#1700](https://github.com/DGtal-team/DGtal/pull/1700))
- Upgrade of the conan scripts (for windows build) to conan 2, removing the ENABLE_CONAN option
(documentation update instead) (David Coeurjolly,
[#1729](https://github.com/DGtal-team/DGtal/pull/1729))

- *IO*
- New method to change the mode of the light position in Viewer3D (fixed to
camera or the scene) (Bertrand Kerautret, [#1683](https://github.com/DGtal-team/DGtal/pull/1683))
- Add a new method to store material information in obj file in MeshReader and MeshWriter.
(Bertrand Kerautret, [#1686](https://github.com/DGtal-team/DGtal/pull/1686))
- Fix duplicate symbols on Windows due to stb_image, see issue #1714 (David Coeurjolly,
[#1715](https://github.com/DGtal-team/DGtal/pull/1715)
[#1715](https://github.com/DGtal-team/DGtal/pull/1715))

- *Shapes*
- Add flips to SurfaceMesh data structure
(Jacques-Olivier Lachaud, [#1702](https://github.com/DGtal-team/DGtal/pull/1702))
- Add flips to SurfaceMesh data structure (Jacques-Olivier Lachaud,
[#1702](https://github.com/DGtal-team/DGtal/pull/1702))
- Add method to remove isolated vertices in Mesh, improve obj
material reading from potential obsolete path. (Bertrand Kerautret,
[#1709](https://github.com/DGtal-team/DGtal/issues/1709))
Expand All @@ -43,6 +48,11 @@
- The WindingNumberShape class can output the raw winding number values
(David Coeurjolly,[#1719](https://github.com/DGtal-team/DGtal/issues/1719))

- *DEC*
- New helper functor to construct an embedder to correct the PolygonalCalculs
(projection onto estimated tangent planes) (David Coeurjolly,
[#1730](https://github.com/DGtal-team/DGtal/issues/17309))

- *Geometry package*
- Add creation of polytopes from segments and triangles in
ConvexityHelper and 3-5xfaster full subconvexity tests for triangles
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and to construct a federative project. Another objective of DGtal is
to simplify the construction of demonstration tools to share new
results and potential efficiency of the proposed work.

DGtal received the [Symposium on Geometry Processing Software Award in 2016](http://awards.geometryprocessing.org/).

Quick Install
=============
Expand Down
64 changes: 0 additions & 64 deletions cmake/CheckDGtalDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,70 +6,6 @@ message(STATUS "----------------------------------------------------------------
message(STATUS "DGtal required dependencies: ")


# -----------------------------------------------------------------------------
# Mandatory and optional deps via conan
# -----------------------------------------------------------------------------
option(ENABLE_CONAN "Enable conan for deps discovery (used for windows CI for instance) features." OFF)


if (ENABLE_CONAN)
message(STATUS "Conan enabled for deps")

if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/0.18.1/conan.cmake"
"${CMAKE_BINARY_DIR}/conan.cmake"
STATUS DOWNLOAD_STATUS
TLS_VERIFY ON)
list(GET DOWNLOAD_STATUS 0 STATUS_CODE)
list(GET DOWNLOAD_STATUS 1 ERROR_MESSAGE)
# Check if download was successful.
if(${STATUS_CODE} EQUAL 0)
message(STATUS "Download completed successfully!")
else()
message(STATUS "Error occurred during download: ${ERROR_MESSAGE}")
message(STATUS "Trying turning TLS_VERIFY OFF")
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/0.18.1/conan.cmake"
"${CMAKE_BINARY_DIR}/conan.cmake"
STATUS DOWNLOAD_STATUS
TLS_VERIFY OFF)
list(GET DOWNLOAD_STATUS 0 STATUS_CODE)
list(GET DOWNLOAD_STATUS 1 ERROR_MESSAGE)
if(${STATUS_CODE} EQUAL 0)
message(STATUS "Download completed successfully!")
else()
message(FATAL_ERROR "Error occurred during download: ${ERROR_MESSAGE}")
endif()
endif()
endif()

include("${CMAKE_BINARY_DIR}/conan.cmake")

conan_cmake_configure(REQUIRES zlib/1.2.13
boost/1.81.0
gmp/6.2.1
fftw/3.3.9
#cairo/1.17.6
#libpng/1.6.39 #Explicit fix deps (compat issues)
#expat/2.5.0
#openssl/1.1.1s
#libiconv/1.17
OPTIONS boost:header_only=True
gmp:enable_cxx=True
GENERATORS cmake_find_package)

conan_cmake_autodetect(settings)
conan_cmake_install(PATH_OR_REFERENCE .
BUILD missing
REMOTE conancenter
SETTINGS ${settings})

set(FFTW3_DIR ${CONAN_FFTW_ROOT})
message(STATUS "Setting FFTW3_DIR to ${CONAN_FFTW_ROOT}")
else()
message(STATUS "Conan disabled")
endif()

# -----------------------------------------------------------------------------
# Looking for boost
# -----------------------------------------------------------------------------
Expand Down
14 changes: 14 additions & 0 deletions conanfile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[requires]
fmt/9.1.0
zlib/1.2.13
boost/1.81.0
gmp/6.3.0
fftw/3.3.9

[generators]
CMakeDeps
CMakeToolchain

[options]
boost*:header_only=True
gmp*:enable_cxx=True
20 changes: 3 additions & 17 deletions examples/polyscope-examples/dgtalCalculus-geodesic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,25 +93,11 @@ void precompute()
auto surfels = SH3::getSurfelRange( surface, params2 );
iinormals = SHG3::getIINormalVectors(binary_image, surfels,params2);
trace.info()<<iinormals.size()<<std::endl;
auto myProjEmbedder = [&](Face f, Vertex v)
{
const auto nn = iinormals[f];
RealPoint centroid(0.0,0.0,0.0); //centroid of the original face
auto cpt=0;
for(auto v: surfmesh.incidentVertices(f))
{
cpt++;
centroid += surfmesh.position(v);
}
centroid = centroid / (double)cpt;
RealPoint p = surfmesh.position(v);
auto cp = p-centroid;
RealPoint q = p - nn.dot(cp)*nn;
return q;
};
psMesh->addFaceVectorQuantity("II normals", iinormals);

calculus = new PolyCalculus(surfmesh);
calculus->setEmbedder( myProjEmbedder );
functors::EmbedderFromNormalVectors<Z3i::RealPoint, Z3i::RealVector> embedderFromNormals(iinormals,surfmesh);
calculus->setEmbedder( embedderFromNormals );
}

heat = new GeodesicsInHeat<PolyCalculus>(calculus);
Expand Down
Loading
Loading