diff --git a/.clang-format b/.clang-format index 63f78edb55a..e7623066a4d 100644 --- a/.clang-format +++ b/.clang-format @@ -2,7 +2,7 @@ BasedOnStyle: Google IndentWidth: 4 ColumnLimit: 80 UseTab: Never -Standard: c++14 +Standard: c++17 ContinuationIndentWidth: 8 AccessModifierOffset: -4 BinPackParameters: false diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 82b6472653d..a184df2ec42 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -32,9 +32,9 @@ jobs: strategy: fail-fast: false matrix: - # macos-12 is Intel runner, macos-14 is Apple Silicon + # macos-13 is Intel runner, macos-14 is Apple Silicon # https://github.com/actions/runner-images - os: [macos-12, macos-14] + os: [macos-13, macos-14] CONFIG: [ON, OFF] env: BUILD_SHARED_LIBS: ${{ matrix.CONFIG }} @@ -62,21 +62,15 @@ jobs: - name: Set up Python version uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: '3.12' - name: Install dependencies run: | brew install ccache pkg-config - if [[ ${{ runner.arch}} == "ARM64" ]]; then + if [[ ${{ runner.arch }} == "ARM64" ]]; then # Fix gfortran not found issue ln -s $(which gfortran-13) /usr/local/bin/gfortran - - # Default macos-14 image Xcode (version 15.0.1) linker causes build issues. - # Newer Xcode versions work, but embree recommends Apple clang <= 14 on - # arm64 to avoid possible "EXEC_BAD_INSTRUCTION" runtime exceptions: - # https://github.com/embree/embree/releases/tag/v4.3.1 - sudo xcode-select -switch /Applications/Xcode_14.3.1.app fi # Install libomp 11.1.0 from old brew bottle for x64 catalina (10.15) @@ -84,7 +78,6 @@ jobs: # install for the current OS. # https://github.com/microsoft/LightGBM/issues/4229 if [[ ${{ runner.arch}} == "X64" ]]; then - brew unlink libomp # x64 catalina (10.15) bottle export LIBOMP_BOTTLE_HASH=45a5aa653bd45bd5ff5858580b1a4670c4b5a51ea29d68d45a53f72f56010e05 else # ARM64 @@ -142,7 +135,7 @@ jobs: permissions: contents: write # Release upload name: Fuse x64 and ARM64 viewer app - runs-on: [macos-12] + runs-on: [macos-13] needs: [MacOS] steps: - name: Checkout source code # for gh release upload @@ -191,10 +184,10 @@ jobs: fail-fast: false # https://github.community/t/how-to-conditionally-include-exclude-items-in-matrix-eg-based-on-branch/16853/6 matrix: - # macos-12 is Intel runner, macos-14 is Apple Silicon + # macos-13 is Intel runner, macos-14 is Apple Silicon # https://github.com/actions/runner-images - os: [macos-12, macos-14] - python_version: ['3.8', '3.9', '3.10', '3.11'] + os: [macos-13, macos-14] + python_version: ['3.8', '3.9', '3.10', '3.11', '3.12'] is_main: - ${{ github.ref == 'refs/heads/main' }} exclude: @@ -209,9 +202,13 @@ jobs: python_version: '3.9' - is_main: false python_version: '3.10' + - is_main: false + python_version: '3.11' env: BUILD_CUDA_MODULE: OFF + # TensorFlow v2.16 does not support Python 3.8 + BUILD_TENSORFLOW_OPS: ${{ matrix.python_version == '3.8' && 'OFF' || 'ON' }} OPEN3D_ML_ROOT: ${{ github.workspace }}/Open3D-ML steps: - name: Checkout source code @@ -256,12 +253,10 @@ jobs: # Fix macos-14 arm64 runner image issues, see comments in MacOS job. if [[ ${{ runner.arch}} == "ARM64" ]]; then ln -s $(which gfortran-13) /usr/local/bin/gfortran - sudo xcode-select -switch /Applications/Xcode_14.3.1.app fi # Install libomp 11.1.0. See comment above. if [[ ${{ runner.arch}} == "X64" ]]; then - brew unlink libomp # x64 catalina (10.15) bottle export LIBOMP_BOTTLE_HASH=45a5aa653bd45bd5ff5858580b1a4670c4b5a51ea29d68d45a53f72f56010e05 else # ARM64 @@ -291,22 +286,33 @@ jobs: path: build/lib/python_package/pip_package/${{ env.PIP_PKG_NAME }} if-no-files-found: error + - name: Update devel release (x86_64 only wheels) + if: ${{ github.ref == 'refs/heads/main' && (matrix.python_version == '3.8' || matrix.python_version == '3.9') }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release upload main-devel build/lib/python_package/pip_package/${{ env.PIP_PKG_NAME }} --clobber + gh release view main-devel + + fuse-wheel: name: Fuse universal2 wheel permissions: contents: write # Release upload - runs-on: [macos-12] + runs-on: [macos-13] needs: [build-wheel] strategy: fail-fast: false # https://github.community/t/how-to-conditionally-include-exclude-items-in-matrix-eg-based-on-branch/16853/6 matrix: - python_version: ['3.10', '3.11'] + python_version: ['3.10', '3.11', '3.12'] is_main: - ${{ github.ref == 'refs/heads/main' }} exclude: - is_main: false python_version: '3.10' + - is_main: false + python_version: '3.11' steps: - name: Checkout source code # for gh release upload uses: actions/checkout@v4 @@ -336,11 +342,8 @@ jobs: PYTAG="-cp$(echo ${{ env.python_version }} | tr -d '.')" mkdir universal_wheels pip install delocate - delocate-fuse -v x64_wheels/open3d-*${PYTAG}*.whl arm64_wheels/open3d-*${PYTAG}*.whl - # Normalize file name as delocate-fuse doesn't update it - OLD_WHL_NAME=$(basename x64_wheels/open3d-*${PYTAG}*.whl) - NEW_WHL_NAME=${OLD_WHL_NAME/x86_64/universal2} - mv x64_wheels/${OLD_WHL_NAME} universal_wheels/${NEW_WHL_NAME} + delocate-merge -v -w universal_wheels x64_wheels/open3d-*${PYTAG}*.whl arm64_wheels/open3d-*${PYTAG}*.whl + NEW_WHL_NAME=$(basename universal_wheels/open3d-*${PYTAG}*.whl) echo "PIP_PKG_NAME=$NEW_WHL_NAME" >> $GITHUB_ENV - name: Upload merged wheels @@ -367,8 +370,8 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-12, macos-14] - python_version: ['3.8', '3.9', '3.10', '3.11'] + os: [macos-13, macos-14] + python_version: ['3.8', '3.9', '3.10', '3.11', '3.12'] is_main: - ${{ github.ref == 'refs/heads/main' }} exclude: @@ -382,6 +385,8 @@ jobs: python_version: '3.9' - is_main: false python_version: '3.10' + - is_main: false + python_version: '3.11' env: OPEN3D_ML_ROOT: ${{ github.workspace }}/Open3D-ML @@ -393,6 +398,7 @@ jobs: uses: actions/checkout@v4 with: repository: isl-org/Open3D-ML + ref: main path: ${{ env.OPEN3D_ML_ROOT }} - name: Download wheels diff --git a/.github/workflows/ubuntu-cuda.yml b/.github/workflows/ubuntu-cuda.yml index 0a6a71ed239..00dd303dcf1 100644 --- a/.github/workflows/ubuntu-cuda.yml +++ b/.github/workflows/ubuntu-cuda.yml @@ -54,15 +54,15 @@ jobs: fail-fast: false matrix: include: - - CI_CONFIG: 2-bionic - - CI_CONFIG: 3-ml-shared-bionic - - CI_CONFIG: 4-shared-bionic - - CI_CONFIG: 5-ml-focal + - CI_CONFIG: 2-focal + - CI_CONFIG: 3-ml-shared-focal + - CI_CONFIG: 4-shared-focal + - CI_CONFIG: 5-ml-jammy env: # Export everything from matrix to be easily used. # Docker tag and ccache names must be consistent with docker_build.sh CI_CONFIG : ${{ matrix.CI_CONFIG }} - BUILD_PACKAGE : ${{ contains(fromJson('["3-ml-shared-bionic", "4-shared-bionic"]'), matrix.CI_CONFIG) }} + BUILD_PACKAGE : ${{ contains(fromJson('["3-ml-shared-focal", "4-shared-focal"]'), matrix.CI_CONFIG) }} GCE_INSTANCE_PREFIX: open3d-ci-${{ matrix.CI_CONFIG }} DOCKER_TAG : open3d-ci:${{ matrix.CI_CONFIG }} CCACHE_TAR_NAME : open3d-ci-${{ matrix.CI_CONFIG }} @@ -180,7 +180,7 @@ jobs: gcloud compute ssh "${INSTANCE_NAME}" \ --zone="${GCE_ZONE}" \ --command="ls -alh \ - && gsutil cp ${CCACHE_TAR_NAME}.tar.gz gs://open3d-ci-cache/" + && gsutil cp ${CCACHE_TAR_NAME}.tar.xz gs://open3d-ci-cache/" - name: VM delete if: always() diff --git a/.github/workflows/ubuntu-wheel.yml b/.github/workflows/ubuntu-wheel.yml index 3b935a75811..411fe6a37bb 100644 --- a/.github/workflows/ubuntu-wheel.yml +++ b/.github/workflows/ubuntu-wheel.yml @@ -33,7 +33,7 @@ jobs: strategy: fail-fast: false matrix: - python_version: ['3.8', '3.9', '3.10', '3.11'] + python_version: ['3.8', '3.9', '3.10', '3.11', '3.12'] is_main: - ${{ github.ref == 'refs/heads/main' }} exclude: @@ -43,10 +43,12 @@ jobs: python_version: '3.9' - is_main: false python_version: '3.10' + - is_main: false + python_version: '3.11' env: DEVELOPER_BUILD: ${{ github.event.inputs.developer_build || 'ON' }} PYTHON_VERSION: ${{ matrix.python_version }} - CCACHE_TAR_NAME: open3d-ubuntu-1804-cuda-ci-ccache + CCACHE_TAR_NAME: open3d-ubuntu-2004-cuda-ci-ccache OPEN3D_CPU_RENDERING: true steps: - name: Checkout source code @@ -67,6 +69,8 @@ jobs: docker/docker_build.sh cuda_wheel_py310_dev elif [ "${{ env.PYTHON_VERSION }}" = "3.11" ] && [ "${{ env.DEVELOPER_BUILD }}" = "ON" ]; then docker/docker_build.sh cuda_wheel_py311_dev + elif [ "${{ env.PYTHON_VERSION }}" = "3.12" ] && [ "${{ env.DEVELOPER_BUILD }}" = "ON" ]; then + docker/docker_build.sh cuda_wheel_py312_dev elif [ "${{ env.PYTHON_VERSION }}" = "3.8" ] && [ "${{ env.DEVELOPER_BUILD }}" = "OFF" ]; then docker/docker_build.sh cuda_wheel_py38 elif [ "${{ env.PYTHON_VERSION }}" = "3.9" ] && [ "${{ env.DEVELOPER_BUILD }}" = "OFF" ]; then @@ -75,6 +79,8 @@ jobs: docker/docker_build.sh cuda_wheel_py310 elif [ "${{ env.PYTHON_VERSION }}" = "3.11" ] && [ "${{ env.DEVELOPER_BUILD }}" = "OFF" ]; then docker/docker_build.sh cuda_wheel_py311 + elif [ "${{ env.PYTHON_VERSION }}" = "3.12" ] && [ "${{ env.DEVELOPER_BUILD }}" = "OFF" ]; then + docker/docker_build.sh cuda_wheel_py312 fi PIP_PKG_NAME="$(basename ${GITHUB_WORKSPACE}/open3d-[0-9]*.whl)" PIP_CPU_PKG_NAME="$(basename ${GITHUB_WORKSPACE}/open3d_cpu*.whl)" @@ -122,7 +128,7 @@ jobs: strategy: fail-fast: false matrix: - python_version: ['3.8', '3.9', '3.10', '3.11'] + python_version: ['3.8', '3.9', '3.10', '3.11', '3.12'] is_main: - ${{ github.ref == 'refs/heads/main' }} exclude: @@ -132,6 +138,8 @@ jobs: python_version: '3.9' - is_main: false python_version: '3.10' + - is_main: false + python_version: '3.11' env: OPEN3D_ML_ROOT: ${{ github.workspace }}/Open3D-ML steps: diff --git a/.github/workflows/vtk_packages.yml b/.github/workflows/vtk_packages.yml index 25116f9d6ce..f447193a5bd 100644 --- a/.github/workflows/vtk_packages.yml +++ b/.github/workflows/vtk_packages.yml @@ -11,7 +11,7 @@ jobs: permissions: contents: write # TODO: Convert to docker - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - name: Checkout source code uses: actions/checkout@v4 diff --git a/.github/workflows/webrtc.yml b/.github/workflows/webrtc.yml index 7689c9d681f..263c5462130 100644 --- a/.github/workflows/webrtc.yml +++ b/.github/workflows/webrtc.yml @@ -30,10 +30,10 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-18.04, macos-11] + os: [ubuntu-20.04, macos-12] GLIBCXX_USE_CXX11_ABI: [0, 1] exclude: - - os: macos-11 + - os: macos-12 GLIBCXX_USE_CXX11_ABI: 0 env: GLIBCXX_USE_CXX11_ABI: ${{ matrix.GLIBCXX_USE_CXX11_ABI }} @@ -48,7 +48,7 @@ jobs: python-version: 3.8 - name: Install dependencies - if: ${{ matrix.os == 'ubuntu-18.04' }} + if: ${{ matrix.os == 'ubuntu-20.04' }} run: | source 3rdparty/webrtc/webrtc_build.sh install_dependencies_ubuntu diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index c5dab02900f..04a408802d0 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -25,6 +25,7 @@ env: STOOLS_VER: "67.3.2" JEDI_VER: "0.17.2" # https://github.com/ipython/ipython/issues/12740 IDNA_VER: "2.8" # https://github.com/psf/requests/issues/5710 + CUDA_VERSION: "12.1.0" SRC_DIR: "D:\\a\\open3d\\open3d" BUILD_DIR: "C:\\Open3D\\build" NPROC: 2 @@ -47,7 +48,6 @@ jobs: STATIC_RUNTIME: ON include: - BUILD_CUDA_MODULE: ON - CUDA_VERSION: 11.0.3 env: BUILD_WEBRTC: ${{ ( matrix.BUILD_SHARED_LIBS == 'OFF' && matrix.STATIC_RUNTIME == 'ON' ) && 'ON' || 'OFF' }} @@ -64,20 +64,20 @@ jobs: if: ${{ matrix.BUILD_CUDA_MODULE == 'ON' }} run: | # Define variables - $CUDA_VER_FULL = "${{ matrix.CUDA_VERSION }}" + $CUDA_VER_FULL = "${{ env.CUDA_VERSION }}" $CUDA_VER_ARR = $CUDA_VER_FULL.Split(".") $CUDA_VER = "$($CUDA_VER_ARR[0]).$($CUDA_VER_ARR[1])" $CUDA_VER_ID = "$($CUDA_VER_ARR[0])_$($CUDA_VER_ARR[1])" # Installer url if ( $CUDA_VER_ARR[0] -ge 11 ) { - $CUDA_URL = "http://developer.download.nvidia.com/compute/cuda/$CUDA_VER_FULL/network_installers/cuda_$($CUDA_VER_FULL)_win10_network.exe" + $CUDA_URL = "http://developer.download.nvidia.com/compute/cuda/$CUDA_VER_FULL/network_installers/cuda_$($CUDA_VER_FULL)_windows_network.exe" } else { $CUDA_URL = "http://developer.download.nvidia.com/compute/cuda/$CUDA_VER/Prod/network_installers/cuda_$($CUDA_VER_FULL)_win10_network.exe" } # Installer arguments $CUDA_INSTALL_ARGS = "-s" # Required packages - $CUDA_PACKAGES = "nvcc", "visual_studio_integration", "cublas", "cublas_dev", "cudart", "cusolver", "cusolver_dev", "npp", "npp_dev" + $CUDA_PACKAGES = "nvcc", "visual_studio_integration", "cublas", "cublas_dev", "cudart", "cusolver", "cusolver_dev", "npp", "npp_dev", "thrust" $CUDA_PACKAGES.ForEach({ $CUDA_INSTALL_ARGS += " $($_)_$($CUDA_VER)" }) # Download and install CUDA echo "Downloading CUDA installer from $CUDA_URL" @@ -110,6 +110,7 @@ jobs: if (${env:DEVELOPER_BUILD} -ne "OFF") { ${env:DEVELOPER_BUILD}="ON" } + cmake --version cmake -G "Visual Studio 16 2019" -A x64 ` -DDEVELOPER_BUILD="${env:DEVELOPER_BUILD}" ` -DCMAKE_SYSTEM_VERSION="10.0.19041.0" ` @@ -200,10 +201,9 @@ jobs: echo "Add --gtest_random_seed=SEED to the test command to repeat this test sequence." .\bin\${{ matrix.CONFIG }}\tests.exe --gtest_shuffle --gtest_filter=-*ReduceSum64bit2DCase0*:*ReduceSum64bit2DCase3* - name: Linking to Open3D + working-directory: ${{ env.SRC_DIR }}/examples/cmake/open3d-cmake-find-package run: | $ErrorActionPreference = 'Stop' - git clone https://github.com/isl-org/open3d-cmake-find-package.git - cd open3d-cmake-find-package mkdir build cd build cmake -G "Visual Studio 16 2019" -A x64 ` @@ -241,7 +241,7 @@ jobs: fail-fast: false # https://github.community/t/how-to-conditionally-include-exclude-items-in-matrix-eg-based-on-branch/16853/6 matrix: - python_version: ['3.8', '3.9', '3.10', '3.11'] + python_version: ['3.8', '3.9', '3.10', '3.11', '3.12'] is_main: - ${{ github.ref == 'refs/heads/main' }} exclude: @@ -251,6 +251,8 @@ jobs: python_version: '3.9' - is_main: false python_version: '3.10' + - is_main: false + python_version: '3.11' steps: - name: Checkout source code @@ -329,7 +331,7 @@ jobs: strategy: fail-fast: false matrix: - python_version: ['3.8', '3.9', '3.10', '3.11'] + python_version: ['3.8', '3.9', '3.10', '3.11', '3.12'] is_main: - ${{ github.ref == 'refs/heads/main' }} exclude: @@ -339,6 +341,8 @@ jobs: python_version: '3.9' - is_main: false python_version: '3.10' + - is_main: false + python_version: '3.11' steps: - name: Checkout source code diff --git a/3rdparty/README.md b/3rdparty/README.md index c7c9f94a74e..b494ac77fc7 100644 --- a/3rdparty/README.md +++ b/3rdparty/README.md @@ -8,139 +8,138 @@ system dependencies. ```txt -------------------------------------------------------------------------------- +benchmark 1.5.5 Apache-2 license +A microbenchmark support library +https://github.com/google/benchmark +-------------------------------------------------------------------------------- +boringssl: edfe413 Dual OpenSSL, SSLeay, ISC license +BoringSSL is a fork of OpenSSL that is designed to meet Google's needs. +https://github.com/google/boringssl +-------------------------------------------------------------------------------- +CUB 1.8.0 BSD license +A flexible library of cooperative threadblock primitives and other utilities for +CUDA kernel programming +https://github.com/NVlabs/cub +-------------------------------------------------------------------------------- +cppzmq 4.6.0 MIT license +Header-only C++ binding for libzmq +https://github.com/zeromq/cppzmq +As an alternative, you can modify 3rdparty/zeromq/zeromq_build.cmake to fetch +zeromq from our fork +https://github.com/isl-org/libzmq +-------------------------------------------------------------------------------- +curl 7.88.0 Curl license +Curl is a command-line tool for transferring data specified with URL syntax. +https://github.com/curl/curl +-------------------------------------------------------------------------------- +CUTLASS 1.3.3 BSD license +CUDA Templates for Linear Algebra Subroutines +https://github.com/NVIDIA/cutlass +-------------------------------------------------------------------------------- +dirent 1.21 MIT license +https://github.com/tronkko/dirent +A C/C++ programming interface for cross-platform filesystem +-------------------------------------------------------------------------------- +DirectX-Headers v1.606.3 MIT license +Official DirectX headers available under an open source license +https://github.com/microsoft/DirectX-Headers +-------------------------------------------------------------------------------- +DirectXMath may2022 MIT license +DirectXMath is an all inline SIMD C++ linear algebra library for use in games +and graphics apps +https://github.com/microsoft/DirectXMath +-------------------------------------------------------------------------------- Eigen 3.4 Mainly MPL2 license A high-level C++ library of template headers for linear algebra, matrix and vector operations, numerical solvers and related algorithms http://eigen.tuxfamily.org/ -------------------------------------------------------------------------------- -GLFW 3.3.0 (dev) zlib/libpng license -A cross-platform library for creating windows with OpenGL contexts and receiving -input and events -http://www.glfw.org/ +embree 4.3.1 Apache-2 license +Embree is a collection of high-performance ray tracing kernels +https://github.com/embree/embree +-------------------------------------------------------------------------------- +flann 1.8.4 BSD license +A C++ library for performing fast approximate nearest neighbor searches in high +dimensional spaces +http://www.cs.ubc.ca/research/flann/ -------------------------------------------------------------------------------- GLEW 2.1.0 MIT License A cross-platform open-source C/C++ extension loading library http://glew.sourceforge.net/ -------------------------------------------------------------------------------- -RPly 1.1.3 MIT license -A library to read and write PLY files -http://w3.impa.br/~diego/software/rply/ --------------------------------------------------------------------------------- -zlib 1.2.8 zlib license -A lossless data-compression library used by libpng -http://www.zlib.net/ --------------------------------------------------------------------------------- -libpng 1.6.18 libpng license -The free reference library for reading and writing PNGs -http://www.libpng.org/ --------------------------------------------------------------------------------- -libjpeg 9a libjpeg license -A widely used C library for reading and writing JPEG image files -http://libjpeg.sourceforge.net/ +GLFW 3.3.0 (dev) zlib/libpng license +A cross-platform library for creating windows with OpenGL contexts and receiving +input and events +http://www.glfw.org/ -------------------------------------------------------------------------------- jsoncpp 1.8.4 MIT license A C++ library that allows manipulating JSON values https://github.com/open-source-parsers/jsoncpp -------------------------------------------------------------------------------- -flann 1.8.4 BSD license -A C++ library for performing fast approximate nearest neighbor searches in high -dimensional spaces -http://www.cs.ubc.ca/research/flann/ +libjpeg-turbo 2.1.5.1 BSD-style license +A widely used C library for reading and writing JPEG image files +https://github.com/libjpeg-turbo/libjpeg-turbo -------------------------------------------------------------------------------- -dirent 1.21 MIT license -https://github.com/tronkko/dirent -A C/C++ programming interface for cross-platform filesystem +libpng 1.6.37 libpng license +The free reference library for reading and writing PNGs +http://www.libpng.org/ -------------------------------------------------------------------------------- librealsense 2.44.0 Apache-2 license A cross-platform library for capturing data from the Intel RealSense F200, SR300, R200 and L500 cameras https://github.com/IntelRealSense/librealsense -------------------------------------------------------------------------------- -tinyfiledialogs 2.7.2 zlib license -A lightweight cross-platform file dialog library -https://sourceforge.net/projects/tinyfiledialogs/ --------------------------------------------------------------------------------- -tinygltf v2.2.0 MIT license -Header only C++11 tiny glTF 2.0 library -https://github.com/syoyo/tinygltf --------------------------------------------------------------------------------- -tinyobjloader v1.0.0 MIT license -Tiny but powerful single file wavefront obj loader -https://github.com/syoyo/tinyobjloader --------------------------------------------------------------------------------- -pybind11 v2.6.2 BSD license -Python binding for C++11 -https://github.com/pybind/pybind11 --------------------------------------------------------------------------------- -PoissonReco 12.0 BSD license -Poisson Surface Reconstruction -https://github.com/mkazhdan/PoissonRecon --------------------------------------------------------------------------------- -Parallel STL 20190522 Apache-2 license -An implementation of the C++ standard library algorithms with support for -execution policies -https://github.com/oneapi-src/oneDPL +libzmq 4.3.3 LGPLv3 + static link exception license +ZeroMQ is a high-performance asynchronous messaging library +https://github.com/zeromq/libzmq -------------------------------------------------------------------------------- -CUB 1.8.0 BSD license -A flexible library of cooperative threadblock primitives and other utilities for -CUDA kernel programming -https://github.com/NVlabs/cub +msgpack-c 3.3.0 Boost Software License 1.0 +MessagePack implementation for C and C++ +https://github.com/msgpack/msgpack-c/tree/cpp_master -------------------------------------------------------------------------------- nanoflann 1.3.1 BSD license A C++11 header-only library for Nearest Neighbor (NN) search with KD-trees https://github.com/jlblancoc/nanoflann -------------------------------------------------------------------------------- -CUTLASS 1.3.3 BSD license -CUDA Templates for Linear Algebra Subroutines -https://github.com/NVIDIA/cutlass +PoissonReco 12.0 BSD license +Poisson Surface Reconstruction +https://github.com/mkazhdan/PoissonRecon -------------------------------------------------------------------------------- -benchmark 1.5.0 Apache-2 license -A microbenchmark support library -https://github.com/google/benchmark +pybind11 v2.13.1 BSD license +Python binding for C++11 +https://github.com/pybind/pybind11 -------------------------------------------------------------------------------- -msgpack-c da2fc25f8 Boost Software License 1.0 -MessagePack implementation for C and C++ -https://github.com/msgpack/msgpack-c/tree/cpp_master +RPly 1.1.3 MIT license +A library to read and write PLY files +http://w3.impa.br/~diego/software/rply/ -------------------------------------------------------------------------------- -libzmq 4.3.2 LGPLv3 + static link exception license -ZeroMQ is a high-performance asynchronous messaging library -https://github.com/zeromq/libzmq +stdgpu 1b6a3319 Apache-2.0 license +Efficient STL-like Data Structures on the GPU +https://github.com/stotko/stdgpu/ -------------------------------------------------------------------------------- -cppzmq 4.6.0 MIT license -Header-only C++ binding for libzmq -https://github.com/zeromq/cppzmq -As an alternative, you can modify 3rdparty/zeromq/zeromq_build.cmake to fetch -zeromq from our fork -https://github.com/isl-org/libzmq +tinyfiledialogs 2.7.2 zlib license +A lightweight cross-platform file dialog library +https://sourceforge.net/projects/tinyfiledialogs/ -------------------------------------------------------------------------------- -embree 3.13.0 Apache-2 license -Embree is a collection of high-performance ray tracing kernels -https://github.com/embree/embree +tinygltf 72f4a55 MIT license +Header only C++11 tiny glTF 2.0 library +https://github.com/syoyo/tinygltf -------------------------------------------------------------------------------- -curl 7.79.1 Curl license -Curl is a command-line tool for transferring data specified with URL syntax. -https://github.com/curl/curl +tinyobjloader v1.0.0 MIT license +Tiny but powerful single file wavefront obj loader +https://github.com/syoyo/tinyobjloader -------------------------------------------------------------------------------- -boringssl: edfe413 Dual OpenSSL, SSLeay, ISC license -BoringSSL is a fork of OpenSSL that is designed to meet Google's needs. -https://github.com/google/boringssl +UVAtlas may2022 MIT license +UVAtlas isochart texture atlas +https://github.com/microsoft/uvatlas -------------------------------------------------------------------------------- vtk 9.1 BSD license The Visualization Toolkit (VTK) https://gitlab.kitware.com/vtk/vtk -------------------------------------------------------------------------------- -DirectX-Headers v1.606.3 MIT license -Official DirectX headers available under an open source license -https://github.com/microsoft/DirectX-Headers --------------------------------------------------------------------------------- -DirectXMath may2022 MIT license -DirectXMath is an all inline SIMD C++ linear algebra library for use in games -and graphics apps -https://github.com/microsoft/DirectXMath --------------------------------------------------------------------------------- -UVAtlas may2022 MIT license -UVAtlas isochart texture atlas -https://github.com/microsoft/uvatlas +zlib 1.2.13 zlib license +A lossless data-compression library used by libpng +http://www.zlib.net/ -------------------------------------------------------------------------------- ``` diff --git a/3rdparty/boringssl/boringssl.cmake b/3rdparty/boringssl/boringssl.cmake index 5f9aeea9e33..5048b76648f 100644 --- a/3rdparty/boringssl/boringssl.cmake +++ b/3rdparty/boringssl/boringssl.cmake @@ -48,7 +48,9 @@ ExternalProject_Add( CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" - BUILD_BYPRODUCTS "" + BUILD_BYPRODUCTS + /$<$:$,Debug,Release>/>lib/${CMAKE_STATIC_LIBRARY_PREFIX}ssl${CMAKE_STATIC_LIBRARY_SUFFIX} + /$<$:$,Debug,Release>/>lib/${CMAKE_STATIC_LIBRARY_PREFIX}crypto${CMAKE_STATIC_LIBRARY_SUFFIX} ) ExternalProject_Get_Property(ext_boringssl SOURCE_DIR) diff --git a/3rdparty/cmake/FindPytorch.cmake b/3rdparty/cmake/FindPytorch.cmake index eb2a53e2ec5..08bf18b001f 100644 --- a/3rdparty/cmake/FindPytorch.cmake +++ b/3rdparty/cmake/FindPytorch.cmake @@ -14,6 +14,20 @@ # # and import the target 'torch'. +# "80-real" to "8.0" and "80" to "8.0+PTX": +macro(translate_arch_string input output) + if("${input}" MATCHES "[0-9]+-real") + string(REGEX REPLACE "([1-9])([0-9])-real" "\\1.\\2" version "${input}") + elseif("${input}" MATCHES "([0-9]+)") + string(REGEX REPLACE "([1-9])([0-9])" "\\1.\\2+PTX" version "${input}") + elseif("${input}" STREQUAL "native") + set(version "Auto") + else() + message(FATAL_ERROR "Invalid architecture string: ${input}") + endif() + set(${output} "${version}") +endmacro() + if(NOT Pytorch_FOUND) # Searching for pytorch requires the python executable if (NOT Python3_EXECUTABLE) @@ -41,6 +55,17 @@ if(NOT Pytorch_FOUND) unset(PyTorch_FETCH_PROPERTIES) unset(PyTorch_PROPERTIES) + if(BUILD_CUDA_MODULE) + # Using CUDA 12.x and Pytorch <2.4 gives the error "Unknown CUDA Architecture Name 9.0a in CUDA_SELECT_NVCC_ARCH_FLAGS". + # As a workaround we explicitly set TORCH_CUDA_ARCH_LIST + set(TORCH_CUDA_ARCH_LIST "") + foreach(arch IN LISTS CMAKE_CUDA_ARCHITECTURES) + translate_arch_string("${arch}" ptarch) + list(APPEND TORCH_CUDA_ARCH_LIST "${ptarch}") + endforeach() + message(STATUS "Using top level CMAKE_CUDA_ARCHITECTURES for TORCH_CUDA_ARCH_LIST: ${TORCH_CUDA_ARCH_LIST}") + endif() + # Use the cmake config provided by torch find_package(Torch REQUIRED PATHS "${Pytorch_ROOT}" NO_DEFAULT_PATH) diff --git a/3rdparty/curl/curl.cmake b/3rdparty/curl/curl.cmake index 14ee47f2210..7a73051c1c0 100644 --- a/3rdparty/curl/curl.cmake +++ b/3rdparty/curl/curl.cmake @@ -51,6 +51,7 @@ if(BUILD_CURL_FROM_SOURCE) ${ExternalProject_CMAKE_ARGS_hidden} BUILD_BYPRODUCTS /${Open3D_INSTALL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${curl_lib_name}${CMAKE_STATIC_LIBRARY_SUFFIX} + /${Open3D_INSTALL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${curl_lib_name}-d${CMAKE_STATIC_LIBRARY_SUFFIX} ) ExternalProject_Get_Property(ext_curl INSTALL_DIR) @@ -65,7 +66,7 @@ else() # Optimize for Ubuntu x86. Curl can take a long time to configure. # # To generate pre-compiled curl: - # 1. Use Ubuntu 18.04 (eg. in docker), not 20.04+. + # 1. Use oldest supported Ubuntu (eg. in docker), not the latest. # 2. -DBUILD_CURL_FROM_SOURCE=ON, build Open3D: make ext_curl # 3. cd build/curl # 4. tar -czvf curl_7.88.0_linux_x86_64.tar.gz include lib @@ -79,7 +80,9 @@ else() CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" - BUILD_BYPRODUCTS "" + BUILD_BYPRODUCTS + /lib/${CMAKE_STATIC_LIBRARY_PREFIX}${curl_lib_name}${CMAKE_STATIC_LIBRARY_SUFFIX} + /lib/${CMAKE_STATIC_LIBRARY_PREFIX}${curl_lib_name}-d${CMAKE_STATIC_LIBRARY_SUFFIX} ) ExternalProject_Get_Property(ext_curl SOURCE_DIR) diff --git a/3rdparty/embree/embree.cmake b/3rdparty/embree/embree.cmake index 35d27f11048..6d55198ec69 100644 --- a/3rdparty/embree/embree.cmake +++ b/3rdparty/embree/embree.cmake @@ -64,11 +64,21 @@ else() endif() +if(BUILD_SYCL_MODULE) + set(ISA_ARGS ${ISA_ARGS} -DCMAKE_CXX_COMPILER=icpx) + set(ISA_ARGS ${ISA_ARGS} -DCMAKE_C_COMPILER=icx) + set(ISA_ARGS ${ISA_ARGS} -DEMBREE_SYCL_SUPPORT=ON) + list(APPEND ISA_LIBS embree4_sycl ze_wrapper) + list(APPEND ISA_BUILD_BYPRODUCTS "/${Open3D_INSTALL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}embree4_sycl${CMAKE_STATIC_LIBRARY_SUFFIX}" + "/${Open3D_INSTALL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}ze_wrapper${CMAKE_STATIC_LIBRARY_SUFFIX}") +endif() + + ExternalProject_Add( ext_embree PREFIX embree - URL https://github.com/embree/embree/archive/refs/tags/v4.3.1.tar.gz - URL_HASH SHA256=824edcbb7a8cd393c5bdb7a16738487b21ecc4e1d004ac9f761e934f97bb02a4 + URL https://github.com/embree/embree/archive/refs/tags/v4.3.3.tar.gz + URL_HASH SHA256=8a3bc3c3e21aa209d9861a28f8ba93b2f82ed0dc93341dddac09f1f03c36ef2d DOWNLOAD_DIR "${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/embree" UPDATE_COMMAND "" CMAKE_ARGS @@ -92,10 +102,11 @@ ExternalProject_Add( /${Open3D_INSTALL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}sys${CMAKE_STATIC_LIBRARY_SUFFIX} /${Open3D_INSTALL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}math${CMAKE_STATIC_LIBRARY_SUFFIX} /${Open3D_INSTALL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}tasking${CMAKE_STATIC_LIBRARY_SUFFIX} + /${Open3D_INSTALL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}ze_wrapper${CMAKE_STATIC_LIBRARY_SUFFIX} ${ISA_BUILD_BYPRODUCTS} ) ExternalProject_Get_Property(ext_embree INSTALL_DIR) set(EMBREE_INCLUDE_DIRS ${INSTALL_DIR}/include/ ${INSTALL_DIR}/src/ext_embree/) # "/" is critical. set(EMBREE_LIB_DIR ${INSTALL_DIR}/${Open3D_INSTALL_LIB_DIR}) -set(EMBREE_LIBRARIES embree4 ${ISA_LIBS} simd lexers sys math tasking) +set(EMBREE_LIBRARIES embree4 simd lexers sys math tasking ${ISA_LIBS}) diff --git a/3rdparty/find_dependencies.cmake b/3rdparty/find_dependencies.cmake index 238f03d773a..8682e464ad8 100644 --- a/3rdparty/find_dependencies.cmake +++ b/3rdparty/find_dependencies.cmake @@ -168,6 +168,7 @@ set(ExternalProject_CMAKE_ARGS -DCMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER} -DCMAKE_CUDA_COMPILER_LAUNCHER=${CMAKE_CUDA_COMPILER_LAUNCHER} -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} + -DCMAKE_CUDA_FLAGS=${CMAKE_CUDA_FLAGS} -DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION} -DCMAKE_INSTALL_LIBDIR=${Open3D_INSTALL_LIB_DIR} # Always build 3rd party code in Release mode. Ignored by multi-config @@ -265,9 +266,15 @@ endfunction() # LIBRARIES # the expected library variable names to be found in . # If also defines targets, use them instead and pass them via TARGETS option. +# PATHS +# Paths with hardcoded guesses. Same as in find_package. +# DEPENDS +# Adds targets that should be build before "name" as dependency. # function(open3d_find_package_3rdparty_library name) - cmake_parse_arguments(arg "PUBLIC;HEADER;REQUIRED;QUIET" "PACKAGE;VERSION;PACKAGE_VERSION_VAR" "TARGETS;INCLUDE_DIRS;LIBRARIES" ${ARGN}) + cmake_parse_arguments(arg "PUBLIC;HEADER;REQUIRED;QUIET" + "PACKAGE;VERSION;PACKAGE_VERSION_VAR" + "TARGETS;INCLUDE_DIRS;LIBRARIES;PATHS;DEPENDS" ${ARGN}) if(arg_UNPARSED_ARGUMENTS) message(STATUS "Unparsed: ${arg_UNPARSED_ARGUMENTS}") message(FATAL_ERROR "Invalid syntax: open3d_find_package_3rdparty_library(${name} ${ARGN})") @@ -288,6 +295,9 @@ function(open3d_find_package_3rdparty_library name) if(arg_QUIET) list(APPEND find_package_args "QUIET") endif() + if (arg_PATHS) + list(APPEND find_package_args PATHS ${arg_PATHS} NO_DEFAULT_PATH) + endif() find_package(${arg_PACKAGE} ${find_package_args}) if(${arg_PACKAGE}_FOUND) message(STATUS "Using installed third-party library ${name} ${${arg_PACKAGE}_VERSION}") @@ -319,6 +329,9 @@ function(open3d_find_package_3rdparty_library name) set(Open3D_3RDPARTY_EXTERNAL_MODULES ${Open3D_3RDPARTY_EXTERNAL_MODULES} PARENT_SCOPE) endif() endif() + if(arg_DEPENDS) + add_dependencies(${name} ${arg_DEPENDS}) + endif() set(${name}_FOUND TRUE PARENT_SCOPE) set(${name}_VERSION ${${arg_PACKAGE_VERSION_VAR}} PARENT_SCOPE) add_library(${PROJECT_NAME}::${name} ALIAS ${name}) @@ -424,7 +437,7 @@ function(open3d_import_3rdparty_library name) else() set(HIDDEN 0) endif() - if(arg_GROUPED) + if(arg_GROUPED AND UNIX AND NOT APPLE) target_link_libraries(${name} INTERFACE "-Wl,--start-group") endif() foreach(arg_LIBRARY IN LISTS arg_LIBRARIES) @@ -453,7 +466,7 @@ function(open3d_import_3rdparty_library name) ${OPEN3D_HIDDEN_3RDPARTY_LINK_OPTIONS} PARENT_SCOPE) endif() endforeach() - if(arg_GROUPED) + if(arg_GROUPED AND UNIX AND NOT APPLE) target_link_libraries(${name} INTERFACE "-Wl,--end-group") endif() endif() @@ -1230,6 +1243,10 @@ if(BUILD_GUI) # If the default version is not sufficient, look for some specific versions if(NOT FILAMENT_C_COMPILER OR NOT FILAMENT_CXX_COMPILER) find_program(CLANG_VERSIONED_CC NAMES + clang-19 + clang-18 + clang-17 + clang-16 clang-15 clang-14 clang-13 @@ -1241,6 +1258,10 @@ if(BUILD_GUI) clang-7 ) find_program(CLANG_VERSIONED_CXX NAMES + clang++-19 + clang++-18 + clang++-17 + clang++-16 clang++-15 clang++-14 clang++-13 @@ -1268,7 +1289,7 @@ if(BUILD_GUI) # # On aarch64, the symbolic link path may not work for CMake's # find_library. Therefore, when compiling Filament from source, - # we explicitly find the corresponidng path based on the clang + # we explicitly find the corresponding path based on the clang # version. execute_process(COMMAND ${FILAMENT_CXX_COMPILER} --version OUTPUT_VARIABLE clang_version) if(clang_version MATCHES "clang version ([0-9]+)") @@ -1310,28 +1331,15 @@ if(BUILD_GUI) # We first search for these paths, and then search CMake's default # search path. LLVM version must be >= 7 to compile Filament. if (NOT CLANG_LIBDIR) - set(ubuntu_default_llvm_lib_dirs - /usr/lib/llvm-19/lib - /usr/lib/llvm-18/lib - /usr/lib/llvm-17/lib - /usr/lib/llvm-16/lib - /usr/lib/llvm-15/lib - /usr/lib/llvm-14/lib - /usr/lib/llvm-13/lib - /usr/lib/llvm-12/lib - /usr/lib/llvm-11/lib - /usr/lib/llvm-10/lib - /usr/lib/llvm-9/lib - /usr/lib/llvm-8/lib - /usr/lib/llvm-7/lib - ) - foreach(llvm_lib_dir in ${ubuntu_default_llvm_lib_dirs}) - message(STATUS "Searching ${llvm_lib_dir} for libc++ and libc++abi") - find_library(CPP_LIBRARY c++ PATHS ${llvm_lib_dir} NO_DEFAULT_PATH) + message(STATUS "Searching /usr/lib/llvm-[7..19]/lib/ for libc++ and libc++abi") + foreach(llvm_ver RANGE 7 19) + set(llvm_lib_dir "/usr/lib/llvm-${llvm_ver}/lib") + find_library(CPP_LIBRARY c++ PATHS ${llvm_lib_dir} NO_DEFAULT_PATH) find_library(CPPABI_LIBRARY c++abi PATHS ${llvm_lib_dir} NO_DEFAULT_PATH) if (CPP_LIBRARY AND CPPABI_LIBRARY) set(CLANG_LIBDIR ${llvm_lib_dir}) message(STATUS "CLANG_LIBDIR found in ubuntu-default: ${CLANG_LIBDIR}") + set(LIBCPP_VERSION ${llvm_ver}) break() endif() endforeach() @@ -1340,6 +1348,7 @@ if(BUILD_GUI) # Fallback to non-ubuntu-default paths. Note that the PATH_SUFFIXES # is not enforced by CMake. if (NOT CLANG_LIBDIR) + message(STATUS "Clang C++ libraries not found. Searching other paths...") find_library(CPPABI_LIBRARY c++abi PATH_SUFFIXES llvm-19/lib llvm-18/lib @@ -1355,7 +1364,10 @@ if(BUILD_GUI) llvm-8/lib llvm-7/lib ) + file(REAL_PATH ${CPPABI_LIBRARY} CPPABI_LIBRARY) get_filename_component(CLANG_LIBDIR ${CPPABI_LIBRARY} DIRECTORY) + string(REGEX MATCH "llvm-([0-9]+)/lib" _ ${CLANG_LIBDIR}) + set(LIBCPP_VERSION ${CMAKE_MATCH_1}) endif() # Find clang libraries at the exact path ${CLANG_LIBDIR}. @@ -1370,8 +1382,12 @@ if(BUILD_GUI) # Ensure that libstdc++ gets linked first. target_link_libraries(3rdparty_filament INTERFACE -lstdc++ ${CPP_LIBRARY} ${CPPABI_LIBRARY}) - message(STATUS "CPP_LIBRARY: ${CPP_LIBRARY}") - message(STATUS "CPPABI_LIBRARY: ${CPPABI_LIBRARY}") + message(STATUS "Filament C++ libraries: ${CPP_LIBRARY} ${CPPABI_LIBRARY}") + if (LIBCPP_VERSION GREATER 11) + message(WARNING "libc++ (LLVM) version ${LIBCPP_VERSION} > 11 includes libunwind that " + "interferes with the system libunwind.so.8 and may crash Python code when exceptions " + "are used. Please consider using libc++ (LLVM) v11.") + endif() endif() if (APPLE) find_library(CORE_VIDEO CoreVideo) @@ -1405,24 +1421,6 @@ else() endif() list(APPEND Open3D_3RDPARTY_HEADER_TARGETS_FROM_SYSTEM Open3D::3rdparty_opengl) -# CPU Rendering -if(BUILD_GUI AND UNIX AND NOT APPLE) - include(FetchContent) - FetchContent_Declare( - download_mesa_libgl - PREFIX mesa - URL https://github.com/isl-org/open3d_downloads/releases/download/mesa-libgl/mesa_libGL_22.1.4.tar.bz2 - URL_HASH SHA256=5732bfb70e8fcc747018820bc8fd31cd1867ebae5aa09baf65482b42c134d45a - DOWNLOAD_DIR "${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/mesa" - ) - FetchContent_MakeAvailable(download_mesa_libgl) - - set(MESA_CPU_GL_LIBRARY "${download_mesa_libgl_SOURCE_DIR}/libGL.so.1.2.0" "${download_mesa_libgl_SOURCE_DIR}/libEGL.so.1.0.0" - "${download_mesa_libgl_SOURCE_DIR}/libgallium_dri.so" "${download_mesa_libgl_SOURCE_DIR}/kms_swrast_dri.so" - "${download_mesa_libgl_SOURCE_DIR}/swrast_dri.so") - message(STATUS "MESA_CPU_GL_LIBRARY: ${MESA_CPU_GL_LIBRARY}") -endif() - # RPC interface # zeromq if(USE_SYSTEM_ZEROMQ) @@ -1549,34 +1547,14 @@ if(BUILD_SYCL_MODULE) endif() if(BUILD_SYCL_MODULE) - option(OPEN3D_USE_ONEAPI_PACKAGES "Use the oneAPI distribution of MKL/TBB/DPL." ON) + option(OPEN3D_USE_ONEAPI_PACKAGES "Use the oneAPI distribution of MKL/TBB." ON) else() - option(OPEN3D_USE_ONEAPI_PACKAGES "Use the oneAPI distribution of MKL/TBB/DPL." OFF) + option(OPEN3D_USE_ONEAPI_PACKAGES "Use the oneAPI distribution of MKL/TBB." OFF) endif() mark_as_advanced(OPEN3D_USE_ONEAPI_PACKAGES) if(OPEN3D_USE_ONEAPI_PACKAGES) - # 1. oneTBB - # /opt/intel/oneapi/tbb/latest/lib/cmake/tbb - open3d_find_package_3rdparty_library(3rdparty_tbb - PACKAGE TBB - TARGETS TBB::tbb - ) - list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM Open3D::3rdparty_tbb) - target_compile_definitions(3rdparty_tbb INTERFACE OPEN3D_USE_ONEAPI_PACKAGES=1) - target_compile_definitions(3rdparty_tbb INTERFACE _PSTL_UDR_PRESENT=0) - target_compile_definitions(3rdparty_tbb INTERFACE _PSTL_UDS_PRESENT=0) - # 2. oneDPL - # /opt/intel/oneapi/dpl/latest/lib/cmake/oneDPL - open3d_find_package_3rdparty_library(3rdparty_onedpl - PACKAGE oneDPL - TARGETS oneDPL - ) - target_compile_definitions(3rdparty_onedpl INTERFACE _GLIBCXX_USE_TBB_PAR_BACKEND=0) - target_compile_definitions(3rdparty_onedpl INTERFACE PSTL_USE_PARALLEL_POLICIES=0) - list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM Open3D::3rdparty_onedpl) - - # 3. oneMKL + # 1. oneMKL # /opt/intel/oneapi/mkl/latest/lib/cmake/mkl set(MKL_THREADING tbb_thread) set(MKL_LINK static) @@ -1595,40 +1573,15 @@ if(OPEN3D_USE_ONEAPI_PACKAGES) target_compile_definitions(3rdparty_mkl INTERFACE OPEN3D_USE_ONEAPI_PACKAGES) list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM Open3D::3rdparty_mkl) -else() # if(OPEN3D_USE_ONEAPI_PACKAGES) - # TBB - if(USE_SYSTEM_TBB) - open3d_find_package_3rdparty_library(3rdparty_tbb - PACKAGE TBB - TARGETS TBB::tbb - ) - if(NOT 3rdparty_tbb_FOUND) - set(USE_SYSTEM_TBB OFF) - endif() - endif() - if(NOT USE_SYSTEM_TBB) - include(${Open3D_3RDPARTY_DIR}/mkl/tbb.cmake) - open3d_import_3rdparty_library(3rdparty_tbb - INCLUDE_DIRS ${STATIC_TBB_INCLUDE_DIR} - LIB_DIR ${STATIC_TBB_LIB_DIR} - LIBRARIES ${STATIC_TBB_LIBRARIES} - DEPENDS ext_tbb - ) - list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_CUSTOM Open3D::3rdparty_tbb) - else() - list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM Open3D::3rdparty_tbb) - endif() - - # parallelstl - include(${Open3D_3RDPARTY_DIR}/parallelstl/parallelstl.cmake) - open3d_import_3rdparty_library(3rdparty_parallelstl - PUBLIC - INCLUDE_DIRS ${PARALLELSTL_INCLUDE_DIRS} - INCLUDE_ALL - DEPENDS ext_parallelstl + # 2. oneTBB + # /opt/intel/oneapi/tbb/latest/lib/cmake/tbb + open3d_find_package_3rdparty_library(3rdparty_tbb + PACKAGE TBB + TARGETS TBB::tbb ) - list(APPEND Open3D_3RDPARTY_PUBLIC_TARGETS_FROM_SYSTEM Open3D::3rdparty_parallelstl) + list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM Open3D::3rdparty_tbb) +else(OPEN3D_USE_ONEAPI_PACKAGES) # MKL/BLAS if(USE_BLAS) if (USE_SYSTEM_BLAS) @@ -1740,11 +1693,12 @@ else() # if(OPEN3D_USE_ONEAPI_PACKAGES) # https://software.intel.com/content/www/us/en/develop/articles/intel-mkl-link-line-advisor.html message(STATUS "Using MKL to support BLAS and LAPACK functionalities.") open3d_import_3rdparty_library(3rdparty_blas + GROUPED HIDDEN INCLUDE_DIRS ${STATIC_MKL_INCLUDE_DIR} LIB_DIR ${STATIC_MKL_LIB_DIR} LIBRARIES ${STATIC_MKL_LIBRARIES} - DEPENDS ext_tbb ext_mkl_include ext_mkl + DEPENDS Open3D::3rdparty_tbb ext_mkl_include ext_mkl ) if(UNIX) target_compile_options(3rdparty_blas INTERFACE "$<$:-m64>") @@ -1753,7 +1707,25 @@ else() # if(OPEN3D_USE_ONEAPI_PACKAGES) target_compile_definitions(3rdparty_blas INTERFACE "$<$:MKL_ILP64>") list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_CUSTOM Open3D::3rdparty_blas) endif() -endif() # if(OPEN3D_USE_ONEAPI_PACKAGES) + + # TBB + if(USE_SYSTEM_TBB) + open3d_find_package_3rdparty_library(3rdparty_tbb + PACKAGE TBB + TARGETS TBB::tbb + ) + if(NOT 3rdparty_tbb_FOUND) + set(USE_SYSTEM_TBB OFF) + endif() + endif() + if(NOT USE_SYSTEM_TBB) + include(${Open3D_3RDPARTY_DIR}/mkl/tbb.cmake) + list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_CUSTOM Open3D::3rdparty_tbb) + else() + list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM Open3D::3rdparty_tbb) + endif() + +endif(OPEN3D_USE_ONEAPI_PACKAGES) # cuBLAS if(BUILD_CUDA_MODULE) @@ -1783,16 +1755,30 @@ if(BUILD_CUDA_MODULE) CUDA::culibos ) else() - # In CUDA12.0 the liblapack_static.a is deprecated and removed. + # In CUDA 12.0 the liblapack_static.a is deprecated and removed. # Use the libcusolver_lapack_static.a instead. - target_link_libraries(3rdparty_cublas INTERFACE - CUDA::cusolver_static - ${CUDAToolkit_LIBRARY_DIR}/libcusolver_lapack_static.a - CUDA::cusparse_static - CUDA::cublas_static - CUDA::cublasLt_static - CUDA::culibos - ) + # Use of static libraries is preferred. + if(BUILD_WITH_CUDA_STATIC) + # Use static CUDA libraries. + target_link_libraries(3rdparty_cublas INTERFACE + CUDA::cusolver_static + ${CUDAToolkit_LIBRARY_DIR}/libcusolver_lapack_static.a + CUDA::cusparse_static + CUDA::cublas_static + CUDA::cublasLt_static + CUDA::culibos + ) + else() + # Use shared CUDA libraries. + target_link_libraries(3rdparty_cublas INTERFACE + CUDA::cusolver + ${CUDAToolkit_LIBRARY_DIR}/libcusolver.so + CUDA::cusparse + CUDA::cublas + CUDA::cublasLt + CUDA::culibos + ) + endif() endif() if(NOT BUILD_SHARED_LIBS) # Listed in ${CMAKE_INSTALL_PREFIX}/lib/cmake/Open3D/Open3DTargets.cmake. @@ -1819,41 +1805,59 @@ if (BUILD_CUDA_MODULE) CUDA::nppial ) else() - open3d_find_package_3rdparty_library(3rdparty_cuda_npp - REQUIRED - PACKAGE CUDAToolkit - TARGETS CUDA::nppc_static - CUDA::nppicc_static - CUDA::nppif_static - CUDA::nppig_static - CUDA::nppim_static - CUDA::nppial_static - ) + if(BUILD_WITH_CUDA_STATIC) + # Use static CUDA libraries. + open3d_find_package_3rdparty_library(3rdparty_cuda_npp + REQUIRED + PACKAGE CUDAToolkit + TARGETS CUDA::nppc_static + CUDA::nppicc_static + CUDA::nppif_static + CUDA::nppig_static + CUDA::nppim_static + CUDA::nppial_static + ) + else() + # Use shared CUDA libraries. + open3d_find_package_3rdparty_library(3rdparty_cuda_npp + REQUIRED + PACKAGE CUDAToolkit + TARGETS CUDA::nppc + CUDA::nppicc + CUDA::nppif + CUDA::nppig + CUDA::nppim + CUDA::nppial + ) + endif() + endif() + if(NOT 3rdparty_cuda_npp_FOUND) + message(FATAL_ERROR "CUDA NPP libraries not found.") endif() list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM Open3D::3rdparty_cuda_npp) endif () # IPP -if (WITH_IPPICV) +if (WITH_IPP) # Ref: https://stackoverflow.com/a/45125525 - set(IPPICV_SUPPORTED_HW AMD64 x86_64 x64 x86 X86 i386 i686) + set(IPP_SUPPORTED_HW AMD64 x86_64 x64) # 32 bit deprecated: x86 X86 i386 i686 # Unsupported: ARM64 aarch64 armv7l armv8b armv8l ... - if (NOT CMAKE_HOST_SYSTEM_PROCESSOR IN_LIST IPPICV_SUPPORTED_HW) - set(WITH_IPPICV OFF) - message(WARNING "IPP-ICV disabled: Unsupported Platform.") + if (NOT CMAKE_HOST_SYSTEM_PROCESSOR IN_LIST IPP_SUPPORTED_HW) + set(WITH_IPP OFF) + message(WARNING "Intel IPP disabled: Unsupported Platform.") else () - include(${Open3D_3RDPARTY_DIR}/ippicv/ippicv.cmake) - if (WITH_IPPICV) - message(STATUS "IPP-ICV ${IPPICV_VERSION_STRING} available. Building interface wrappers IPP-IW.") - open3d_import_3rdparty_library(3rdparty_ippicv + include(${Open3D_3RDPARTY_DIR}/ipp/ipp.cmake) + if (WITH_IPP) + message(STATUS "Using Intel IPP ${IPP_VERSION_STRING}.") + open3d_import_3rdparty_library(3rdparty_ipp HIDDEN - INCLUDE_DIRS ${IPPICV_INCLUDE_DIR} - LIBRARIES ${IPPICV_LIBRARIES} - LIB_DIR ${IPPICV_LIB_DIR} - DEPENDS ext_ippicv + INCLUDE_DIRS ${IPP_INCLUDE_DIR} + LIBRARIES ${IPP_LIBRARIES} + LIB_DIR ${IPP_LIB_DIR} + DEPENDS ext_ipp ) - target_compile_definitions(3rdparty_ippicv INTERFACE ${IPPICV_DEFINITIONS}) - list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM Open3D::3rdparty_ippicv) + target_compile_definitions(3rdparty_ipp INTERFACE IPP_VERSION_INT=${IPP_VERSION_INT}) + list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM Open3D::3rdparty_ipp) endif() endif() endif () diff --git a/3rdparty/googletest/googletest.cmake b/3rdparty/googletest/googletest.cmake index dd84c07c32c..afde49e2014 100644 --- a/3rdparty/googletest/googletest.cmake +++ b/3rdparty/googletest/googletest.cmake @@ -12,5 +12,5 @@ FetchContent_Declare( INSTALL_COMMAND "" ) -FetchContent_Populate(ext_googletest) +FetchContent_MakeAvailable(ext_googletest) FetchContent_GetProperties(ext_googletest SOURCE_DIR GOOGLETEST_SOURCE_DIR) diff --git a/3rdparty/imgui/imgui.cmake b/3rdparty/imgui/imgui.cmake index 12ea3175736..064d227c1f9 100644 --- a/3rdparty/imgui/imgui.cmake +++ b/3rdparty/imgui/imgui.cmake @@ -12,5 +12,5 @@ FetchContent_Declare( INSTALL_COMMAND "" ) -FetchContent_Populate(ext_imgui) +FetchContent_MakeAvailable(ext_imgui) FetchContent_GetProperties(ext_imgui SOURCE_DIR IMGUI_SOURCE_DIR) diff --git a/3rdparty/ippicv/LICENSE b/3rdparty/ipp/LICENSE similarity index 100% rename from 3rdparty/ippicv/LICENSE rename to 3rdparty/ipp/LICENSE diff --git a/3rdparty/ipp/ipp.cmake b/3rdparty/ipp/ipp.cmake new file mode 100755 index 00000000000..deaed2ab179 --- /dev/null +++ b/3rdparty/ipp/ipp.cmake @@ -0,0 +1,68 @@ +# Output variables: +# - IPP_INCLUDE_DIR +# - IPP_LIBRARIES +# - IPP_LIB_DIR +# - IPP_VERSION_STRING +# - IPP_VERSION_INT (for version check) + +include(ExternalProject) + +# These archives are created from the pip wheels for ipp-static, ipp-devel and +# ipp-include and excluding the shared libraries to reduce download size. +# Check in order APPLE -> WIN32 -> UNIX, since UNIX may be defined on APPLE / WIN32 as well +set(IPP_VERSION_STRING "2021.11.0") # From ipp/ippversion.h +set(IPP_VERSION_INT 20211100) +if(APPLE AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL x86_64) + set(IPP_VERSION_STRING "2021.9.1") # From ipp/ippversion.h + set(IPP_VERSION_INT 20210901) + set(IPP_URL "https://github.com/isl-org/open3d_downloads/releases/download/mkl-static-2024.1/ipp_static-2021.9.1-macosx_10_15_x86_64.tar.xz") + set(IPP_HASH "f27e45da604a1f6d1d2a747a0f67ffafeaff084b0f860a963d8c3996e2f40bb3") +elseif(WIN32 AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL AMD64) + set(IPP_URL "https://github.com/isl-org/open3d_downloads/releases/download/mkl-static-2024.1/ipp_static-2021.11.0-win_amd64.zip") + set(IPP_HASH "69e8a7dc891609de6fea478a67659d2f874d12b51a47bd2e3e5a7c4c473c53a6") +elseif(UNIX AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL x86_64) + set(IPP_URL "https://github.com/isl-org/open3d_downloads/releases/download/mkl-static-2024.1/ipp_static-2021.11.0-linux_x86_64.tar.xz") + set(IPP_HASH "51f33fd5bf5011e9eae0e034e5cc70a7c0ac0ba93d6a3f66fd7e145cf1a5e30b") +else() + set(WITH_IPP OFF) + message(FATAL_ERROR "Intel IPP disabled: Unsupported Platform.") + return() +endif() + +if(WIN32) + set(IPP_SUBPATH "Library/") +else() + set(IPP_SUBPATH "") +endif() + +# Threading layer libs must be linked first. +# https://www.intel.com/content/www/us/en/docs/ipp/developer-guide-reference/2021-11/ipp-performace-benefits-with-tl-functions.html +# Library dependency order: +# https://www.intel.com/content/www/us/en/docs/ipp/developer-guide-reference/2021-11/library-dependencies-by-domain.html +if (WIN32) + set(IPP_LIBRARIES ipp_iw ippcvmt_tl_tbb ippcvmt ippimt_tl_tbb ippimt ippccmt_tl_tbb ippccmt ippsmt ippvmmt ippcoremt_tl_tbb ippcoremt) +else() + set(IPP_LIBRARIES ipp_iw ippcv_tl_tbb ippcv ippi_tl_tbb ippi ippcc_tl_tbb ippcc ipps ippvm ippcore_tl_tbb ippcore) +endif() + +foreach(item IN LISTS IPP_LIBRARIES) + list(APPEND IPP_BUILD_BYPRODUCTS /${IPP_SUBPATH}lib/${CMAKE_STATIC_LIBRARY_PREFIX}${item}${CMAKE_STATIC_LIBRARY_SUFFIX}) +endforeach() + +ExternalProject_Add(ext_ipp + PREFIX ipp + URL ${IPP_URL} + URL_HASH SHA256=${IPP_HASH} + DOWNLOAD_DIR "${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/ipp" + # Copy all libs from lib/tl/tbb to lib/ since Open3D cmake scripts only support one LIB_DIR per dependency + UPDATE_COMMAND ${CMAKE_COMMAND} -E copy_directory /${IPP_SUBPATH}lib/tl/tbb/ /${IPP_SUBPATH}lib/ + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "" + BUILD_BYPRODUCTS + ${IPP_BUILD_BYPRODUCTS} +) + +ExternalProject_Get_Property(ext_ipp SOURCE_DIR) +set(IPP_INCLUDE_DIR "${SOURCE_DIR}/${IPP_SUBPATH}include/") +set(IPP_LIB_DIR "${SOURCE_DIR}/${IPP_SUBPATH}lib") \ No newline at end of file diff --git a/3rdparty/ippicv/CMakeLists.txt b/3rdparty/ippicv/CMakeLists.txt deleted file mode 100644 index a5780e29438..00000000000 --- a/3rdparty/ippicv/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -# Adapted from https://github.com/opencv/opencv/blob/master/3rdparty/ippicv/CMakeLists.txt -cmake_minimum_required(VERSION 3.0) -project(ippiw) - -set(CMAKE_POSITION_INDEPENDENT_CODE ON) -file(GLOB lib_srcs iw/src/*.c) -file(GLOB lib_hdrs iw/include/*.h iw/include/iw/*.h iw/include/iw++/*.hpp) -file(GLOB IPPICV_LIBRARY - icv/lib/*/${CMAKE_STATIC_LIBRARY_PREFIX}*${CMAKE_STATIC_LIBRARY_SUFFIX}) - -add_library(ippiw STATIC ${lib_srcs} ${lib_hdrs}) -target_compile_definitions(ippiw PRIVATE IW_BUILD ICV_BASE) -target_include_directories(ippiw PRIVATE icv/include iw/include) -target_compile_definitions(ippiw PRIVATE IW_ENABLE_iwiResize_Nearest=1) - -if(UNIX) - if(${CMAKE_C_COMPILER_ID} MATCHES GNU OR - ${CMAKE_C_COMPILER_ID} MATCHES Clang OR - ${CMAKE_C_COMPILER_ID} MATCHES Intel) - target_compile_options(ippiw PRIVATE -Wno-unused-function -Wno-missing-braces -Wno-missing-field-initializers) - endif() - if(${CMAKE_C_COMPILER_ID} MATCHES Clang) - target_compile_options(ippiw PRIVATE -Wno-self-assign) - endif() -endif() - -install(TARGETS ippiw - ARCHIVE DESTINATION lib) -install(FILES ${IPPICV_LIBRARY} - DESTINATION lib) -install(DIRECTORY iw/include/ DESTINATION include - FILES_MATCHING PATTERN "*.h*") -install(DIRECTORY icv/include/ DESTINATION include/icv - FILES_MATCHING PATTERN "*.h*") diff --git a/3rdparty/ippicv/ippicv.cmake b/3rdparty/ippicv/ippicv.cmake deleted file mode 100755 index e889378f47a..00000000000 --- a/3rdparty/ippicv/ippicv.cmake +++ /dev/null @@ -1,57 +0,0 @@ -# Adapted from: https://github.com/opencv/opencv/blob/master/3rdparty/ippicv/ippicv.cmake -# Downloads IPPICV libraries from the OpenCV 3rd party repo - -include(ExternalProject) - -# Commit SHA in the opencv_3rdparty repo -set(IPPICV_COMMIT "a56b6ac6f030c312b2dce17430eef13aed9af274") -# Check in order APPLE -> WIN32 -> UNIX, since UNIX may be defined on APPLE / -# WIN32 as well -if(APPLE AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL x86_64) - set(OPENCV_ICV_NAME "ippicv_2020_mac_intel64_20191018_general.tgz") - set(OPENCV_ICV_HASH "3a39aad1eef2f6019dda9555f6db2d34063c1e464dc0e498eaa0c6b55817f2fe") -elseif(WIN32 AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL AMD64) - set(OPENCV_ICV_NAME "ippicv_2020_win_intel64_20191018_general.zip") - set(OPENCV_ICV_HASH "e64e09f8a2e121d4fff440fb12b1298bc0760f1391770aefe5d1deb6630352b7") -elseif(WIN32 AND CMAKE_HOST_SYSTEM_PROCESSOR MATCHES 86) # {x86, i386, i686} - set(OPENCV_ICV_NAME "ippicv_2020_win_ia32_20191018_general.zip") - set(OPENCV_ICV_HASH "c1e0e26f32aec4374df05a145cfac09774e15f9b53f0bdfaac3eca3205db6106") -elseif(UNIX AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL x86_64) - set(OPENCV_ICV_NAME "ippicv_2020_lnx_intel64_20191018_general.tgz") - set(OPENCV_ICV_HASH "08627fa5660d52d59309a572dd7db5b9c8aea234cfa5aee0942a1dd903554246") -elseif(UNIX AND CMAKE_HOST_SYSTEM_PROCESSOR MATCHES 86) # {x86, i386, i686} - set(OPENCV_ICV_NAME "ippicv_2020_lnx_ia32_20191018_general.tgz") - set(OPENCV_ICV_HASH "acf8976ddea689b6d8c9640d6cfa6852d5c74c1fc368b57029b13ed7714fbd95") -else() - set(WITH_IPPICV OFF) - message(FATAL_ERROR "IPP-ICV disabled: Unsupported Platform.") - return() -endif() - -if(WIN32) - set(lib_name ippicvmt) -else() - set(lib_name ippicv) -endif() - -ExternalProject_Add(ext_ippicv - PREFIX ippicv - URL https://raw.githubusercontent.com/opencv/opencv_3rdparty/${IPPICV_COMMIT}/ippicv/${OPENCV_ICV_NAME} - URL_HASH SHA256=${OPENCV_ICV_HASH} - DOWNLOAD_DIR "${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/ippicv" - UPDATE_COMMAND "" - PATCH_COMMAND ${CMAKE_COMMAND} -E copy - ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/ippicv/CMakeLists.txt - CMAKE_ARGS - -DCMAKE_INSTALL_PREFIX= - ${ExternalProject_CMAKE_ARGS_hidden} - BUILD_BYPRODUCTS - /lib/${CMAKE_STATIC_LIBRARY_PREFIX}ippiw${CMAKE_STATIC_LIBRARY_SUFFIX} - /lib/${CMAKE_STATIC_LIBRARY_PREFIX}${lib_name}${CMAKE_STATIC_LIBRARY_SUFFIX} - ) - -ExternalProject_Get_Property(ext_ippicv INSTALL_DIR) -set(IPPICV_INCLUDE_DIR "${INSTALL_DIR}/include/icv/" "${INSTALL_DIR}/include/") -set(IPPICV_LIBRARIES ippiw ${lib_name}) -set(IPPICV_LIB_DIR "${INSTALL_DIR}/lib") -set(IPPICV_VERSION_STRING "2020.0.0 Gold") # From icv/ippversion.h diff --git a/3rdparty/mesa/build-mesa-cpu.sh b/3rdparty/mesa/build-mesa-cpu.sh deleted file mode 100755 index 3260510bd5d..00000000000 --- a/3rdparty/mesa/build-mesa-cpu.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env bash - -# Build Mesa CPU rendering library libGL.so following instructions from -# https://docs.mesa3d.org/install.html -# -# To build on Ubuntu, simply run this script. sudo access is needed and it will -# modify your system. Alternately, you can build in an isolated docker container -# as follows: -# -# cd Open3D/3rdparty/mesa -# docker run --rm -v $PWD:/host_dir --entrypoint /host_dir/build-mesa-cpu.sh \ -# --workdir /root/ ubuntu:bionic -# sudo chown $(id -u):$(id -g) libGL.so.1.5.0 -# -# This will build libGL.so.1.5.0 in the docker container and copy the result -# back to the current directory. - -MESA_VER=22.1.4 # latest tag on 2022-08-01 -[ "$EUID" -ne 0 ] && SUDO="sudo" || SUDO="command" - -echo "Enable source repositories and get build dependencies." -$SUDO sed -i '/deb-src/s/^# //' /etc/apt/sources.list && -$SUDO apt-get update && -$SUDO apt-get --yes build-dep mesa && -$SUDO apt-get --yes install wget -echo "Check and update meson (Ubuntu 18.04 has a too old meson.)" -if dpkg --compare-versions "$(meson -v)" lt 0.46.1 ; then - $SUDO apt-get --yes install python3-pip - yes | pip3 install "meson>=0.46.1,<0.62.0" # 0.62.0 disables Python 3.6 suport - export PATH=/usr/local/bin:$PATH # meson from pip before system meson -fi -echo "Disable source repositories again." -$SUDO sed -i '/deb-src/s/^/# /' /etc/apt/sources.list - -echo "Get Mesa source code version $MESA_VER" -wget -c \ -https://archive.mesa3d.org/mesa-${MESA_VER}.tar.xz \ --O - | tar -xJ -pushd mesa-${MESA_VER} -echo Configure... -meson build/ \ - `# SW rendering` \ - -Dglx=dri -Dgallium-drivers=swrast -Dplatforms=x11 \ - `# Enable EGL` \ - -Degl=enabled -Degl-native-platform=surfaceless \ - `# Disable HW drivers` \ - -Ddri3=false -Ddri-drivers= -Dvulkan-drivers= \ - -Dgbm=disabled -Dlmsensors=disabled \ - `# Optimization, remove debug info` \ - -Dbuildtype=release -Doptimization=3 -Db_lto=true -Dstrip=true \ - `# Security hardening` \ - -Dcpp_args="-D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wformat -Wformat-security" \ - -Dcpp_link_args="-Wl,-z,noexecstack -Wl,-z,relro,-z,now" - -echo Build... -ninja -C build/ -echo "Copy libGL.so out" -[ -d /host_dir ] && OUT_DIR="/host_dir" || OUT_DIR=".." -cp build/src/glx/libGL.so.1.2.0 $OUT_DIR -cp build/src/egl/libEGL.so.1.0.0 $OUT_DIR -cp build/src/gallium/targets/dri/*.so $OUT_DIR -popd diff --git a/3rdparty/mkl/0001-Allow-selecttion-of-static-dynamic-MSVC-runtime.patch b/3rdparty/mkl/0001-Allow-selecttion-of-static-dynamic-MSVC-runtime.patch deleted file mode 100644 index 9dc35dd1455..00000000000 --- a/3rdparty/mkl/0001-Allow-selecttion-of-static-dynamic-MSVC-runtime.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 92e3a4717f888c9e97e22f9e7e83fc15c8aa15ae Mon Sep 17 00:00:00 2001 -From: Yixing Lao -Date: Mon, 14 Sep 2020 03:30:00 -0700 -Subject: [PATCH] Allow selecttion of static/dynamic MSVC runtime - ---- - CMakeLists.txt | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index e05f27a..5a0c680 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,5 +1,15 @@ - cmake_minimum_required(VERSION 3.1 FATAL_ERROR) - -+##### begin open3d patch -+if(POLICY CMP0091) -+ cmake_policy(SET CMP0091 NEW) -+endif() -+option(STATIC_WINDOWS_RUNTIME "Use static (MT/MTd) Windows runtime" OFF) -+if(STATIC_WINDOWS_RUNTIME) -+ set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") -+endif() -+##### end open3d patch -+ - if (POLICY CMP0048) - # cmake warns if loaded from a min-3.0-required parent dir, so silence the warning: - cmake_policy(SET CMP0048 NEW) --- -2.27.0.windows.1 - diff --git a/3rdparty/mkl/mkl.cmake b/3rdparty/mkl/mkl.cmake index 6a8a923717b..bff63b0faa5 100644 --- a/3rdparty/mkl/mkl.cmake +++ b/3rdparty/mkl/mkl.cmake @@ -7,52 +7,28 @@ # # The name "STATIC" is used to avoid naming collisions for other 3rdparty CMake # files (e.g. PyTorch) that also depends on MKL. -# FIXME: anaconda.org URLs don't work anymore. include(ExternalProject) +# These files are created from the pip MKL devel packages, and only contain +# headers, static libraries, and cmake export files. Shared libraries are +# excluded to reduce download size. Alternately, use: +# pip download -d mkl_static/win_amd64 --platform win_amd64 --no-deps mkl-include==2024.1 mkl-devel==2024.1 mkl-static==2024.1 +# pip download -d mkl_static/linux_x86_64 --platform manylinux1_x86_64 --no-deps mkl-include==2024.1 mkl-devel==2024.1 mkl-static==2024.1 +# pip download -d mkl_static/macosx_x86_64 --platform macosx_11_0_x86_64 --no-deps mkl-include==2023.2.2 mkl-devel==2023.2.2 mkl-static==2023.2.2 +# Extract all files: +# cd mkl_static/win_amd64 && for whl in *.whl; do wheel unpack $whl; done; +# Arrange in the standard layout: bin, include, lib (cmake, pkgconfig), share (cmake) +# Archive and upload to GitHub releases open3d_downloads. if(WIN32) - set(MKL_INCLUDE_URL - https://github.com/isl-org/Open3D/releases/download/v0.12.0/mkl-include-2020.1-intel_216-win-64.tar.bz2 - https://anaconda.org/intel/mkl-include/2020.1/download/win-64/mkl-include-2020.1-intel_216.tar.bz2 - ) - set(MKL_INCLUDE_SHA256 65cedb770358721fd834224cd8be1fe1cc10b37ef2a1efcc899fc2fefbeb5b31) - - set(MKL_URL - https://github.com/isl-org/Open3D/releases/download/v0.12.0/mkl-static-2020.1-intel_216-win-64.tar.bz2 - https://anaconda.org/intel/mkl-static/2020.1/download/win-64/mkl-static-2020.1-intel_216.tar.bz2 - ) - set(MKL_SHA256 c6f037aa9e53501d91d5245b6e65020399ebf34174cc4d03637818ebb6e6b6b9) + set(MKL_URL https://github.com/isl-org/open3d_downloads/releases/download/mkl-static-2024.1/mkl_static-2024.1.0-win_amd64.zip) + set(MKL_SHA256 524de5395db5b7a9d9f0d9a76b2223c6edac429d4492c6a1cc79a5c22c4f3346) elseif(APPLE) - set(MKL_INCLUDE_URL - https://github.com/isl-org/Open3D/releases/download/v0.12.0/mkl-include-2020.1-intel_216-osx-64.tar.bz2 - https://anaconda.org/intel/mkl-include/2020.1/download/osx-64/mkl-include-2020.1-intel_216.tar.bz2 - ) - set(MKL_INCLUDE_SHA256 d4d025bd17ce75b92c134f70759b93ae1dee07801d33bcc59e40778003f05de5) - - set(MKL_URL - https://github.com/isl-org/Open3D/releases/download/v0.12.0/mkl-static-2020.1-intel_216-osx-64.tar.bz2 - https://anaconda.org/intel/mkl-static/2020.1/download/osx-64/mkl-static-2020.1-intel_216.tar.bz2 - ) - set(MKL_SHA256 ca94ab8933cf58cbb7b42ac1bdc8671a948490fd1e0e9cea71a5b4d613b21be4) + set(MKL_URL https://github.com/isl-org/open3d_downloads/releases/download/mkl-static-2024.1/mkl_static-2023.2.2.9-macosx_x86_64.tar.xz) + set(MKL_SHA256 6cd93bf1d37527d3ab3657e22c1a8a409729d6c6f422c7c381c7a145aa588d6c) else() - set(MKL_INCLUDE_URL - https://github.com/isl-org/Open3D/releases/download/v0.12.0/mkl-include-2020.1-intel_217-linux-64.tar.bz2 - https://anaconda.org/intel/mkl-include/2020.1/download/linux-64/mkl-include-2020.1-intel_217.tar.bz2 - ) - set(MKL_INCLUDE_SHA256 c0c4e7f261aa9182d811b91132c622211e55a5f3dfb8afb65a5377804f39eb61) - - set(MKL_URL - https://github.com/isl-org/Open3D/releases/download/v0.12.0/mkl-static-2020.1-intel_217-linux-64.tar.bz2 - https://anaconda.org/intel/mkl-static/2020.1/download/linux-64/mkl-static-2020.1-intel_217.tar.bz2 - ) - set(MKL_SHA256 44fe60fa895c8967fe7c70fd1b680700f23ecac6ae038b267aa0a0c48dce3d59) - - # URL for merged libmkl_merged.a for Ubuntu. - set(MKL_MERGED_URL - https://github.com/isl-org/Open3D/releases/download/v0.10.0/linux-merged-mkl-static-2020.1-intel_217.zip - ) - set(MKL_MERGED_SHA256 027c2b0d89c554479edbe5faecb93c26528877c1b682f939f8e1764d96860064) + set(MKL_URL https://github.com/isl-org/open3d_downloads/releases/download/mkl-static-2024.1/mkl_static-2024.1.0-linux_x86_64.tar.xz) + set(MKL_SHA256 f37c9440e3d664d21889a4607effcd47472bcce347da6c2bfc7aae991971b499) endif() # Where MKL and TBB headers and libs will be installed. @@ -62,17 +38,6 @@ set(STATIC_MKL_INCLUDE_DIR "${MKL_INSTALL_PREFIX}/include/") set(STATIC_MKL_LIB_DIR "${MKL_INSTALL_PREFIX}/${Open3D_INSTALL_LIB_DIR}") if(WIN32) - ExternalProject_Add( - ext_mkl_include - PREFIX mkl_include - URL ${MKL_INCLUDE_URL} - URL_HASH SHA256=${MKL_INCLUDE_SHA256} - DOWNLOAD_DIR "${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/mkl" - UPDATE_COMMAND "" - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory /Library/include ${MKL_INSTALL_PREFIX}/include - ) ExternalProject_Add( ext_mkl PREFIX mkl @@ -83,6 +48,7 @@ if(WIN32) CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory /Library/lib ${STATIC_MKL_LIB_DIR} + COMMAND ${CMAKE_COMMAND} -E copy_directory /Library/include ${MKL_INSTALL_PREFIX}/include BUILD_BYPRODUCTS ${STATIC_MKL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}mkl_intel_ilp64${CMAKE_STATIC_LIBRARY_SUFFIX} ${STATIC_MKL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}mkl_core${CMAKE_STATIC_LIBRARY_SUFFIX} @@ -97,23 +63,10 @@ if(WIN32) mkl_core mkl_sequential mkl_tbb_thread - tbb_static - ) - list(REMOVE_ITEM MKL_LIBRARIES "$<$:mkl_tbb_thread>") - list(REMOVE_ITEM MKL_LIBRARIES "$<$:tbb_static>") - list(REMOVE_ITEM MKL_LIBRARIES "$<$:mkl_sequential>") -elseif(APPLE) - ExternalProject_Add( - ext_mkl_include - PREFIX mkl_include - URL ${MKL_INCLUDE_URL} - URL_HASH SHA256=${MKL_INCLUDE_SHA256} - DOWNLOAD_DIR "${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/mkl" - UPDATE_COMMAND "" - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory /include ${MKL_INSTALL_PREFIX}/include ) + list(REMOVE_ITEM STATIC_MKL_LIBRARIES "$<$:mkl_tbb_thread>") + list(REMOVE_ITEM STATIC_MKL_LIBRARIES "$<$:mkl_sequential>") +else() ExternalProject_Add( ext_mkl PREFIX mkl @@ -124,75 +77,11 @@ elseif(APPLE) CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory /lib ${STATIC_MKL_LIB_DIR} + COMMAND ${CMAKE_COMMAND} -E copy_directory /include ${MKL_INSTALL_PREFIX}/include BUILD_BYPRODUCTS ${STATIC_MKL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}mkl_intel_ilp64${CMAKE_STATIC_LIBRARY_SUFFIX} ${STATIC_MKL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}mkl_tbb_thread${CMAKE_STATIC_LIBRARY_SUFFIX} ${STATIC_MKL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}mkl_core${CMAKE_STATIC_LIBRARY_SUFFIX} ) - set(STATIC_MKL_LIBRARIES mkl_intel_ilp64 mkl_tbb_thread mkl_core tbb_static) -else() - ExternalProject_Add( - ext_mkl_include - PREFIX mkl_include - URL ${MKL_INCLUDE_URL} - URL_HASH SHA256=${MKL_INCLUDE_SHA256} - DOWNLOAD_DIR "${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/mkl" - UPDATE_COMMAND "" - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory /include ${MKL_INSTALL_PREFIX}/include - ) - option(USE_LINUX_MKL_FROM_CONDA_REPO "On linux, use MKL from official conda repo" OFF) - if(USE_LINUX_MKL_FROM_CONDA_REPO) - # Resolving static library circular dependencies. - # - Approach 1: Add `-Wl,--start-group` `-Wl,--end-group` around, but this - # is not friendly with CMake. - # - Approach 2: Set LINK_INTERFACE_MULTIPLICITY to 3. However this does not - # work directly with interface library, and requires big - # changes to the build system. See discussions in: - # - https://gitlab.kitware.com/cmake/cmake/-/issues/17964 - # - https://gitlab.kitware.com/cmake/cmake/-/issues/18415 - # - https://stackoverflow.com/q/50166553/1255535 - # - Approach 3: Merge libmkl_intel_ilp64.a, libmkl_tbb_thread.a and - # libmkl_core.a into libmkl_merged.a. This is the most simple - # approach to integrate with the build system. However, extra - # time is required to merge the libraries and the merged - # library size can be large. We choose to use approach 3. - ExternalProject_Add( - ext_mkl - PREFIX mkl - URL ${MKL_URL} - URL_HASH SHA256=${MKL_SHA256} - DOWNLOAD_DIR "${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/mkl" - UPDATE_COMMAND "" - CONFIGURE_COMMAND "" - BUILD_IN_SOURCE ON - BUILD_COMMAND echo "Extracting static libs..." - COMMAND ar x lib/libmkl_intel_ilp64.a - COMMAND ar x lib/libmkl_tbb_thread.a - COMMAND ar x lib/libmkl_core.a - COMMAND echo "Merging static libs..." - COMMAND bash -c "ar -qc lib/libmkl_merged.a *.o" - COMMAND echo "Cleaning up *.o files..." - COMMAND bash -c "rm *.o" - INSTALL_COMMAND ${CMAKE_COMMAND} -E copy lib/libmkl_merged.a ${STATIC_MKL_LIB_DIR}/libmkl_merged.a - BUILD_BYPRODUCTS ${STATIC_MKL_LIB_DIR}/libmkl_merged.a - ) - else() - # We also provide a direct download for libmkl_merged.a. - ExternalProject_Add( - ext_mkl - PREFIX mkl - URL ${MKL_MERGED_URL} - URL_HASH SHA256=${MKL_MERGED_SHA256} - DOWNLOAD_DIR "${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/mkl" - UPDATE_COMMAND "" - CONFIGURE_COMMAND "" - BUILD_IN_SOURCE ON - BUILD_COMMAND "" - INSTALL_COMMAND ${CMAKE_COMMAND} -E copy lib/libmkl_merged.a ${STATIC_MKL_LIB_DIR}/libmkl_merged.a - BUILD_BYPRODUCTS ${STATIC_MKL_LIB_DIR}/libmkl_merged.a - ) - endif() - set(STATIC_MKL_LIBRARIES mkl_merged tbb_static) + set(STATIC_MKL_LIBRARIES mkl_intel_ilp64 mkl_tbb_thread mkl_core) endif() diff --git a/3rdparty/mkl/tbb.cmake b/3rdparty/mkl/tbb.cmake index b87ef79fe3b..a36435ee1b4 100644 --- a/3rdparty/mkl/tbb.cmake +++ b/3rdparty/mkl/tbb.cmake @@ -1,50 +1,41 @@ # TBB build scripts. -# -# - STATIC_TBB_INCLUDE_DIR -# - STATIC_TBB_LIB_DIR -# - STATIC_TBB_LIBRARIES -# -# Notes: -# The name "STATIC" is used to avoid naming collisions for other 3rdparty CMake -# files (e.g. PyTorch) that also depends on MKL. -include(ExternalProject) +include(FetchContent) +cmake_policy(SET CMP0077 NEW) # Where MKL and TBB headers and libs will be installed. # This needs to be consistent with mkl.cmake. set(MKL_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/mkl_install) -set(STATIC_MKL_INCLUDE_DIR "${MKL_INSTALL_PREFIX}/include/") +set(STATIC_MKL_INCLUDE_DIR "${MKL_INSTALL_PREFIX}/${Open3D_INSTALL_INCLUDE_DIR}/") set(STATIC_MKL_LIB_DIR "${MKL_INSTALL_PREFIX}/${Open3D_INSTALL_LIB_DIR}") -# TBB variables exported for PyTorch Ops and TensorFlow Ops -set(STATIC_TBB_INCLUDE_DIR "${STATIC_MKL_INCLUDE_DIR}") -set(STATIC_TBB_LIB_DIR "${STATIC_MKL_LIB_DIR}") -set(STATIC_TBB_LIBRARIES tbb_static tbbmalloc_static) - -find_package(Git QUIET REQUIRED) - -ExternalProject_Add( +# Save and restore BUILD_SHARED_LIBS since TBB must be built as a shared library +set(_build_shared_libs ${BUILD_SHARED_LIBS}) +set(BUILD_SHARED_LIBS ON) +set(_win_exp_all_syms ${CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS}) +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS OFF) # ON interferes with TBB symbols +FetchContent_Declare( ext_tbb - PREFIX tbb - URL https://github.com/wjakob/tbb/archive/141b0e310e1fb552bdca887542c9c1a8544d6503.tar.gz # Sept 2020 - URL_HASH SHA256=bb29b76eabf7549660e3dba2feb86ab501469432a15fb0bf2c21e24d6fbc4c72 + URL https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.12.0.tar.gz # April 2024 + URL_HASH SHA256=c7bb7aa69c254d91b8f0041a71c5bcc3936acb64408a1719aec0b2b7639dd84f DOWNLOAD_DIR "${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/tbb" - UPDATE_COMMAND "" - PATCH_COMMAND ${GIT_EXECUTABLE} init - COMMAND ${GIT_EXECUTABLE} apply --ignore-space-change --ignore-whitespace - ${CMAKE_CURRENT_LIST_DIR}/0001-Allow-selecttion-of-static-dynamic-MSVC-runtime.patch - CMAKE_ARGS - -DCMAKE_INSTALL_PREFIX=${MKL_INSTALL_PREFIX} - -DSTATIC_WINDOWS_RUNTIME=${STATIC_WINDOWS_RUNTIME} - -DTBB_BUILD_TBBMALLOC=ON - -DTBB_BUILD_TBBMALLOC_PROXYC=OFF - -DTBB_BUILD_SHARED=OFF - -DTBB_BUILD_STATIC=ON - -DTBB_BUILD_TESTS=OFF - -DTBB_INSTALL_ARCHIVE_DIR=${Open3D_INSTALL_LIB_DIR} - -DTBB_CMAKE_PACKAGE_INSTALL_DIR=${Open3D_INSTALL_LIB_DIR}/cmake/tbb - ${ExternalProject_CMAKE_ARGS_hidden} - BUILD_BYPRODUCTS - ${STATIC_TBB_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}tbb_static${CMAKE_STATIC_LIBRARY_SUFFIX} - ${STATIC_TBB_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}tbbmalloc_static${CMAKE_STATIC_LIBRARY_SUFFIX} ) +set(TBBMALLOC_BUILD OFF CACHE BOOL "Enable tbbmalloc build.") +set(TBBMALLOC_PROXY_BUILD OFF CACHE BOOL "Enable tbbmalloc_proxy build.") +set(TBB_TEST OFF CACHE BOOL "Build TBB tests.") +set(TBB_INSTALL OFF CACHE BOOL "Enable installation") +set(TBB_STRICT OFF CACHE BOOL "Treat compiler warnings as errors") +FetchContent_MakeAvailable(ext_tbb) +set(BUILD_SHARED_LIBS ${_build_shared_libs}) +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ${_win_exp_all_syms}) + +# TBB is built and linked as a shared library - this is different from all other Open3D dependencies. +install(TARGETS tbb EXPORT ${PROJECT_NAME}Targets + ARCHIVE DESTINATION ${Open3D_INSTALL_LIB_DIR} # Windows .lib files + COMPONENT tbb + LIBRARY DESTINATION ${Open3D_INSTALL_LIB_DIR} + COMPONENT tbb + RUNTIME DESTINATION ${Open3D_INSTALL_BIN_DIR} + COMPONENT tbb +) +add_library(${PROJECT_NAME}::3rdparty_tbb ALIAS tbb) diff --git a/3rdparty/parallelstl/LICENSE b/3rdparty/parallelstl/LICENSE deleted file mode 100644 index bd8b243dfa0..00000000000 --- a/3rdparty/parallelstl/LICENSE +++ /dev/null @@ -1,218 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - ---- LLVM Exceptions to the Apache 2.0 License ---- - -As an exception, if, as a result of your compiling your source code, portions -of this Software are embedded into an Object form of such source code, you -may redistribute such embedded portions in such Object form without complying -with the conditions of Sections 4(a), 4(b) and 4(d) of the License. - -In addition, if you combine or link compiled forms of this Software with -software that is licensed under the GPLv2 ("Combined Software") and if a -court of competent jurisdiction determines that the patent provision (Section -3), the indemnity provision (Section 9) or other Section of the License -conflicts with the conditions of the GPLv2, you may retroactively and -prospectively choose to deem waived or otherwise exclude such Section(s) of -the License, but only in their entirety and only with respect to the Combined -Software. diff --git a/3rdparty/parallelstl/parallelstl.cmake b/3rdparty/parallelstl/parallelstl.cmake deleted file mode 100644 index 981b564fcbc..00000000000 --- a/3rdparty/parallelstl/parallelstl.cmake +++ /dev/null @@ -1,16 +0,0 @@ -include(ExternalProject) - -ExternalProject_Add( - ext_parallelstl - PREFIX parallelstl - URL https://github.com/oneapi-src/oneDPL/archive/refs/tags/20190522.tar.gz - URL_HASH SHA256=40d78c3405a42f781348b5bc9038cb0ce1147591e07fca7329538c9842d36a7b - DOWNLOAD_DIR "${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/parallelstl" - UPDATE_COMMAND "" - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND "" -) - -ExternalProject_Get_Property(ext_parallelstl SOURCE_DIR) -set(PARALLELSTL_INCLUDE_DIRS ${SOURCE_DIR}/include/) # "/" is critical. diff --git a/3rdparty/pybind11/pybind11.cmake b/3rdparty/pybind11/pybind11.cmake index 9a9c1b6df77..1d3d7856203 100644 --- a/3rdparty/pybind11/pybind11.cmake +++ b/3rdparty/pybind11/pybind11.cmake @@ -3,8 +3,8 @@ include(FetchContent) FetchContent_Declare( ext_pybind11 PREFIX pybind11 - URL https://github.com/pybind/pybind11/archive/refs/tags/v2.11.1.tar.gz - URL_HASH SHA256=d475978da0cdc2d43b73f30910786759d593a9d8ee05b1b6846d1eb16c6d2e0c + URL https://github.com/pybind/pybind11/archive/refs/tags/v2.13.1.tar.gz + URL_HASH SHA256=51631e88960a8856f9c497027f55c9f2f9115cafb08c0005439838a05ba17bfc DOWNLOAD_DIR "${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/pybind11" ) diff --git a/3rdparty/qhull/qhull.cmake b/3rdparty/qhull/qhull.cmake index fe15e83ca6f..3a02500dfe8 100644 --- a/3rdparty/qhull/qhull.cmake +++ b/3rdparty/qhull/qhull.cmake @@ -8,10 +8,6 @@ FetchContent_Declare( URL_HASH SHA256=8774e9a12c70b0180b95d6b0b563c5aa4bea8d5960c15e18ae3b6d2521d64f8b DOWNLOAD_DIR "${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/qhull" - UPDATE_COMMAND "" - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND "" ) FetchContent_Populate(ext_qhull) diff --git a/3rdparty/stdgpu/stdgpu.cmake b/3rdparty/stdgpu/stdgpu.cmake index f486fc3d4ce..a725f228029 100644 --- a/3rdparty/stdgpu/stdgpu.cmake +++ b/3rdparty/stdgpu/stdgpu.cmake @@ -7,8 +7,8 @@ include(ExternalProject) ExternalProject_Add( ext_stdgpu PREFIX stdgpu - URL https://github.com/stotko/stdgpu/archive/e10f6f3ccc9902d693af4380c3bcd188ec34a2e6.tar.gz - URL_HASH SHA256=7bb2733b099f7cedc86d2aee7830d128ac1222cfafa34cbaa4e818483c0a93f6 + URL https://github.com/stotko/stdgpu/archive/2588168d226bd17229dbf58d821549580791089d.tar.gz + URL_HASH SHA256=86e50789bbe21c57f64358c6acbd4481d56c1e45ce9ba1fb5c5c8482c3973215 DOWNLOAD_DIR "${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/stdgpu" UPDATE_COMMAND "" CMAKE_ARGS @@ -17,6 +17,7 @@ ExternalProject_Add( -DSTDGPU_BUILD_SHARED_LIBS=OFF -DSTDGPU_BUILD_EXAMPLES=OFF -DSTDGPU_BUILD_TESTS=OFF + -DSTDGPU_BUILD_BENCHMARKS=OFF -DSTDGPU_ENABLE_CONTRACT_CHECKS=OFF -DTHRUST_INCLUDE_DIR=${CUDAToolkit_INCLUDE_DIRS} ${ExternalProject_CMAKE_ARGS_hidden} diff --git a/3rdparty/uvatlas/uvatlas.cmake b/3rdparty/uvatlas/uvatlas.cmake index 51831059941..63642f80e3d 100644 --- a/3rdparty/uvatlas/uvatlas.cmake +++ b/3rdparty/uvatlas/uvatlas.cmake @@ -52,7 +52,7 @@ ExternalProject_Add( -Ddirectxmath_DIR= DEPENDS ext_directxheaders ext_directxmath BUILD_BYPRODUCTS - /${Open3D_INSTALL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}uvatlas${CMAKE_STATIC_LIBRARY_SUFFIX} + /${Open3D_INSTALL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}UVAtlas${CMAKE_STATIC_LIBRARY_SUFFIX} ) diff --git a/3rdparty/vtk/vtk_build.cmake b/3rdparty/vtk/vtk_build.cmake index 271d3789667..eb8430e8e46 100644 --- a/3rdparty/vtk/vtk_build.cmake +++ b/3rdparty/vtk/vtk_build.cmake @@ -26,13 +26,13 @@ set(VTK_LIBRARIES vtksys-${VTK_VERSION}${VTK_LIB_SUFFIX} ) -foreach(item IN LISTS VTK_LIBRARIES) - list(APPEND VTK_BUILD_BYPRODUCTS /${Open3D_INSTALL_LIB_DIR}/${item}${CMAKE_STATIC_LIBRARY_SUFFIX}) -endforeach() - if(BUILD_VTK_FROM_SOURCE) + foreach(item IN LISTS VTK_LIBRARIES) + list(APPEND VTK_BUILD_BYPRODUCTS /${Open3D_INSTALL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${item}${CMAKE_STATIC_LIBRARY_SUFFIX}) + endforeach() + ExternalProject_Add( ext_vtk PREFIX vtk @@ -294,6 +294,10 @@ if(BUILD_VTK_FROM_SOURCE) else() #### download prebuilt vtk + foreach(item IN LISTS VTK_LIBRARIES) + list(APPEND VTK_BUILD_BYPRODUCTS /lib/${CMAKE_STATIC_LIBRARY_PREFIX}${item}${CMAKE_STATIC_LIBRARY_SUFFIX}) + endforeach() + if(LINUX_AARCH64) message(FATAL "No precompiled vtk for platform. Enable BUILD_VTK_FROM_SOURCE") elseif(APPLE_AARCH64) @@ -334,7 +338,8 @@ else() #### download prebuilt vtk CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" - BUILD_BYPRODUCTS "" + BUILD_BYPRODUCTS + ${VTK_BUILD_BYPRODUCTS} ) ExternalProject_Get_Property(ext_vtk SOURCE_DIR) diff --git a/3rdparty/webrtc/Dockerfile.webrtc b/3rdparty/webrtc/Dockerfile.webrtc index a604ad9e048..b935d0e8ef7 100644 --- a/3rdparty/webrtc/Dockerfile.webrtc +++ b/3rdparty/webrtc/Dockerfile.webrtc @@ -13,7 +13,7 @@ # - docker run --rm --entrypoint cat open3d-webrtc:abi1 \ # webrtc_60e6748_cxx-abi-1.tar.gz > webrtc_60e6748_cxx-abi-1.tar.gz -FROM ubuntu:18.04 +FROM ubuntu:20.04 ARG SUDO=command COPY 3rdparty/webrtc 3rdparty/webrtc diff --git a/CHANGELOG.md b/CHANGELOG.md index e192ce692e5..fccf0b78497 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ ## Main - +- Fix TriangleMesh::SamplePointsUniformly and TriangleMesh::SamplePointsPoissonDisk now sampling colors from mesh if available (PR #6842) - Fix TriangleMesh::SamplePointsUniformly not sampling triangle meshes uniformly (PR #6653) - Fix tensor based TSDF integration example. - Use GLIBCXX_USE_CXX11_ABI=ON by default @@ -37,8 +37,22 @@ - Fix KDTreeFlann possibly using a dangling pointer instead of internal storage and simplified its members (PR #6734) - Fix RANSAC early stop if no inliers in a specific iteration (PR #6789) - Fix segmentation fault (infinite recursion) of DetectPlanarPatches if multiple points have same coordinates (PR #6794) +- `TriangleMesh`'s `+=` operator appends UVs regardless of the presence of existing features (PR #6728) - Fix build with fmt v10.2.0 (#6783) - Fix segmentation fault (lambda reference capture) of VisualizerWithCustomAnimation::Play (PR #6804) +- Python 3.12 support +- Add O3DVisualizer API to enable collapse control of verts in the side panel (PR #6865) +- Split pybind declarations/definitions to avoid C++ types in Python docs (PR #6869) +- Fix minimal oriented bounding box of MeshBase derived classes and add new unit tests (PR #6898) +- Fix projection of point cloud to Depth/RGBD image if no position attribute is provided (PR #6880) +- Support lowercase types when reading PCD files (PR #6930) +- Fix visualization/draw ICP example and add warnings (PR #6933) +- Unified cloud initializer pipeline for ICP (fixes segfault colored ICP) (PR #6942) +- Fix tensor EstimatePointWiseNormalsWithFastEigen3x3 (PR #6980) +- Fix alpha shape reconstruction if alpha too small for point scale (PR #6998) +- Fix render to depth image on Apple Retina displays (PR #7001) +- Fix infinite loop in segment_plane if num_points < ransac_n (PR #7032) +- Add select_by_index method to Feature class (PR #7039) ## 0.13 diff --git a/CMakeLists.txt b/CMakeLists.txt index d6c2b4c006e..fd9bc3a001d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,7 @@ -cmake_minimum_required(VERSION 3.22) -# If you're using Ubuntu 18.04, we suggest you install the latest CMake from the +cmake_minimum_required(VERSION 3.24) +# If you're using Ubuntu 20.04, we suggest you install the latest CMake from the # official repository https://apt.kitware.com/. +# CMake 3.24+ is required for CUDA native arch selection # CMake 3.22+ is required by Assimp v5.4.2 # CMake 3.20+ is required to detect IntelLLVM compiler for SYCL @@ -39,6 +40,7 @@ option(BUILD_UNIT_TESTS "Build Open3D unit tests" OFF option(BUILD_BENCHMARKS "Build the micro benchmarks" OFF) option(BUILD_PYTHON_MODULE "Build the python module" ON ) option(BUILD_CUDA_MODULE "Build the CUDA module" OFF) +option(BUILD_WITH_CUDA_STATIC "Build with static CUDA libraries" ON ) option(BUILD_COMMON_CUDA_ARCHS "Build for common CUDA GPUs (for release)" OFF) if (WIN32) # Causes CUDA runtime error on Windows (See issue #6555) option(ENABLE_CACHED_CUDA_MANAGER "Enable cached CUDA memory manager" OFF) @@ -53,7 +55,7 @@ endif() option(BUILD_COMMON_ISPC_ISAS "Build for common ISPC ISAs (for release)" OFF) option(BUILD_GUI "Builds new GUI" ON ) option(WITH_OPENMP "Use OpenMP multi-threading" ON ) -option(WITH_IPPICV "Use Intel Performance Primitives" ON ) +option(WITH_IPP "Use Intel Integrated Performance Primitives" ON ) option(ENABLE_HEADLESS_RENDERING "Use OSMesa for headless rendering" OFF) if(BUILD_SHARED_LIBS) option(STATIC_WINDOWS_RUNTIME "Use static (MT/MTd) Windows runtime" OFF) @@ -252,6 +254,8 @@ string(CONCAT OPEN3D_VERSION ) set(OPEN3D_VERSION_FULL "${OPEN3D_VERSION}${OPEN3D_VERSION_DEVHASH}" CACHE STRING "Open3D full version.") +set(OPEN3D_ABI_VERSION "${OPEN3D_VERSION_MAJOR}.${OPEN3D_VERSION_MINOR}" CACHE + STRING "Open3D ABI version / SOVERSION (for releases only).") # Set additional info set(PROJECT_EMAIL "open3d@intel.com") set(PROJECT_DOCS "https://www.open3d.org/docs") @@ -291,28 +295,11 @@ endif() # Global flag to set CXX standard. # This does not affect 3rd party libraries. -# Tensorflow 2.9+ requires cxx_17, but MSVC 19.29 throws errors with C++17 -# enabled. -if (BUILD_SYCL_MODULE OR BUILD_TENSORFLOW_OPS) - set(CMAKE_CXX_STANDARD 17) -else() - set(CMAKE_CXX_STANDARD 14) -endif() +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) # Improved compatibility -# FIXME: Remove this workaround once a fixed Visual Studio 16.10 version is released. -if (BUILD_CUDA_MODULE - AND CMAKE_CXX_COMPILER MATCHES "MSVC" - AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "19.29" -) - # Keep C++14 standard for unaffected C++ files, but use C++17 for CUDA files. - set(CMAKE_CUDA_STANDARD 17) - # Suppress warnings for deprecated C++17 functions. - add_compile_definitions($<$:_SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING>) - message(WARNING "Visual Studio 16.10 (MSVC 19.29) introduced a compiler bug when compiling CUDA code with C++14. " - "Workaround this bug by setting the CUDA standard to C++17.") -endif() - +# Suppress warnings for deprecated C++17 functions (stdgpu->thrust with CUDA 11 for MSVC). +add_compile_definitions($<$:_SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING>) # CMake modules list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/cmake") @@ -401,17 +388,53 @@ cmake_language(EVAL CODE "cmake_language(DEFER CALL open3d_patch_findthreads_mod # Build CUDA module by default if CUDA is available if(BUILD_CUDA_MODULE) - include(Open3DMakeCudaArchitectures) - open3d_make_cuda_architectures(CUDA_ARCHS) - set(CMAKE_CUDA_ARCHITECTURES ${CUDA_ARCHS}) - - message(STATUS "Using CUDA architectures: ${CMAKE_CUDA_ARCHITECTURES}") + # Suppress nvcc unsupported compiler error for MSVC 2022 with CUDA 11.7 to 12.4 + # https://forums.developer.nvidia.com/t/problems-with-latest-vs2022-update/294150/12 + if (MSVC AND MSVC_VERSION VERSION_LESS_EQUAL "1949") + # Set this before any CUDA checks + set(CMAKE_CUDA_FLAGS "--allow-unsupported-compiler" CACHE STRING "Additional flags for nvcc" FORCE) + message(WARNING "Using --allow-unsupported-compiler flag for nvcc with MSVC 2022. " + "Set $Env:NVCC_PREPEND_FLAGS='--allow-unsupported-compiler' if nvcc still fails.") + endif() + if (CMAKE_CUDA_ARCHITECTURES) + message(STATUS "Building with user-provided CUDA architectures: ${CMAKE_CUDA_ARCHITECTURES}") + else() + if(BUILD_COMMON_CUDA_ARCHS) + # Build with all supported architectures for previous 2 generations and + # M0 (minor=0) architectures for previous generations (including + # deprecated). Note that cubin for M0 runs on GPUs with architecture Mx. + # This is a tradeoff between binary size / build time and runtime on + # older architectures. See: + # https://docs.nvidia.com/cuda/cuda-c-best-practices-guide/index.html#building-for-maximum-compatibility + # https://docs.nvidia.com/cuda/ampere-compatibility-guide/index.html#application-compatibility-on-ampere + # https://en.wikipedia.org/wiki/CUDA#GPUs_supported + find_package(CUDAToolkit REQUIRED) + if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL "11.8") + set(CMAKE_CUDA_ARCHITECTURES 75-real 80-real 86-real 89-real 90) # Turing, Ampere, Ada Lovelace, Hopper + elseif(CUDAToolkit_VERSION VERSION_GREATER_EQUAL "11.1") + set(CMAKE_CUDA_ARCHITECTURES 70-real 75-real 80-real 86) # Volta, Turing, Ampere + elseif(CUDAToolkit_VERSION VERSION_GREATER_EQUAL "11.0") + set(CMAKE_CUDA_ARCHITECTURES 60-real 70-real 72-real 75-real 80) # Pascal, Volta, Turing, Ampere + else() + set(CMAKE_CUDA_ARCHITECTURES 30-real 50-real 60-real 70-real 75) # Kepler, Maxwell, Pascal, Turing + endif() + message(STATUS "Using CUDA architectures: ${CMAKE_CUDA_ARCHITECTURES}") + else() + execute_process(COMMAND nvidia-smi RESULT_VARIABLE NVIDIA_CHECK OUTPUT_QUIET) + if (NVIDIA_CHECK EQUAL 0) + message(STATUS "Building with native CUDA architecture.") + set(CMAKE_CUDA_ARCHITECTURES native) + else() + message(WARNING "No CUDA GPU detected. Building with CMake default CUDA architecture.") + endif() + endif() + endif() enable_language(CUDA) - - if (CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" AND CMAKE_CUDA_COMPILER_VERSION VERSION_LESS "10.1") - message(FATAL_ERROR "CUDA 10.0 and older are not supported. Please upgrade to CUDA 10.1 or newer.") + set(CMAKE_CUDA_STANDARD 17) + if (CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" AND CMAKE_CUDA_COMPILER_VERSION VERSION_LESS "11.5") + message(FATAL_ERROR "CUDA 11.4 and older are not supported. Please upgrade to CUDA 11.5 or newer.") endif() -endif () +endif() # ISPC language emulation support include(Open3DISPC) @@ -454,6 +477,8 @@ if(WIN32) # Then, we could use -fvisibility=hidden for Linux as well SET(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) if(MSVC) + # MSVC standards-compliant mode: Error in PoissonRecon 3rd party header + # add_compile_options($<$:"/permissive-">) # Make sure we don't hit the 65535 object member limit with MSVC # # /bigobj allows object files with more than 65535 members @@ -488,6 +513,12 @@ macro(add_source_group module_name) source_group("Source Files\\Material" FILES ${MODULE_MATERIAL_FILES}) endmacro() +if (LINUX_AARCH64) +# Fix for ImportError: ... /pybind.cpython-310-aarch64-linux-gnu.so: cannot allocate memory in static TLS block +# https://bugs.launchpad.net/ubuntu/+source/mysql-8.0/+bug/1889851 + add_compile_options("-ftls-model=global-dynamic") +endif() + # Include convenience functions include(Open3DLink3rdpartyLibraries) include(Open3DSetGlobalProperties) diff --git a/README.md b/README.md index c024b8b1689..d559c76c26d 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ For more, please visit the [Open3D documentation](https://www.open3d.org/docs). ## Python quick start -Pre-built pip packages support Ubuntu 18.04+, macOS 10.15+ and Windows 10+ +Pre-built pip packages support Ubuntu 20.04+, macOS 10.15+ and Windows 10+ (64-bit) with Python 3.8-3.11. ```bash diff --git a/cmake/Open3DMakeCudaArchitectures.cmake b/cmake/Open3DMakeCudaArchitectures.cmake deleted file mode 100644 index 1f09241bb89..00000000000 --- a/cmake/Open3DMakeCudaArchitectures.cmake +++ /dev/null @@ -1,78 +0,0 @@ -# open3d_make_cuda_architectures(cuda_archs) -# -# Sets up CUDA architectures based on the following precedence rules -# and stores them into the variable. -# 1. All common architectures if BUILD_COMMON_CUDA_ARCHS=ON -# 2. User-defined architectures -# 3. Architectures detected on the current machine -# 4. CMake's default architectures -function(open3d_make_cuda_architectures cuda_archs) - unset(${cuda_archs}) - - find_package(CUDAToolkit REQUIRED) - - if(BUILD_COMMON_CUDA_ARCHS) - # Build with all supported architectures for previous 2 generations and - # M0 (minor=0) architectures for previous generations (including - # deprecated). Note that cubin for M0 runs on GPUs with architecture Mx. - # This is a tradeoff between binary size / build time and runtime on - # older architectures. See: - # https://docs.nvidia.com/cuda/cuda-c-best-practices-guide/index.html#building-for-maximum-compatibility - # https://docs.nvidia.com/cuda/ampere-compatibility-guide/index.html#application-compatibility-on-ampere - # https://github.com/Kitware/CMake/blob/master/Modules/FindCUDA/select_compute_arch.cmake - if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL "11.1") - set(${cuda_archs} 60-real 70-real 72-real 75-real 80-real 86) - elseif(CUDAToolkit_VERSION VERSION_GREATER_EQUAL "11.0") - set(${cuda_archs} 60-real 70-real 72-real 75-real 80) - else() - set(${cuda_archs} 30-real 50-real 60-real 70-real 72-real 75) - endif() - else() - if(CMAKE_CUDA_ARCHITECTURES) - set(${cuda_archs} ${CMAKE_CUDA_ARCHITECTURES}) - message(STATUS "Building with user-provided architectures") - else() - file(WRITE - "${CMAKE_CURRENT_BINARY_DIR}/cuda_architectures.c" - " - #include - #include - int main() { - int n; - if (cudaGetDeviceCount(&n) == cudaSuccess) { - for (int i = 0; i < n; ++i) { - int major, minor; - if (cudaDeviceGetAttribute(&major, cudaDevAttrComputeCapabilityMajor, - i) == cudaSuccess && - cudaDeviceGetAttribute(&minor, cudaDevAttrComputeCapabilityMinor, - i) == cudaSuccess) { - if (i > 0) { - printf(\";\"); - } - printf(\"%d%d-real\", major, minor); - } - } - } - return 0; - } - ") - - try_run( - DETECTION_RETURN_VALUE DETECTION_COMPILED - "${CMAKE_CURRENT_BINARY_DIR}" - "${CMAKE_CURRENT_BINARY_DIR}/cuda_architectures.c" - LINK_LIBRARIES CUDA::cudart - RUN_OUTPUT_VARIABLE DETECTED_ARCHITECTURES) - - if(DETECTED_ARCHITECTURES) - message(STATUS "Building with detected architectures") - set(${cuda_archs} ${DETECTED_ARCHITECTURES}) - else() - message(STATUS "Failed to detect architectures. Falling back to CMake's default architectures") - endif() - endif() - endif() - - set(${cuda_archs} ${${cuda_archs}} PARENT_SCOPE) - -endfunction() diff --git a/cmake/Open3DPrintConfigurationSummary.cmake b/cmake/Open3DPrintConfigurationSummary.cmake index c8e8a891a8b..3e3d42da11e 100644 --- a/cmake/Open3DPrintConfigurationSummary.cmake +++ b/cmake/Open3DPrintConfigurationSummary.cmake @@ -61,7 +61,7 @@ function(open3d_print_configuration_summary) GLFW googletest imgui - ippicv + ipp JPEG jsoncpp liblzf diff --git a/cmake/Open3DSetGlobalProperties.cmake b/cmake/Open3DSetGlobalProperties.cmake index 251f046ca70..03e43212a8b 100644 --- a/cmake/Open3DSetGlobalProperties.cmake +++ b/cmake/Open3DSetGlobalProperties.cmake @@ -25,12 +25,24 @@ function(open3d_enable_strip target) endif() endfunction() +# RPATH handling (for TBB DSO). Check current folder, one folder above and the lib sibling folder +set(CMAKE_BUILD_RPATH_USE_ORIGIN ON) +if (APPLE) +# Add options to cover the various ways in which open3d shaed lib or apps can be installed wrt TBB DSO + set(CMAKE_INSTALL_RPATH "@loader_path;@loader_path/../;@loader_path/../lib/") +# pybind with open3d shared lib is copied, not cmake-installed, so we need to add .. to build rpath + set(CMAKE_BUILD_RPATH "@loader_path/../") +elseif(UNIX) + set(CMAKE_INSTALL_RPATH "$ORIGIN;$ORIGIN/../;$ORIGIN/../lib/") + set(CMAKE_BUILD_RPATH "$ORIGIN/../") +endif() + # open3d_set_global_properties(target) # # Sets important project-related properties to . function(open3d_set_global_properties target) - # Tell CMake we want a compiler that supports C++14 features - target_compile_features(${target} PUBLIC cxx_std_14) + # Tell CMake we want a compiler that supports C++17 features + target_compile_features(${target} PUBLIC cxx_std_17) # Detect compiler id and version for utility::CompilerInfo # - OPEN3D_CXX_STANDARD @@ -118,8 +130,8 @@ function(open3d_set_global_properties target) if (USE_BLAS) target_compile_definitions(${target} PRIVATE USE_BLAS) endif() - if (WITH_IPPICV) - target_compile_definitions(${target} PRIVATE WITH_IPPICV) + if (WITH_IPP) + target_compile_definitions(${target} PRIVATE WITH_IPP) endif() if (GLIBCXX_USE_CXX11_ABI) target_compile_definitions(${target} PUBLIC _GLIBCXX_USE_CXX11_ABI=1) @@ -183,10 +195,6 @@ function(open3d_set_global_properties target) target_compile_options(${target} PRIVATE $<$,$>>:-fno-fast-math>) - # TBB static version is used - # See: https://github.com/wjakob/tbb/commit/615d690c165d68088c32b6756c430261b309b79c - target_compile_definitions(${target} PRIVATE __TBB_LIB_NAME=tbb_static) - # Enable strip open3d_enable_strip(${target}) @@ -194,4 +202,5 @@ function(open3d_set_global_properties target) target_compile_options(${target} PRIVATE "$<$:${HARDENING_CFLAGS}>") target_link_options(${target} PRIVATE "$<$:${HARDENING_LDFLAGS}>") target_compile_definitions(${target} PRIVATE "$<$:${HARDENING_DEFINITIONS}>") + endfunction() diff --git a/cmake/Open3DShowAndAbortOnWarning.cmake b/cmake/Open3DShowAndAbortOnWarning.cmake index f1ac292fe38..c95bfa75ac0 100644 --- a/cmake/Open3DShowAndAbortOnWarning.cmake +++ b/cmake/Open3DShowAndAbortOnWarning.cmake @@ -33,28 +33,14 @@ function(open3d_show_and_abort_on_warning target) string(REPLACE ";" "," DISABLE_NVCC_WARNINGS "${DISABLE_NVCC_WARNINGS}") set(CUDA_FLAGS "--Werror cross-execution-space-call,deprecated-declarations") - if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "10.2") - string(APPEND CUDA_FLAGS " --Werror all-warnings") - endif() - if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "11.0") - string(APPEND CUDA_FLAGS " --Werror ext-lambda-captures-this") - endif() + string(APPEND CUDA_FLAGS " --Werror all-warnings") + string(APPEND CUDA_FLAGS " --Werror ext-lambda-captures-this") string(APPEND CUDA_FLAGS " --expt-relaxed-constexpr") - if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "11.2") - string(APPEND CUDA_FLAGS " --diag-suppress ${DISABLE_NVCC_WARNINGS}") - else() - string(APPEND CUDA_FLAGS " -Xcudafe --diag_suppress=[${DISABLE_NVCC_WARNINGS}]") - endif() + string(APPEND CUDA_FLAGS " --diag-suppress ${DISABLE_NVCC_WARNINGS}") # Host compiler flags if (MSVC) set(CUDA_DISABLE_MSVC_WARNINGS ${DISABLE_MSVC_WARNINGS}) - if (CMAKE_CUDA_COMPILER_VERSION VERSION_LESS "11.2") - list(APPEND CUDA_DISABLE_MSVC_WARNINGS $<$:/wd4700>) # uninitialized local variable used (thrust) - endif() - if (CMAKE_CUDA_COMPILER_VERSION VERSION_LESS "11.1") - list(APPEND CUDA_DISABLE_MSVC_WARNINGS /wd4515) # namespace uses itself (thrust) - endif() string(REPLACE ";" "," CUDA_DISABLE_MSVC_WARNINGS "${CUDA_DISABLE_MSVC_WARNINGS}") string(APPEND CUDA_FLAGS " -Xcompiler /W4,/WX,${CUDA_DISABLE_MSVC_WARNINGS}") diff --git a/cmake/ShaderEncoder.cpp b/cmake/ShaderEncoder.cpp index 0f758c92798..5773c3c2438 100644 --- a/cmake/ShaderEncoder.cpp +++ b/cmake/ShaderEncoder.cpp @@ -1,27 +1,8 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// The MIT License (MIT) -// -// Copyright (c) 2018-2023 www.open3d.org -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. +// Copyright (c) 2018-2024 www.open3d.org +// SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- #include diff --git a/cmake/ShaderLinker.cpp b/cmake/ShaderLinker.cpp index 1daf832d97d..06c6d7b3809 100644 --- a/cmake/ShaderLinker.cpp +++ b/cmake/ShaderLinker.cpp @@ -1,27 +1,8 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// The MIT License (MIT) -// -// Copyright (c) 2018-2023 www.open3d.org -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. +// Copyright (c) 2018-2024 www.open3d.org +// SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- #include @@ -43,13 +24,13 @@ int main(int argc, char **argv) { argv[1]); return 1; } - + /* clang-format off */ fprintf(file_out, "// ----------------------------------------------------------------------------\n"); fprintf(file_out, "// - Open3D: www.open3d.org -\n"); fprintf(file_out, "// ----------------------------------------------------------------------------\n"); fprintf(file_out, "// The MIT License (MIT)\n"); fprintf(file_out, "//\n"); - fprintf(file_out, "// Copyright (c) 2018-2023 www.open3d.org\n"); + fprintf(file_out, "// Copyright (c) 2018-2024 www.open3d.org\n"); fprintf(file_out, "//\n"); fprintf(file_out, "// Permission is hereby granted, free of charge, to any person obtaining a copy\n"); fprintf(file_out, "// of this software and associated documentation files (the \"Software\"), to deal\n"); @@ -69,7 +50,8 @@ int main(int argc, char **argv) { fprintf(file_out, "// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n"); fprintf(file_out, "// IN THE SOFTWARE.\n"); fprintf(file_out, "// ----------------------------------------------------------------------------\n"); - + /* clang-format on */ + fprintf(file_out, "// Automatically generated header file for shader.\n"); fprintf(file_out, "\n"); fprintf(file_out, "#pragma once\n"); diff --git a/cmake/ispc_isas/ISADispatcher.c b/cmake/ispc_isas/ISADispatcher.c index 5c3e559d3fc..e78d5c61237 100644 --- a/cmake/ispc_isas/ISADispatcher.c +++ b/cmake/ispc_isas/ISADispatcher.c @@ -1,27 +1,8 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// The MIT License (MIT) -// -// Copyright (c) 2018-2023 www.open3d.org -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. +// Copyright (c) 2018-2024 www.open3d.org +// SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- #include @@ -54,4 +35,4 @@ int main() { printf("%s-i%dx%d", ToTargetString(GetISATarget()), GetISAElementWidth(), GetISAWidth()); return 0; -} \ No newline at end of file +} diff --git a/cmake/ispc_isas/ISADispatcher.ispc b/cmake/ispc_isas/ISADispatcher.ispc index bd5e5e4f59c..0767ebe931f 100644 --- a/cmake/ispc_isas/ISADispatcher.ispc +++ b/cmake/ispc_isas/ISADispatcher.ispc @@ -1,27 +1,8 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// The MIT License (MIT) -// -// Copyright (c) 2018-2023 www.open3d.org -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. +// Copyright (c) 2018-2024 www.open3d.org +// SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- #include "open3d/utility/ISAInfo.isph" diff --git a/cpp/apps/CMakeLists.txt b/cpp/apps/CMakeLists.txt index 8d5bc944480..e4f33cb4407 100644 --- a/cpp/apps/CMakeLists.txt +++ b/cpp/apps/CMakeLists.txt @@ -118,7 +118,7 @@ macro(open3d_add_app_common SRC_DIR APP_NAME TARGET_NAME) MACOSX_BUNDLE_INFO_PLIST "${INFO_PLIST}" XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "" # disable OUTPUT_NAME ${APP_NAME} - ) + INSTALL_RPATH "@loader_path;@loader_path/../lib/") elseif (WIN32) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/../${APP_NAME}") add_executable(${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) @@ -127,10 +127,10 @@ macro(open3d_add_app_common SRC_DIR APP_NAME TARGET_NAME) add_executable(${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES}) set_target_properties(${TARGET_NAME} PROPERTIES OUTPUT_NAME ${APP_NAME} - ) + INSTALL_RPATH "$ORIGIN;$ORIGIN/../lib/") endif() - target_link_libraries(${TARGET_NAME} PRIVATE Open3D::Open3D ${ARGN}) + target_link_libraries(${TARGET_NAME} PRIVATE Open3D::Open3D TBB::tbb ${ARGN}) set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "apps") open3d_link_3rdparty_libraries(${TARGET_NAME}) diff --git a/cpp/apps/OfflineReconstruction/Config.h b/cpp/apps/OfflineReconstruction/Config.h index 9bb95df2093..a421a142b25 100644 --- a/cpp/apps/OfflineReconstruction/Config.h +++ b/cpp/apps/OfflineReconstruction/Config.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/apps/OfflineReconstruction/DebugUtil.h b/cpp/apps/OfflineReconstruction/DebugUtil.h index aa10e95d934..0cd8ce90245 100644 --- a/cpp/apps/OfflineReconstruction/DebugUtil.h +++ b/cpp/apps/OfflineReconstruction/DebugUtil.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/apps/OfflineReconstruction/FileSystemUtil.h b/cpp/apps/OfflineReconstruction/FileSystemUtil.h index 4ebc976e03c..c3d07767744 100644 --- a/cpp/apps/OfflineReconstruction/FileSystemUtil.h +++ b/cpp/apps/OfflineReconstruction/FileSystemUtil.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/apps/OfflineReconstruction/LegacyReconstructionUtil.h b/cpp/apps/OfflineReconstruction/LegacyReconstructionUtil.h index 26d30bfe182..46796ef36a0 100644 --- a/cpp/apps/OfflineReconstruction/LegacyReconstructionUtil.h +++ b/cpp/apps/OfflineReconstruction/LegacyReconstructionUtil.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/apps/OfflineReconstruction/OfflineReconstruction.cpp b/cpp/apps/OfflineReconstruction/OfflineReconstruction.cpp index 3e5d4efac05..fee3000c19e 100644 --- a/cpp/apps/OfflineReconstruction/OfflineReconstruction.cpp +++ b/cpp/apps/OfflineReconstruction/OfflineReconstruction.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/apps/Open3DViewer/Debian/CMakeLists.in.txt b/cpp/apps/Open3DViewer/Debian/CMakeLists.in.txt index b7bce43f4c6..bb96becca4d 100644 --- a/cpp/apps/Open3DViewer/Debian/CMakeLists.in.txt +++ b/cpp/apps/Open3DViewer/Debian/CMakeLists.in.txt @@ -33,7 +33,7 @@ set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Open3D Viewer for 3D files") set(CPACK_PACKAGE_CONTACT "Open3D team <@PROJECT_EMAIL@>") set(CPACK_DEBIAN_PACKAGE_SECTION "Graphics") set(CPACK_PACKAGE_VERSION "@OPEN3D_VERSION_FULL@") -set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc++1, libgomp1, libpng16-16, libglfw3") +set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc++1, libgomp1, libpng16-16, libglfw3, libtbb12") set(CPACK_PACKAGE_HOMEPAGE_URL "@PROJECT_HOMEPAGE_URL@") include(CPack) diff --git a/cpp/apps/Open3DViewer/Open3DViewer.cpp b/cpp/apps/Open3DViewer/Open3DViewer.cpp index c84cce8ecc4..ce938acbcff 100644 --- a/cpp/apps/Open3DViewer/Open3DViewer.cpp +++ b/cpp/apps/Open3DViewer/Open3DViewer.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/apps/Open3DViewer/Open3DViewer.h b/cpp/apps/Open3DViewer/Open3DViewer.h index 4e6a933d420..d0d6bdc4f41 100644 --- a/cpp/apps/Open3DViewer/Open3DViewer.h +++ b/cpp/apps/Open3DViewer/Open3DViewer.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/apps/Open3DViewer/Open3DViewer_mac.mm b/cpp/apps/Open3DViewer/Open3DViewer_mac.mm index 23811213b0e..9e40dd80c3c 100644 --- a/cpp/apps/Open3DViewer/Open3DViewer_mac.mm +++ b/cpp/apps/Open3DViewer/Open3DViewer_mac.mm @@ -1,27 +1,8 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// The MIT License (MIT) -// -// Copyright (c) 2018-2023 www.open3d.org -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. +// Copyright (c) 2018-2024 www.open3d.org +// SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- #ifdef __APPLE__ diff --git a/cpp/apps/fixup_macosx_bundle.sh b/cpp/apps/fixup_macosx_bundle.sh index a0388ac1c60..a69a0ca70f1 100755 --- a/cpp/apps/fixup_macosx_bundle.sh +++ b/cpp/apps/fixup_macosx_bundle.sh @@ -7,13 +7,13 @@ # within the bundle. if [[ $(uname) != "Darwin" ]]; then - echo "This script is only useful for macOS" - exit 1 + echo "This script is only useful for macOS" + exit 1 fi if [[ $# != 1 ]]; then - echo "Usage: $0 path/to/name.app" - exit 1 + echo "Usage: $0 path/to/name.app" + exit 1 fi # Find the path to the actual executable in the app bundle @@ -21,17 +21,17 @@ appBundle=$1 exeDir="$appBundle/Contents/MacOS" exe=$(find "$exeDir" -type f -perm +111 | grep -v dylib) if [[ ! -f $exe ]]; then - echo "No executable file in app bundle ($appBundle/Contents/MacOS)" - exit 1 + echo "No executable file in app bundle ($appBundle/Contents/MacOS)" + exit 1 fi # Find the rpath paths rpaths=$(otool -l "$exe" | grep "path " | awk '{print $2}') if [[ $rpath != "" ]]; then - echo "@rpath:" - for rp in $rpaths; do - echo " $rp" - done + echo "@rpath:" + for rp in $rpaths; do + echo " $rp" + done fi # Set IFS so that newlines don't become spaces; helps parsing the otool -L output @@ -41,35 +41,34 @@ IFS=' # Copy any external libraries and change the library paths to @executable_path libs=$(otool -L "$exe" | grep -v "$exe" | grep -v /usr/lib | grep -v /System | awk '{ print $1; }') for lib in $libs; do - if [[ ${lib:0:1} != "@" ]]; then # external library with a regular path - # copy the external library - cp -aL "$lib" "$exeDir" + if [[ ${lib:0:1} != "@" ]]; then # external library with a regular path + libname=$(basename $lib) + # copy the external library, resolve symlink chain + cp -aRL "$lib" "$exeDir/$lib" + # change its path in the executable + newpath="@executable_path/$libname" + echo "$lib -> $newpath" + install_name_tool -change "$lib" "$newpath" "$exe" - # change its path in the executable - libname=$(basename $lib) - newpath="@executable_path/$libname" - echo "$lib -> $newpath" - install_name_tool -change "$lib" "$newpath" "$exe" + elif [[ $lib == @rpath/* ]]; then # external library with @rpath + libname=${lib:7} + # copy the external library. Since it uses an rpath, we need to + # prepend each rpath to see which one gives a valid path + for rp in $rpaths; do + if [[ -f "$rp/$libname" ]]; then + cp -aRL "$rp/$libname" "$exeDir/$libname" + break + fi + done - elif [[ $lib == @rpath/* ]]; then # external library with @rpath - libname=${lib:7} - # copy the external library. Since it uses an rpath, we need to - # prepend each rpath to see which one gives a valid path - for rp in $rpaths; do - if [[ -f "$rp/$libname" ]]; then - cp -a "$rp/$libname" "$exeDir" - break - fi - done - - # change its path in the executable - newpath="@executable_path/$libname" - echo "$lib -> $newpath" - install_name_tool -change "$lib" "$newpath" $exe - fi + # change its path in the executable + newpath="@executable_path/$libname" + echo "$lib -> $newpath" + install_name_tool -change "$lib" "$newpath" $exe + fi done # Remove rpaths for rp in $rpaths; do - install_name_tool -delete_rpath "$rp" "$exe" + install_name_tool -delete_rpath "$rp" "$exe" done diff --git a/cpp/benchmarks/CMakeLists.txt b/cpp/benchmarks/CMakeLists.txt index 50dba5a6808..89178ce97cd 100644 --- a/cpp/benchmarks/CMakeLists.txt +++ b/cpp/benchmarks/CMakeLists.txt @@ -23,7 +23,7 @@ if (BUILD_CUDA_MODULE) target_include_directories(benchmarks SYSTEM PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) endif() -if (WITH_IPPICV) +if (WITH_IPP) target_compile_definitions(benchmarks PRIVATE IPP_CONDITIONAL_TEST_STR=) # Empty string (test not disabled) else() target_compile_definitions(benchmarks PRIVATE IPP_CONDITIONAL_TEST_STR=DISABLED_) diff --git a/cpp/benchmarks/Main.cpp b/cpp/benchmarks/Main.cpp index 6f645bd8b3a..ca2e66fe591 100644 --- a/cpp/benchmarks/Main.cpp +++ b/cpp/benchmarks/Main.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // Copyright 2018 Google Inc. All rights reserved. diff --git a/cpp/benchmarks/benchmark_utilities/Rand.cpp b/cpp/benchmarks/benchmark_utilities/Rand.cpp index bd7de1bc552..b64ee2943d0 100644 --- a/cpp/benchmarks/benchmark_utilities/Rand.cpp +++ b/cpp/benchmarks/benchmark_utilities/Rand.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/benchmarks/benchmark_utilities/Rand.h b/cpp/benchmarks/benchmark_utilities/Rand.h index a86d4eaae05..7cefae1669a 100644 --- a/cpp/benchmarks/benchmark_utilities/Rand.h +++ b/cpp/benchmarks/benchmark_utilities/Rand.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/benchmarks/core/BinaryEW.cpp b/cpp/benchmarks/core/BinaryEW.cpp index d79427da0ba..86a7a487605 100644 --- a/cpp/benchmarks/core/BinaryEW.cpp +++ b/cpp/benchmarks/core/BinaryEW.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/benchmarks/core/HashMap.cpp b/cpp/benchmarks/core/HashMap.cpp index 7cc8087db74..0361afcb9f5 100644 --- a/cpp/benchmarks/core/HashMap.cpp +++ b/cpp/benchmarks/core/HashMap.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/benchmarks/core/Linalg.cpp b/cpp/benchmarks/core/Linalg.cpp index f156a1f0c6d..7a4a3d6138b 100644 --- a/cpp/benchmarks/core/Linalg.cpp +++ b/cpp/benchmarks/core/Linalg.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/benchmarks/core/MemoryManager.cpp b/cpp/benchmarks/core/MemoryManager.cpp index cb684e38efd..fccca3de621 100644 --- a/cpp/benchmarks/core/MemoryManager.cpp +++ b/cpp/benchmarks/core/MemoryManager.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/benchmarks/core/ParallelFor.cpp b/cpp/benchmarks/core/ParallelFor.cpp index 693bc1312cb..15c6233022a 100644 --- a/cpp/benchmarks/core/ParallelFor.cpp +++ b/cpp/benchmarks/core/ParallelFor.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/benchmarks/core/ParallelFor.ispc b/cpp/benchmarks/core/ParallelFor.ispc index 377d0aa914d..4d69e227241 100644 --- a/cpp/benchmarks/core/ParallelFor.ispc +++ b/cpp/benchmarks/core/ParallelFor.ispc @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/benchmarks/core/Reduction.cpp b/cpp/benchmarks/core/Reduction.cpp index 8256f60904e..1c019f29960 100644 --- a/cpp/benchmarks/core/Reduction.cpp +++ b/cpp/benchmarks/core/Reduction.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/benchmarks/core/UnaryEW.cpp b/cpp/benchmarks/core/UnaryEW.cpp index 195ddd0f110..30051948282 100644 --- a/cpp/benchmarks/core/UnaryEW.cpp +++ b/cpp/benchmarks/core/UnaryEW.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/benchmarks/core/Zeros.cpp b/cpp/benchmarks/core/Zeros.cpp index a9c9dd10d30..9eb534369f0 100644 --- a/cpp/benchmarks/core/Zeros.cpp +++ b/cpp/benchmarks/core/Zeros.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/benchmarks/geometry/KDTreeFlann.cpp b/cpp/benchmarks/geometry/KDTreeFlann.cpp index c34b2cae319..838f375a04f 100644 --- a/cpp/benchmarks/geometry/KDTreeFlann.cpp +++ b/cpp/benchmarks/geometry/KDTreeFlann.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/benchmarks/geometry/SamplePoints.cpp b/cpp/benchmarks/geometry/SamplePoints.cpp index 9757160c1f8..d7b9c6f7a00 100644 --- a/cpp/benchmarks/geometry/SamplePoints.cpp +++ b/cpp/benchmarks/geometry/SamplePoints.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/benchmarks/geometry/TriangleMesh.cpp b/cpp/benchmarks/geometry/TriangleMesh.cpp index 0f6d11cbcea..4a07fb0a23f 100644 --- a/cpp/benchmarks/geometry/TriangleMesh.cpp +++ b/cpp/benchmarks/geometry/TriangleMesh.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/benchmarks/io/PointCloudIO.cpp b/cpp/benchmarks/io/PointCloudIO.cpp index 3fa35a014ee..5ac5b43e90c 100644 --- a/cpp/benchmarks/io/PointCloudIO.cpp +++ b/cpp/benchmarks/io/PointCloudIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/benchmarks/pipelines/registration/Registration.cpp b/cpp/benchmarks/pipelines/registration/Registration.cpp index 4299265cc6e..8ed5eabcad7 100644 --- a/cpp/benchmarks/pipelines/registration/Registration.cpp +++ b/cpp/benchmarks/pipelines/registration/Registration.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/benchmarks/t/geometry/PointCloud.cpp b/cpp/benchmarks/t/geometry/PointCloud.cpp index 814587320a6..dbc84715885 100644 --- a/cpp/benchmarks/t/geometry/PointCloud.cpp +++ b/cpp/benchmarks/t/geometry/PointCloud.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/benchmarks/t/io/PointCloudIO.cpp b/cpp/benchmarks/t/io/PointCloudIO.cpp index f1ad9bbf6c1..4fc81f1c209 100644 --- a/cpp/benchmarks/t/io/PointCloudIO.cpp +++ b/cpp/benchmarks/t/io/PointCloudIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/benchmarks/t/io/TriangleMeshIO.cpp b/cpp/benchmarks/t/io/TriangleMeshIO.cpp index 3dfa9cd7731..fb320160291 100644 --- a/cpp/benchmarks/t/io/TriangleMeshIO.cpp +++ b/cpp/benchmarks/t/io/TriangleMeshIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/benchmarks/t/pipelines/odometry/RGBDOdometry.cpp b/cpp/benchmarks/t/pipelines/odometry/RGBDOdometry.cpp index d79cfc0d18a..f68412dd399 100644 --- a/cpp/benchmarks/t/pipelines/odometry/RGBDOdometry.cpp +++ b/cpp/benchmarks/t/pipelines/odometry/RGBDOdometry.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -36,7 +36,7 @@ static core::Tensor CreateIntrisicTensor() { static void ComputeOdometryResultPointToPlane(benchmark::State& state, const core::Device& device) { - if (!t::geometry::Image::HAVE_IPPICV && device.IsCPU()) { + if (!t::geometry::Image::HAVE_IPP && device.IsCPU()) { return; } @@ -97,7 +97,7 @@ static void RGBDOdometryMultiScale( benchmark::State& state, const core::Device& device, const t::pipelines::odometry::Method& method) { - if (!t::geometry::Image::HAVE_IPPICV && device.IsCPU()) { + if (!t::geometry::Image::HAVE_IPP && device.IsCPU()) { return; } diff --git a/cpp/benchmarks/t/pipelines/registration/Feature.cpp b/cpp/benchmarks/t/pipelines/registration/Feature.cpp index 929fed0ca61..e3b67eb8db6 100644 --- a/cpp/benchmarks/t/pipelines/registration/Feature.cpp +++ b/cpp/benchmarks/t/pipelines/registration/Feature.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/benchmarks/t/pipelines/registration/Registration.cpp b/cpp/benchmarks/t/pipelines/registration/Registration.cpp index 71edb2cab1e..cd00c1e2e8f 100644 --- a/cpp/benchmarks/t/pipelines/registration/Registration.cpp +++ b/cpp/benchmarks/t/pipelines/registration/Registration.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/CMakeLists.txt b/cpp/open3d/CMakeLists.txt index 6da3581e509..00b04684b2c 100644 --- a/cpp/open3d/CMakeLists.txt +++ b/cpp/open3d/CMakeLists.txt @@ -5,6 +5,10 @@ # lib, and targets that links to the Open3D lib, e.g pybind, unit tests, etc. function(open3d_set_open3d_lib_properties target) cmake_parse_arguments(arg "HIDDEN" "" "" ${ARGN}) + set_target_properties(${target} PROPERTIES + VERSION ${PROJECT_VERSION} + SOVERSION ${OPEN3D_ABI_VERSION} + ) if(NOT BUILD_SHARED_LIBS) target_compile_definitions(${target} PUBLIC OPEN3D_STATIC) endif() @@ -85,6 +89,7 @@ target_sources(Open3D PRIVATE open3d_ispc_target_sources_TARGET_OBJECTS(Open3D PRIVATE camera core + core_impl data geometry tgeometry @@ -97,6 +102,7 @@ open3d_ispc_target_sources_TARGET_OBJECTS(Open3D PRIVATE tpipelines_kernel utility visualization + visualization_impl ) if (BUILD_GUI) @@ -191,7 +197,7 @@ Description: @PROJECT_DESCRIPTION@ URL: @PROJECT_HOMEPAGE_URL@ Version: @PROJECT_VERSION@ Cflags: -std=c++@CMAKE_CXX_STANDARD@ -isystem${includedir} -isystem${includedir}/open3d/3rdparty -D$, -D> -Libs: -L${libdir} -Wl,-rpath,${libdir} -lOpen3D]=] @ONLY NEWLINE_STYLE LF) +Libs: -L${libdir} -Wl,-rpath,${libdir} -lOpen3D -ltbb]=] @ONLY NEWLINE_STYLE LF) file(GENERATE OUTPUT Open3D.pc INPUT "${CMAKE_CURRENT_BINARY_DIR}/Open3D.pc.in" TARGET "Open3D::Open3D") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/Open3D.pc" diff --git a/cpp/open3d/Macro.h b/cpp/open3d/Macro.h index d88da87e8b7..5704b40327b 100644 --- a/cpp/open3d/Macro.h +++ b/cpp/open3d/Macro.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -10,6 +10,9 @@ #include // https://gcc.gnu.org/wiki/Visibility updated to use C++11 attribute syntax +// In Open3D, we set symbol visibility based on folder / cmake target through +// cmake. e.g. all symbols in kernel folders are hidden. These macros allow fine +// grained control over symbol visibility. #if defined(_WIN32) || defined(__CYGWIN__) #define OPEN3D_DLL_IMPORT __declspec(dllimport) #define OPEN3D_DLL_EXPORT __declspec(dllexport) diff --git a/cpp/open3d/Open3D.h.in b/cpp/open3d/Open3D.h.in index 38ba353c61a..5c9a5b5c60a 100644 --- a/cpp/open3d/Open3D.h.in +++ b/cpp/open3d/Open3D.h.in @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/Open3DConfig.cpp b/cpp/open3d/Open3DConfig.cpp index a8019ae9316..a2904c01402 100644 --- a/cpp/open3d/Open3DConfig.cpp +++ b/cpp/open3d/Open3DConfig.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/Open3DConfig.h.in b/cpp/open3d/Open3DConfig.h.in index 2058a58171c..d9ad502c4b6 100644 --- a/cpp/open3d/Open3DConfig.h.in +++ b/cpp/open3d/Open3DConfig.h.in @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/camera/PinholeCameraIntrinsic.cpp b/cpp/open3d/camera/PinholeCameraIntrinsic.cpp index 85cdb00b82e..142e4e083ac 100644 --- a/cpp/open3d/camera/PinholeCameraIntrinsic.cpp +++ b/cpp/open3d/camera/PinholeCameraIntrinsic.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/camera/PinholeCameraIntrinsic.h b/cpp/open3d/camera/PinholeCameraIntrinsic.h index 25e55543ae1..42689877807 100644 --- a/cpp/open3d/camera/PinholeCameraIntrinsic.h +++ b/cpp/open3d/camera/PinholeCameraIntrinsic.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/camera/PinholeCameraParameters.cpp b/cpp/open3d/camera/PinholeCameraParameters.cpp index 465ff1c8044..cf512a2ecd1 100644 --- a/cpp/open3d/camera/PinholeCameraParameters.cpp +++ b/cpp/open3d/camera/PinholeCameraParameters.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/camera/PinholeCameraParameters.h b/cpp/open3d/camera/PinholeCameraParameters.h index 00c053283c5..a2ec46ddfd4 100644 --- a/cpp/open3d/camera/PinholeCameraParameters.h +++ b/cpp/open3d/camera/PinholeCameraParameters.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/camera/PinholeCameraTrajectory.cpp b/cpp/open3d/camera/PinholeCameraTrajectory.cpp index 41d32acf617..8f34c81a821 100644 --- a/cpp/open3d/camera/PinholeCameraTrajectory.cpp +++ b/cpp/open3d/camera/PinholeCameraTrajectory.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/camera/PinholeCameraTrajectory.h b/cpp/open3d/camera/PinholeCameraTrajectory.h index ccde07464fc..d0a44f51b68 100644 --- a/cpp/open3d/camera/PinholeCameraTrajectory.h +++ b/cpp/open3d/camera/PinholeCameraTrajectory.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/cmake_uninstall.cmake.in b/cpp/open3d/cmake_uninstall.cmake.in index 846acdfbccb..9c8b4a68fd7 100644 --- a/cpp/open3d/cmake_uninstall.cmake.in +++ b/cpp/open3d/cmake_uninstall.cmake.in @@ -8,15 +8,12 @@ string(REGEX REPLACE "\n" ";" files "${files}") foreach(file ${files}) message(STATUS "Uninstalling $ENV{DESTDIR}${file}") if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") - exec_program( - "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" - OUTPUT_VARIABLE rm_out - RETURN_VALUE rm_retval) - + execute_process(COMMAND "@CMAKE_COMMAND@" -E remove "$ENV{DESTDIR}${file}" + RESULT_VARIABLE rm_retval) if(NOT "${rm_retval}" STREQUAL 0) message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") endif(NOT "${rm_retval}" STREQUAL 0) - else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + else() message(STATUS "File $ENV{DESTDIR}${file} does not exist.") - endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") -endforeach(file) + endif() +endforeach() diff --git a/cpp/open3d/core/AdvancedIndexing.cpp b/cpp/open3d/core/AdvancedIndexing.cpp index 86ce53148ba..cd53792468c 100644 --- a/cpp/open3d/core/AdvancedIndexing.cpp +++ b/cpp/open3d/core/AdvancedIndexing.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/AdvancedIndexing.h b/cpp/open3d/core/AdvancedIndexing.h index 17a8253085a..ab69dcac8ea 100644 --- a/cpp/open3d/core/AdvancedIndexing.h +++ b/cpp/open3d/core/AdvancedIndexing.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/Atomic.h b/cpp/open3d/core/Atomic.h index a9e89758725..1e7e3502c5d 100644 --- a/cpp/open3d/core/Atomic.h +++ b/cpp/open3d/core/Atomic.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/Blob.h b/cpp/open3d/core/Blob.h index 0cf3a34f659..830a9954dae 100644 --- a/cpp/open3d/core/Blob.h +++ b/cpp/open3d/core/Blob.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/CMakeLists.txt b/cpp/open3d/core/CMakeLists.txt index 7926d3fbcc6..c34cea3fc6d 100644 --- a/cpp/open3d/core/CMakeLists.txt +++ b/cpp/open3d/core/CMakeLists.txt @@ -41,22 +41,7 @@ target_sources(core PRIVATE hashmap/HashBackendBuffer.cpp hashmap/HashMap.cpp hashmap/HashSet.cpp - kernel/Arange.cpp - kernel/ArangeCPU.cpp - kernel/BinaryEW.cpp - kernel/BinaryEWCPU.cpp - kernel/IndexGetSet.cpp - kernel/IndexGetSetCPU.cpp - kernel/IndexReduction.cpp - kernel/IndexReductionCPU.cpp kernel/Kernel.cpp - kernel/NonZero.cpp - kernel/NonZeroCPU.cpp - kernel/Reduction.cpp - kernel/ReductionCPU.cpp - kernel/UnaryEW.cpp - kernel/UnaryEWCPU.cpp - kernel/UnaryEWSYCL.cpp linalg/AddMM.cpp linalg/AddMMCPU.cpp linalg/Det.cpp @@ -82,11 +67,33 @@ target_sources(core PRIVATE nns/NNSIndex.cpp ) +# core_impl contains the implementation of core functions that are not exposed in the public API +open3d_ispc_add_library(core_impl OBJECT) +set_target_properties(core_impl PROPERTIES CXX_VISIBILITY_PRESET "hidden") + +target_sources(core_impl PRIVATE + kernel/Arange.cpp + kernel/ArangeCPU.cpp + kernel/BinaryEW.cpp + kernel/BinaryEWCPU.cpp + kernel/IndexGetSet.cpp + kernel/IndexGetSetCPU.cpp + kernel/IndexReduction.cpp + kernel/IndexReductionCPU.cpp + kernel/NonZero.cpp + kernel/NonZeroCPU.cpp + kernel/Reduction.cpp + kernel/ReductionCPU.cpp + kernel/UnaryEW.cpp + kernel/UnaryEWCPU.cpp + kernel/UnaryEWSYCL.cpp +) + if (BUILD_CUDA_MODULE) target_sources(core PRIVATE MemoryManagerCUDA.cpp ) - target_sources(core PRIVATE + target_sources(core_impl PRIVATE hashmap/CUDA/CreateCUDAHashBackend.cu hashmap/CUDA/CUDAHashBackendBuffer.cu hashmap/CUDA/SlabNodeManager.cu @@ -116,6 +123,8 @@ endif() if (BUILD_ISPC_MODULE) target_sources(core PRIVATE Indexer.ispc + ) + target_sources(core_impl PRIVATE kernel/BinaryEWCPU.ispc kernel/UnaryEWCPU.ispc ) @@ -126,6 +135,12 @@ open3d_set_global_properties(core) open3d_set_open3d_lib_properties(core) open3d_link_3rdparty_libraries(core) +open3d_show_and_abort_on_warning(core_impl) +open3d_set_global_properties(core_impl) +open3d_set_open3d_lib_properties(core_impl) +open3d_link_3rdparty_libraries(core_impl) + if(BUILD_CUDA_MODULE) target_include_directories(core SYSTEM PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) + target_include_directories(core_impl SYSTEM PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) endif() diff --git a/cpp/open3d/core/CUDAUtils.cpp b/cpp/open3d/core/CUDAUtils.cpp index 1da331035e7..ab805bda049 100644 --- a/cpp/open3d/core/CUDAUtils.cpp +++ b/cpp/open3d/core/CUDAUtils.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/CUDAUtils.h b/cpp/open3d/core/CUDAUtils.h index 15f87be040d..16a3841e2d1 100644 --- a/cpp/open3d/core/CUDAUtils.h +++ b/cpp/open3d/core/CUDAUtils.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/DLPack.h b/cpp/open3d/core/DLPack.h index 1cec10a712f..0b26310c25c 100644 --- a/cpp/open3d/core/DLPack.h +++ b/cpp/open3d/core/DLPack.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/core/Device.cpp b/cpp/open3d/core/Device.cpp index 7137e307874..95345094985 100644 --- a/cpp/open3d/core/Device.cpp +++ b/cpp/open3d/core/Device.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -137,7 +137,7 @@ std::vector Device::GetAvailableCUDADevices() { } std::vector Device::GetAvailableSYCLDevices() { - return sycl::GetAvailableSYCLDevices(); + return sy::GetAvailableSYCLDevices(); } void Device::PrintAvailableDevices() { diff --git a/cpp/open3d/core/Device.h b/cpp/open3d/core/Device.h index 5b04875ed20..a79d9cf646c 100644 --- a/cpp/open3d/core/Device.h +++ b/cpp/open3d/core/Device.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -21,7 +21,7 @@ class Device { enum class DeviceType { CPU = 0, CUDA = 1, - SYCL = 2, // SYCL gpu_selector(). + SYCL = 2, // SYCL gpu_selector_v. }; /// Default constructor -> "CPU:0". diff --git a/cpp/open3d/core/Dispatch.h b/cpp/open3d/core/Dispatch.h index fe658c8cf15..f6195003a02 100644 --- a/cpp/open3d/core/Dispatch.h +++ b/cpp/open3d/core/Dispatch.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/Dtype.cpp b/cpp/open3d/core/Dtype.cpp index 99102a46d86..8545b8ee53d 100644 --- a/cpp/open3d/core/Dtype.cpp +++ b/cpp/open3d/core/Dtype.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/Dtype.h b/cpp/open3d/core/Dtype.h index 82e1358e659..464ebbbd17f 100644 --- a/cpp/open3d/core/Dtype.h +++ b/cpp/open3d/core/Dtype.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/EigenConverter.cpp b/cpp/open3d/core/EigenConverter.cpp index 7e6e8ca27aa..efc140f3403 100644 --- a/cpp/open3d/core/EigenConverter.cpp +++ b/cpp/open3d/core/EigenConverter.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/EigenConverter.h b/cpp/open3d/core/EigenConverter.h index 383c1bad013..6645f0cfb38 100644 --- a/cpp/open3d/core/EigenConverter.h +++ b/cpp/open3d/core/EigenConverter.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/FunctionTraits.h b/cpp/open3d/core/FunctionTraits.h index dd591e03eb2..deaeaf276fa 100644 --- a/cpp/open3d/core/FunctionTraits.h +++ b/cpp/open3d/core/FunctionTraits.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/Indexer.cpp b/cpp/open3d/core/Indexer.cpp index 7c6e76841d3..3bd27251d24 100644 --- a/cpp/open3d/core/Indexer.cpp +++ b/cpp/open3d/core/Indexer.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/Indexer.h b/cpp/open3d/core/Indexer.h index 7b0eaf7bda8..c9eb8933d49 100644 --- a/cpp/open3d/core/Indexer.h +++ b/cpp/open3d/core/Indexer.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/Indexer.ispc b/cpp/open3d/core/Indexer.ispc index ba96dd08f9e..cf60ac576a4 100644 --- a/cpp/open3d/core/Indexer.ispc +++ b/cpp/open3d/core/Indexer.ispc @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/Indexer.isph b/cpp/open3d/core/Indexer.isph index 517b7219d7c..c9b63486377 100644 --- a/cpp/open3d/core/Indexer.isph +++ b/cpp/open3d/core/Indexer.isph @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/MemoryManager.cpp b/cpp/open3d/core/MemoryManager.cpp index aff4786476d..2bd20aa42c7 100644 --- a/cpp/open3d/core/MemoryManager.cpp +++ b/cpp/open3d/core/MemoryManager.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/MemoryManager.h b/cpp/open3d/core/MemoryManager.h index bde80f2991c..97c02efaf0c 100644 --- a/cpp/open3d/core/MemoryManager.h +++ b/cpp/open3d/core/MemoryManager.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/MemoryManagerCPU.cpp b/cpp/open3d/core/MemoryManagerCPU.cpp index 7f12d166e50..28afab26fd2 100644 --- a/cpp/open3d/core/MemoryManagerCPU.cpp +++ b/cpp/open3d/core/MemoryManagerCPU.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/MemoryManagerCUDA.cpp b/cpp/open3d/core/MemoryManagerCUDA.cpp index 835ea550cfe..8d15a8b8d45 100644 --- a/cpp/open3d/core/MemoryManagerCUDA.cpp +++ b/cpp/open3d/core/MemoryManagerCUDA.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/MemoryManagerCached.cpp b/cpp/open3d/core/MemoryManagerCached.cpp index 9165c46c9df..8af8dd152ad 100644 --- a/cpp/open3d/core/MemoryManagerCached.cpp +++ b/cpp/open3d/core/MemoryManagerCached.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/MemoryManagerSYCL.cpp b/cpp/open3d/core/MemoryManagerSYCL.cpp index c3d642a2c76..2e5cd2e7397 100644 --- a/cpp/open3d/core/MemoryManagerSYCL.cpp +++ b/cpp/open3d/core/MemoryManagerSYCL.cpp @@ -1,12 +1,12 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- -#include #include +#include #include #include "open3d/core/Device.h" @@ -18,24 +18,22 @@ namespace open3d { namespace core { -namespace sy = cl::sycl; - void* MemoryManagerSYCL::Malloc(size_t byte_size, const Device& device) { - const sy::queue& queue = - sycl::SYCLContext::GetInstance().GetDefaultQueue(device); + const sycl::queue& queue = + sy::SYCLContext::GetInstance().GetDefaultQueue(device); #ifdef ENABLE_SYCL_UNIFIED_SHARED_MEMORY - return static_cast(sy::malloc_shared(byte_size, queue)); + return static_cast(sycl::malloc_shared(byte_size, queue)); #else - return static_cast(sy::malloc_device(byte_size, queue)); + return static_cast(sycl::malloc_device(byte_size, queue)); #endif } void MemoryManagerSYCL::Free(void* ptr, const Device& device) { if (ptr) { - const sy::queue& queue = - sycl::SYCLContext::GetInstance().GetDefaultQueue(device); - sy::free(ptr, queue); + const sycl::queue& queue = + sy::SYCLContext::GetInstance().GetDefaultQueue(device); + sycl::free(ptr, queue); } } @@ -62,8 +60,8 @@ void MemoryManagerSYCL::Memcpy(void* dst_ptr, dst_device.ToString()); } - sy::queue queue = - sycl::SYCLContext::GetInstance().GetDefaultQueue(device_with_queue); + sycl::queue queue = + sy::SYCLContext::GetInstance().GetDefaultQueue(device_with_queue); queue.memcpy(dst_ptr, src_ptr, num_bytes).wait_and_throw(); } diff --git a/cpp/open3d/core/MemoryManagerStatistic.cpp b/cpp/open3d/core/MemoryManagerStatistic.cpp index 82c15e2edf9..ded1ca2598b 100644 --- a/cpp/open3d/core/MemoryManagerStatistic.cpp +++ b/cpp/open3d/core/MemoryManagerStatistic.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/MemoryManagerStatistic.h b/cpp/open3d/core/MemoryManagerStatistic.h index 60de026ec5c..1310247df17 100644 --- a/cpp/open3d/core/MemoryManagerStatistic.h +++ b/cpp/open3d/core/MemoryManagerStatistic.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/ParallelFor.h b/cpp/open3d/core/ParallelFor.h index d9bbe376684..2d5bef78812 100644 --- a/cpp/open3d/core/ParallelFor.h +++ b/cpp/open3d/core/ParallelFor.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/ParallelFor.isph b/cpp/open3d/core/ParallelFor.isph index 89137651b80..e2cbf8cdadf 100644 --- a/cpp/open3d/core/ParallelFor.isph +++ b/cpp/open3d/core/ParallelFor.isph @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/SYCLContext.cpp b/cpp/open3d/core/SYCLContext.cpp index 660ab8d2bab..30c5f6f6afc 100644 --- a/cpp/open3d/core/SYCLContext.cpp +++ b/cpp/open3d/core/SYCLContext.cpp @@ -1,23 +1,23 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- #include "open3d/core/SYCLContext.h" -#include #include #include #include +#include #include "open3d/core/SYCLUtils.h" #include "open3d/utility/Logging.h" namespace open3d { namespace core { -namespace sycl { +namespace sy { SYCLContext &SYCLContext::GetInstance() { static thread_local SYCLContext instance; @@ -38,7 +38,7 @@ bool SYCLContext::IsDeviceAvailable(const Device &device) { } std::vector SYCLContext::GetAvailableSYCLDevices() { return devices_; } -sy::queue SYCLContext::GetDefaultQueue(const Device &device) { +sycl::queue SYCLContext::GetDefaultQueue(const Device &device) { return device_to_default_queue_.at(device); } @@ -46,29 +46,30 @@ SYCLContext::SYCLContext() { // SYCL GPU. // TODO: Currently we only support one GPU device. try { - const sy::device &sycl_device = sy::device(sy::gpu_selector()); + const sycl::device &sycl_device = sycl::device(sycl::gpu_selector_v); const Device open3d_device = Device("SYCL:0"); devices_.push_back(open3d_device); device_to_sycl_device_[open3d_device] = sycl_device; - device_to_default_queue_[open3d_device] = sy::queue(sycl_device); - } catch (const sy::exception &e) { + device_to_default_queue_[open3d_device] = sycl::queue(sycl_device); + } catch (const sycl::exception &e) { } - if (devices_.size() == 0) { - // SYCL CPU fallback. - // This could happen if the Intel GPGPU driver is not installed or if - // your CPU does not have integrated GPU. - try { - const sy::device &sycl_device = sy::device(sy::host_selector()); - const Device open3d_device = Device("SYCL:0"); + // SYCL CPU fallback. + // This could happen if the Intel GPGPU driver is not installed or if + // your CPU does not have integrated GPU. + try { + if (devices_.size() == 0) { utility::LogWarning( "SYCL GPU device is not available, falling back to SYCL " "host device."); - devices_.push_back(open3d_device); - device_to_sycl_device_[open3d_device] = sycl_device; - device_to_default_queue_[open3d_device] = sy::queue(sycl_device); - } catch (const sy::exception &e) { } + const sycl::device &sycl_device = sycl::device(sycl::cpu_selector_v); + const Device open3d_device = + Device("SYCL:" + std::to_string(devices_.size())); + devices_.push_back(open3d_device); + device_to_sycl_device_[open3d_device] = sycl_device; + device_to_default_queue_[open3d_device] = sycl::queue(sycl_device); + } catch (const sycl::exception &e) { } if (devices_.size() == 0) { @@ -76,6 +77,6 @@ SYCLContext::SYCLContext() { } } -} // namespace sycl +} // namespace sy } // namespace core } // namespace open3d diff --git a/cpp/open3d/core/SYCLContext.h b/cpp/open3d/core/SYCLContext.h index e23b9d8770c..341da29369e 100644 --- a/cpp/open3d/core/SYCLContext.h +++ b/cpp/open3d/core/SYCLContext.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -14,16 +14,14 @@ #pragma once -#include +#include #include #include "open3d/core/Device.h" namespace open3d { namespace core { -namespace sycl { - -namespace sy = cl::sycl; +namespace sy { /// Singleton SYCL context manager. It maintains: /// - A default queue for each SYCL device @@ -45,7 +43,7 @@ class SYCLContext { std::vector GetAvailableSYCLDevices(); /// Get the default SYCL queue given an Open3D device. - sy::queue GetDefaultQueue(const Device& device); + sycl::queue GetDefaultQueue(const Device& device); private: SYCLContext(); @@ -54,12 +52,12 @@ class SYCLContext { std::vector devices_; /// Maps core::Device to the corresponding default SYCL queue. - std::unordered_map device_to_default_queue_; + std::unordered_map device_to_default_queue_; - /// Maps core::Device to sy::device. Internal use only for now. - std::unordered_map device_to_sycl_device_; + /// Maps core::Device to sycl::device. Internal use only for now. + std::unordered_map device_to_sycl_device_; }; -} // namespace sycl +} // namespace sy } // namespace core } // namespace open3d diff --git a/cpp/open3d/core/SYCLUtils.cpp b/cpp/open3d/core/SYCLUtils.cpp index d9e42fdcde0..011ee5eb653 100644 --- a/cpp/open3d/core/SYCLUtils.cpp +++ b/cpp/open3d/core/SYCLUtils.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -22,45 +22,42 @@ #include "open3d/utility/Logging.h" #ifdef BUILD_SYCL_MODULE -#include +#include #include "open3d/core/SYCLContext.h" #endif namespace open3d { namespace core { -namespace sycl { - -#ifdef BUILD_SYCL_MODULE -namespace sy = cl::sycl; -#endif +namespace sy { int SYCLDemo() { #ifdef BUILD_SYCL_MODULE // Ref: https://intel.github.io/llvm-docs/GetStartedGuide.html // Creating buffer of 4 ints to be used inside the kernel code. - sy::buffer buffer(4); + sycl::buffer buffer(4); // Creating SYCL queue. - sy::queue q; + sycl::queue q; // Size of index space for kernel. - sy::range<1> num_workloads{buffer.size()}; + sycl::range<1> num_workloads{buffer.size()}; // Submitting command group(work) to q. - q.submit([&](sy::handler &cgh) { + q.submit([&](sycl::handler &cgh) { // Getting write only access to the buffer on a device. - auto accessor = buffer.get_access(cgh); + auto accessor = buffer.get_access(cgh); // Execute kernel. - cgh.parallel_for(num_workloads, [=](sy::id<1> WIid) { - // Fill buffer with indexes. - accessor[WIid] = (sy::cl_int)WIid.get(0); - }); + cgh.parallel_for( + num_workloads, [=](sycl::id<1> WIid) { + // Fill buffer with indexes. + accessor[WIid] = (int)WIid.get(0); + }); }); - // Getting read only access to the buffer on the host. + // Getting access to the buffer on the host. // Implicit barrier waiting for q to complete the work. - const auto host_accessor = buffer.get_access(); + const auto host_accessor = buffer.get_host_access(); // Check the results. bool mismatch_found = false; @@ -87,113 +84,107 @@ int SYCLDemo() { #ifdef BUILD_SYCL_MODULE -static std::string GetDeviceTypeName(const sy::device &device) { - auto device_type = device.get_info(); +static std::string GetDeviceTypeName(const sycl::device &device) { + auto device_type = device.get_info(); switch (device_type) { - case sy::info::device_type::cpu: + case sycl::info::device_type::cpu: return "cpu"; - case sy::info::device_type::gpu: + case sycl::info::device_type::gpu: return "gpu"; - case sy::info::device_type::host: + case sycl::info::device_type::host: return "host"; - case sy::info::device_type::accelerator: + case sycl::info::device_type::accelerator: return "acc"; default: return "unknown"; } } -static std::string GetBackendName(const sy::device &device) { - sy::platform platform = device.get_info(); - sy::backend backend = platform.get_backend(); +static std::string GetBackendName(const sycl::device &device) { + sycl::platform platform = device.get_info(); + sycl::backend backend = platform.get_backend(); std::ostringstream os; os << backend; return os.str(); } -static std::string SYCLDeviceToString(const sy::device &device) { +static std::string SYCLDeviceToString(const sycl::device &device) { std::ostringstream os; os << "[" << GetBackendName(device) << ":" << GetDeviceTypeName(device) - << "] " << device.get_info(); + << "] " << device.get_info(); return os.str(); } #endif void PrintSYCLDevices(bool print_all) { #ifdef BUILD_SYCL_MODULE - const char *filter = std::getenv("SYCL_DEVICE_FILTER"); + const char *filter = std::getenv("ONEAPI_DEVICE_SELECTOR"); if (filter) { utility::LogWarning( - "SYCL_DEVICE_FILTER environment variable is set to {}. To see " - "the correct device id, please unset SYCL_DEVICE_FILTER.", + "ONEAPI_DEVICE_SELECTOR environment variable is set to {}. To " + "see the correct device id, please unset " + "ONEAPI_DEVICE_SELECTOR.", filter); } + int nd = 0; + utility::LogInfo("# Open3D SYCL device"); + try { + utility::LogInfo( + "- Device(\"SYCL:{}\"): {}", nd, + SYCLDeviceToString(sycl::device(sycl::gpu_selector_v))); + ++nd; + } catch (const sycl::exception &e) { + } + try { + utility::LogInfo("# Open3D SYCL device (CPU fallback)"); + utility::LogInfo( + "- Device(\"SYCL:{}\"): {}", nd, + SYCLDeviceToString(sycl::device(sycl::cpu_selector_v))); + } catch (const sycl::exception &e) { + if (nd == 0) utility::LogInfo("- Device(\"SYCL:0\"): N/A"); + } if (print_all) { utility::LogInfo("# All SYCL devices"); - const std::vector &platforms = - sy::platform::get_platforms(); - for (const sy::platform &platform : platforms) { - sy::backend backend = platform.get_backend(); - const std::vector &devices = platform.get_devices(); - for (const sy::device &device : devices) { + const std::vector &platforms = + sycl::platform::get_platforms(); + for (const sycl::platform &platform : platforms) { + sycl::backend backend = platform.get_backend(); + const std::vector &devices = platform.get_devices(); + for (const sycl::device &device : devices) { utility::LogInfo("- {}", SYCLDeviceToString(device)); } } utility::LogInfo("# Default SYCL selectors"); try { - const sy::device &device = sy::device(sy::default_selector()); - utility::LogInfo("- sycl::default_selector() : {}", - SYCLDeviceToString(device)); - } catch (const sy::exception &e) { - utility::LogInfo("- sycl::default_selector() : N/A"); - } - try { - const sy::device &device = sy::device(sy::host_selector()); - utility::LogInfo("- sycl::host_selector() : {}", - SYCLDeviceToString(device)); - } catch (const sy::exception &e) { - utility::LogInfo("- sycl::host_selector() : N/A"); - } - try { - const sy::device &device = sy::device(sy::cpu_selector()); - utility::LogInfo("- sycl::cpu_selector() : {}", - SYCLDeviceToString(device)); - } catch (const sy::exception &e) { - utility::LogInfo("- sycl::cpu_selector() : N/A"); - } - try { - const sy::device &device = sy::device(sy::gpu_selector()); - utility::LogInfo("- sycl::gpu_selector() : {}", + const sycl::device &device = sycl::device(sycl::default_selector_v); + utility::LogInfo("- sycl::default_selector_v : {}", SYCLDeviceToString(device)); - } catch (const sy::exception &e) { - utility::LogInfo("- sycl::gpu_selector() : N/A"); + } catch (const sycl::exception &e) { + utility::LogInfo("- sycl::default_selector_v : N/A"); } try { - const sy::device &device = sy::device(sy::accelerator_selector()); - utility::LogInfo("- sycl::accelerator_selector(): {}", + const sycl::device &device = sycl::device(sycl::cpu_selector_v); + utility::LogInfo("- sycl::cpu_selector_v : {}", SYCLDeviceToString(device)); - } catch (const sy::exception &e) { - utility::LogInfo("- sycl::accelerator_selector(): N/A"); + } catch (const sycl::exception &e) { + utility::LogInfo("- sycl::cpu_selector_v : N/A"); } - - utility::LogInfo("# Open3D SYCL device"); try { - const sy::device &device = sy::device(sy::gpu_selector()); - utility::LogInfo("- Device(\"SYCL:0\"): {}", + const sycl::device &device = sycl::device(sycl::gpu_selector_v); + utility::LogInfo("- sycl::gpu_selector_v : {}", SYCLDeviceToString(device)); - } catch (const sy::exception &e) { - utility::LogInfo("- Device(\"SYCL:0\"): N/A"); + } catch (const sycl::exception &e) { + utility::LogInfo("- sycl::gpu_selector_v : N/A"); } - } else { - utility::LogInfo("# Open3D SYCL device"); try { - const sy::device &device = sy::device(sy::gpu_selector()); - utility::LogInfo("- Device(\"SYCL:0\"): {}", + const sycl::device &device = + sycl::device(sycl::accelerator_selector_v); + utility::LogInfo("- sycl::accelerator_selector_v: {}", SYCLDeviceToString(device)); - } catch (const sy::exception &e) { - utility::LogInfo("- Device(\"SYCL:0\"): N/A"); + } catch (const sycl::exception &e) { + utility::LogInfo("- sycl::accelerator_selector_v: N/A"); } } @@ -227,6 +218,20 @@ std::vector GetAvailableSYCLDevices() { #endif } -} // namespace sycl +void enablePersistentJITCache() { +#ifdef BUILD_SYCL_MODULE +#if defined(_WIN32) + _putenv_s("SYCL_CACHE_PERSISTENT", "1"); +#else + setenv("SYCL_CACHE_PERSISTENT", "1", 1); +#endif +#else + utility::LogInfo( + "enablePersistentJITCache is not compiled with " + "BUILD_SYCL_MODULE=ON."); +#endif +} + +} // namespace sy } // namespace core } // namespace open3d diff --git a/cpp/open3d/core/SYCLUtils.h b/cpp/open3d/core/SYCLUtils.h index 385523f3800..c6e34eefe06 100644 --- a/cpp/open3d/core/SYCLUtils.h +++ b/cpp/open3d/core/SYCLUtils.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -19,7 +19,7 @@ namespace open3d { namespace core { -namespace sycl { +namespace sy { /// Runs simple SYCL test program for sanity checks. /// \return Retuns 0 if successful. @@ -40,6 +40,10 @@ bool IsDeviceAvailable(const Device& device); /// Return a list of available SYCL devices. std::vector GetAvailableSYCLDevices(); -} // namespace sycl +/// Enables the JIT cache for SYCL. This sets an environment variable and will +/// affect the entire process and any child processes. +void enablePersistentJITCache(); + +} // namespace sy } // namespace core } // namespace open3d diff --git a/cpp/open3d/core/Scalar.h b/cpp/open3d/core/Scalar.h index 18a91c91816..b26f133104d 100644 --- a/cpp/open3d/core/Scalar.h +++ b/cpp/open3d/core/Scalar.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/ShapeUtil.cpp b/cpp/open3d/core/ShapeUtil.cpp index f1d9b7af1d4..8e8a618b238 100644 --- a/cpp/open3d/core/ShapeUtil.cpp +++ b/cpp/open3d/core/ShapeUtil.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/ShapeUtil.h b/cpp/open3d/core/ShapeUtil.h index 88c20e99823..14c0a7ba6ad 100644 --- a/cpp/open3d/core/ShapeUtil.h +++ b/cpp/open3d/core/ShapeUtil.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/SizeVector.cpp b/cpp/open3d/core/SizeVector.cpp index 0af2d30086c..0f3b6a77cfd 100644 --- a/cpp/open3d/core/SizeVector.cpp +++ b/cpp/open3d/core/SizeVector.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/SizeVector.h b/cpp/open3d/core/SizeVector.h index e352020b42e..ca696093cb2 100644 --- a/cpp/open3d/core/SizeVector.h +++ b/cpp/open3d/core/SizeVector.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/SmallVector.cpp b/cpp/open3d/core/SmallVector.cpp index edd0da456a1..60f12287d39 100644 --- a/cpp/open3d/core/SmallVector.cpp +++ b/cpp/open3d/core/SmallVector.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/core/SmallVector.h b/cpp/open3d/core/SmallVector.h index 4be61809979..2f09c4ec24f 100644 --- a/cpp/open3d/core/SmallVector.h +++ b/cpp/open3d/core/SmallVector.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/core/StdAllocator.h b/cpp/open3d/core/StdAllocator.h index bb6b5f054a3..de5990425af 100644 --- a/cpp/open3d/core/StdAllocator.h +++ b/cpp/open3d/core/StdAllocator.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/Tensor.cpp b/cpp/open3d/core/Tensor.cpp index 8859be594e8..1fff67cc853 100644 --- a/cpp/open3d/core/Tensor.cpp +++ b/cpp/open3d/core/Tensor.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/Tensor.h b/cpp/open3d/core/Tensor.h index 38422055a30..7a20da6b5b2 100644 --- a/cpp/open3d/core/Tensor.h +++ b/cpp/open3d/core/Tensor.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/TensorCheck.cpp b/cpp/open3d/core/TensorCheck.cpp index a7d54182d81..7d4ee43d4d5 100644 --- a/cpp/open3d/core/TensorCheck.cpp +++ b/cpp/open3d/core/TensorCheck.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/TensorCheck.h b/cpp/open3d/core/TensorCheck.h index 698bb1cfcab..6a19632a55f 100644 --- a/cpp/open3d/core/TensorCheck.h +++ b/cpp/open3d/core/TensorCheck.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/TensorFunction.cpp b/cpp/open3d/core/TensorFunction.cpp index 4f9f8e7ebc3..d05f934c1d7 100644 --- a/cpp/open3d/core/TensorFunction.cpp +++ b/cpp/open3d/core/TensorFunction.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/TensorFunction.h b/cpp/open3d/core/TensorFunction.h index 5073bddfd9f..f8a50b75305 100644 --- a/cpp/open3d/core/TensorFunction.h +++ b/cpp/open3d/core/TensorFunction.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/TensorInit.h b/cpp/open3d/core/TensorInit.h index 9c4e89b3d94..cafcdb68c07 100644 --- a/cpp/open3d/core/TensorInit.h +++ b/cpp/open3d/core/TensorInit.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/TensorKey.cpp b/cpp/open3d/core/TensorKey.cpp index 018b74b6edd..3a13732d951 100644 --- a/cpp/open3d/core/TensorKey.cpp +++ b/cpp/open3d/core/TensorKey.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/TensorKey.h b/cpp/open3d/core/TensorKey.h index 3c90b10cf59..d5b89ad2010 100644 --- a/cpp/open3d/core/TensorKey.h +++ b/cpp/open3d/core/TensorKey.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/TensorList.cpp b/cpp/open3d/core/TensorList.cpp index 8052d1a9e72..1ea6e60ce61 100644 --- a/cpp/open3d/core/TensorList.cpp +++ b/cpp/open3d/core/TensorList.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/TensorList.h b/cpp/open3d/core/TensorList.h index 641a15fadce..a5de70ac6bd 100644 --- a/cpp/open3d/core/TensorList.h +++ b/cpp/open3d/core/TensorList.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/hashmap/CPU/CPUHashBackendBuffer.cpp b/cpp/open3d/core/hashmap/CPU/CPUHashBackendBuffer.cpp index 831b65fd2cc..ff014308c08 100644 --- a/cpp/open3d/core/hashmap/CPU/CPUHashBackendBuffer.cpp +++ b/cpp/open3d/core/hashmap/CPU/CPUHashBackendBuffer.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/hashmap/CPU/CPUHashBackendBufferAccessor.hpp b/cpp/open3d/core/hashmap/CPU/CPUHashBackendBufferAccessor.hpp index d6b3e578bbf..5ba9b1a774c 100644 --- a/cpp/open3d/core/hashmap/CPU/CPUHashBackendBufferAccessor.hpp +++ b/cpp/open3d/core/hashmap/CPU/CPUHashBackendBufferAccessor.hpp @@ -1,27 +1,8 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// The MIT License (MIT) -// -// Copyright (c) 2018-2023 www.open3d.org -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. +// Copyright (c) 2018-2024 www.open3d.org +// SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- #pragma once diff --git a/cpp/open3d/core/hashmap/CPU/CreateCPUHashBackend.cpp b/cpp/open3d/core/hashmap/CPU/CreateCPUHashBackend.cpp index 0ba140fa06a..07760c2422e 100644 --- a/cpp/open3d/core/hashmap/CPU/CreateCPUHashBackend.cpp +++ b/cpp/open3d/core/hashmap/CPU/CreateCPUHashBackend.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/hashmap/CPU/TBBHashBackend.h b/cpp/open3d/core/hashmap/CPU/TBBHashBackend.h index f562dc2cc9d..8c898d245aa 100644 --- a/cpp/open3d/core/hashmap/CPU/TBBHashBackend.h +++ b/cpp/open3d/core/hashmap/CPU/TBBHashBackend.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/hashmap/CUDA/CUDAHashBackendBuffer.cu b/cpp/open3d/core/hashmap/CUDA/CUDAHashBackendBuffer.cu index 3f67f42fe0a..627095858ec 100644 --- a/cpp/open3d/core/hashmap/CUDA/CUDAHashBackendBuffer.cu +++ b/cpp/open3d/core/hashmap/CUDA/CUDAHashBackendBuffer.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/hashmap/CUDA/CUDAHashBackendBufferAccessor.h b/cpp/open3d/core/hashmap/CUDA/CUDAHashBackendBufferAccessor.h index 2e5e3987d47..eeb74bc2610 100644 --- a/cpp/open3d/core/hashmap/CUDA/CUDAHashBackendBufferAccessor.h +++ b/cpp/open3d/core/hashmap/CUDA/CUDAHashBackendBufferAccessor.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/hashmap/CUDA/CreateCUDAHashBackend.cu b/cpp/open3d/core/hashmap/CUDA/CreateCUDAHashBackend.cu index 31d82e5058d..8f8ea8bdfc0 100644 --- a/cpp/open3d/core/hashmap/CUDA/CreateCUDAHashBackend.cu +++ b/cpp/open3d/core/hashmap/CUDA/CreateCUDAHashBackend.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/hashmap/CUDA/SlabHashBackend.h b/cpp/open3d/core/hashmap/CUDA/SlabHashBackend.h index cbc7a85b8eb..dbf665c795f 100644 --- a/cpp/open3d/core/hashmap/CUDA/SlabHashBackend.h +++ b/cpp/open3d/core/hashmap/CUDA/SlabHashBackend.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/hashmap/CUDA/SlabHashBackendImpl.h b/cpp/open3d/core/hashmap/CUDA/SlabHashBackendImpl.h index eb27d0a1d12..67903ef9657 100644 --- a/cpp/open3d/core/hashmap/CUDA/SlabHashBackendImpl.h +++ b/cpp/open3d/core/hashmap/CUDA/SlabHashBackendImpl.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/hashmap/CUDA/SlabMacros.h b/cpp/open3d/core/hashmap/CUDA/SlabMacros.h index c3d94f0c1bf..21ba410abdf 100644 --- a/cpp/open3d/core/hashmap/CUDA/SlabMacros.h +++ b/cpp/open3d/core/hashmap/CUDA/SlabMacros.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/hashmap/CUDA/SlabNodeManager.cu b/cpp/open3d/core/hashmap/CUDA/SlabNodeManager.cu index 6fdd6d75c92..df1cfe146d7 100644 --- a/cpp/open3d/core/hashmap/CUDA/SlabNodeManager.cu +++ b/cpp/open3d/core/hashmap/CUDA/SlabNodeManager.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/hashmap/CUDA/SlabNodeManager.h b/cpp/open3d/core/hashmap/CUDA/SlabNodeManager.h index 4d7f4d5a710..9668c31005a 100644 --- a/cpp/open3d/core/hashmap/CUDA/SlabNodeManager.h +++ b/cpp/open3d/core/hashmap/CUDA/SlabNodeManager.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/hashmap/CUDA/SlabTraits.h b/cpp/open3d/core/hashmap/CUDA/SlabTraits.h index ad15855e6d0..bab4f111e4f 100644 --- a/cpp/open3d/core/hashmap/CUDA/SlabTraits.h +++ b/cpp/open3d/core/hashmap/CUDA/SlabTraits.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/hashmap/CUDA/StdGPUHashBackend.h b/cpp/open3d/core/hashmap/CUDA/StdGPUHashBackend.h index 2f27a53b7fc..d6707a6ce17 100644 --- a/cpp/open3d/core/hashmap/CUDA/StdGPUHashBackend.h +++ b/cpp/open3d/core/hashmap/CUDA/StdGPUHashBackend.h @@ -1,13 +1,14 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- #pragma once #include +#include #include #include @@ -90,7 +91,7 @@ class StdGPUAllocator { // accessible in raw CUDA kernels. template using InternalStdGPUHashBackendAllocator = - StdGPUAllocator>; + StdGPUAllocator>; template using InternalStdGPUHashBackend = @@ -252,7 +253,7 @@ void StdGPUHashBackend::Erase(const void* input_keys, template struct ValueExtractor { OPEN3D_HOST_DEVICE buf_index_t - operator()(const thrust::pair& x) const { + operator()(const stdgpu::pair& x) const { return x.second; } }; diff --git a/cpp/open3d/core/hashmap/DeviceHashBackend.cpp b/cpp/open3d/core/hashmap/DeviceHashBackend.cpp index 69083d0820e..26242ad5165 100644 --- a/cpp/open3d/core/hashmap/DeviceHashBackend.cpp +++ b/cpp/open3d/core/hashmap/DeviceHashBackend.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/hashmap/DeviceHashBackend.h b/cpp/open3d/core/hashmap/DeviceHashBackend.h index b4cef7d635f..676b970fb48 100644 --- a/cpp/open3d/core/hashmap/DeviceHashBackend.h +++ b/cpp/open3d/core/hashmap/DeviceHashBackend.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/hashmap/Dispatch.h b/cpp/open3d/core/hashmap/Dispatch.h index df0cb1238ac..7318e5898d6 100644 --- a/cpp/open3d/core/hashmap/Dispatch.h +++ b/cpp/open3d/core/hashmap/Dispatch.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/hashmap/HashBackendBuffer.cpp b/cpp/open3d/core/hashmap/HashBackendBuffer.cpp index 315ece8bbc0..48a08c7342d 100644 --- a/cpp/open3d/core/hashmap/HashBackendBuffer.cpp +++ b/cpp/open3d/core/hashmap/HashBackendBuffer.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/hashmap/HashBackendBuffer.h b/cpp/open3d/core/hashmap/HashBackendBuffer.h index 0ffc21a725f..a9ab147f414 100644 --- a/cpp/open3d/core/hashmap/HashBackendBuffer.h +++ b/cpp/open3d/core/hashmap/HashBackendBuffer.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/hashmap/HashMap.cpp b/cpp/open3d/core/hashmap/HashMap.cpp index 6e0d450ba7f..485d2d5b770 100644 --- a/cpp/open3d/core/hashmap/HashMap.cpp +++ b/cpp/open3d/core/hashmap/HashMap.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/hashmap/HashMap.h b/cpp/open3d/core/hashmap/HashMap.h index a3d4cbb56b1..8544ed623f8 100644 --- a/cpp/open3d/core/hashmap/HashMap.h +++ b/cpp/open3d/core/hashmap/HashMap.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/hashmap/HashSet.cpp b/cpp/open3d/core/hashmap/HashSet.cpp index a01d2fd1bbb..1bc0ddc6dee 100644 --- a/cpp/open3d/core/hashmap/HashSet.cpp +++ b/cpp/open3d/core/hashmap/HashSet.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/hashmap/HashSet.h b/cpp/open3d/core/hashmap/HashSet.h index 75aaac5fe16..97a8dc25e4e 100644 --- a/cpp/open3d/core/hashmap/HashSet.h +++ b/cpp/open3d/core/hashmap/HashSet.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/Arange.cpp b/cpp/open3d/core/kernel/Arange.cpp index 5d4b52b6810..b3385a2a10c 100644 --- a/cpp/open3d/core/kernel/Arange.cpp +++ b/cpp/open3d/core/kernel/Arange.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/Arange.h b/cpp/open3d/core/kernel/Arange.h index 0d18170d03a..1a0e88323fd 100644 --- a/cpp/open3d/core/kernel/Arange.h +++ b/cpp/open3d/core/kernel/Arange.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/ArangeCPU.cpp b/cpp/open3d/core/kernel/ArangeCPU.cpp index 70efd7753a1..d88076d1a74 100644 --- a/cpp/open3d/core/kernel/ArangeCPU.cpp +++ b/cpp/open3d/core/kernel/ArangeCPU.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/ArangeCUDA.cu b/cpp/open3d/core/kernel/ArangeCUDA.cu index a5193b292f9..2de6c835ae9 100644 --- a/cpp/open3d/core/kernel/ArangeCUDA.cu +++ b/cpp/open3d/core/kernel/ArangeCUDA.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/BinaryEW.cpp b/cpp/open3d/core/kernel/BinaryEW.cpp index 97856e67401..00eb9b388e5 100644 --- a/cpp/open3d/core/kernel/BinaryEW.cpp +++ b/cpp/open3d/core/kernel/BinaryEW.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/BinaryEW.h b/cpp/open3d/core/kernel/BinaryEW.h index ed23e8376c8..fbd4af3e849 100644 --- a/cpp/open3d/core/kernel/BinaryEW.h +++ b/cpp/open3d/core/kernel/BinaryEW.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/BinaryEWCPU.cpp b/cpp/open3d/core/kernel/BinaryEWCPU.cpp index 02139bfa6dd..29077856ac8 100644 --- a/cpp/open3d/core/kernel/BinaryEWCPU.cpp +++ b/cpp/open3d/core/kernel/BinaryEWCPU.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/BinaryEWCPU.ispc b/cpp/open3d/core/kernel/BinaryEWCPU.ispc index 8c81c28a838..0ea895e2dbc 100644 --- a/cpp/open3d/core/kernel/BinaryEWCPU.ispc +++ b/cpp/open3d/core/kernel/BinaryEWCPU.ispc @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/BinaryEWCUDA.cu b/cpp/open3d/core/kernel/BinaryEWCUDA.cu index 9a450789625..7985696cc9e 100644 --- a/cpp/open3d/core/kernel/BinaryEWCUDA.cu +++ b/cpp/open3d/core/kernel/BinaryEWCUDA.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/IndexGetSet.cpp b/cpp/open3d/core/kernel/IndexGetSet.cpp index 26ec6a62072..601b4d73f64 100644 --- a/cpp/open3d/core/kernel/IndexGetSet.cpp +++ b/cpp/open3d/core/kernel/IndexGetSet.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/IndexGetSet.h b/cpp/open3d/core/kernel/IndexGetSet.h index 94e57de1cae..130b80836a9 100644 --- a/cpp/open3d/core/kernel/IndexGetSet.h +++ b/cpp/open3d/core/kernel/IndexGetSet.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/IndexGetSetCPU.cpp b/cpp/open3d/core/kernel/IndexGetSetCPU.cpp index ab9a26ad763..4d76128c9dc 100644 --- a/cpp/open3d/core/kernel/IndexGetSetCPU.cpp +++ b/cpp/open3d/core/kernel/IndexGetSetCPU.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/IndexGetSetCUDA.cu b/cpp/open3d/core/kernel/IndexGetSetCUDA.cu index a2a5fb6796e..149dbd34675 100644 --- a/cpp/open3d/core/kernel/IndexGetSetCUDA.cu +++ b/cpp/open3d/core/kernel/IndexGetSetCUDA.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/IndexReduction.cpp b/cpp/open3d/core/kernel/IndexReduction.cpp index 128da56e370..19265d36620 100644 --- a/cpp/open3d/core/kernel/IndexReduction.cpp +++ b/cpp/open3d/core/kernel/IndexReduction.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/IndexReduction.h b/cpp/open3d/core/kernel/IndexReduction.h index 7035b53210b..f4fd3516b41 100644 --- a/cpp/open3d/core/kernel/IndexReduction.h +++ b/cpp/open3d/core/kernel/IndexReduction.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/IndexReductionCPU.cpp b/cpp/open3d/core/kernel/IndexReductionCPU.cpp index 4488b3bb6a8..bfc670d5101 100644 --- a/cpp/open3d/core/kernel/IndexReductionCPU.cpp +++ b/cpp/open3d/core/kernel/IndexReductionCPU.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/IndexReductionCUDA.cu b/cpp/open3d/core/kernel/IndexReductionCUDA.cu index 922bd0a84c9..60c3ff7b598 100644 --- a/cpp/open3d/core/kernel/IndexReductionCUDA.cu +++ b/cpp/open3d/core/kernel/IndexReductionCUDA.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- #include diff --git a/cpp/open3d/core/kernel/Kernel.cpp b/cpp/open3d/core/kernel/Kernel.cpp index 015170e2993..249af3a3d10 100644 --- a/cpp/open3d/core/kernel/Kernel.cpp +++ b/cpp/open3d/core/kernel/Kernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/Kernel.h b/cpp/open3d/core/kernel/Kernel.h index 51249d741c1..16a12a3ea7f 100644 --- a/cpp/open3d/core/kernel/Kernel.h +++ b/cpp/open3d/core/kernel/Kernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/NonZero.cpp b/cpp/open3d/core/kernel/NonZero.cpp index 1a25c85ce77..6d04f94e40a 100644 --- a/cpp/open3d/core/kernel/NonZero.cpp +++ b/cpp/open3d/core/kernel/NonZero.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/NonZero.h b/cpp/open3d/core/kernel/NonZero.h index 8e0040c5089..ab926ddd8c3 100644 --- a/cpp/open3d/core/kernel/NonZero.h +++ b/cpp/open3d/core/kernel/NonZero.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/NonZeroCPU.cpp b/cpp/open3d/core/kernel/NonZeroCPU.cpp index 4bea5919154..c865386d920 100644 --- a/cpp/open3d/core/kernel/NonZeroCPU.cpp +++ b/cpp/open3d/core/kernel/NonZeroCPU.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/NonZeroCUDA.cu b/cpp/open3d/core/kernel/NonZeroCUDA.cu index 5b2fb595935..e0cdbcd799e 100644 --- a/cpp/open3d/core/kernel/NonZeroCUDA.cu +++ b/cpp/open3d/core/kernel/NonZeroCUDA.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/Reduction.cpp b/cpp/open3d/core/kernel/Reduction.cpp index bf252ce715f..a94087d609a 100644 --- a/cpp/open3d/core/kernel/Reduction.cpp +++ b/cpp/open3d/core/kernel/Reduction.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/Reduction.h b/cpp/open3d/core/kernel/Reduction.h index 683770fa0cd..a1a4b74e3a3 100644 --- a/cpp/open3d/core/kernel/Reduction.h +++ b/cpp/open3d/core/kernel/Reduction.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/ReductionCPU.cpp b/cpp/open3d/core/kernel/ReductionCPU.cpp index 7caa60b34f7..428f655c21a 100644 --- a/cpp/open3d/core/kernel/ReductionCPU.cpp +++ b/cpp/open3d/core/kernel/ReductionCPU.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -122,13 +122,14 @@ class CPUReductionEngine { for (int64_t thread_idx = 0; thread_idx < num_threads; ++thread_idx) { int64_t start = thread_idx * workload_per_thread; int64_t end = std::min(start + workload_per_thread, num_workloads); + scalar_t local_result = identity; for (int64_t workload_idx = start; workload_idx < end; ++workload_idx) { scalar_t* src = reinterpret_cast( indexer.GetInputPtr(0, workload_idx)); - thread_results[thread_idx] = - element_kernel(*src, thread_results[thread_idx]); + local_result = element_kernel(*src, local_result); } + thread_results[thread_idx] = local_result; } scalar_t* dst = reinterpret_cast(indexer.GetOutputPtr(0)); for (int64_t thread_idx = 0; thread_idx < num_threads; ++thread_idx) { @@ -190,14 +191,25 @@ class CPUArgReductionEngine { // elements. We need to keep track of the indices within each // sub-iteration. int64_t num_output_elements = indexer_.NumOutputElements(); + if (num_output_elements <= 1) { + LaunchArgReductionKernelTwoPass(indexer_, reduce_func, identity); + } else { + LaunchArgReductionParallelDim(indexer_, reduce_func, identity); + } + } + template + static void LaunchArgReductionParallelDim(const Indexer& indexer, + func_t reduce_func, + scalar_t identity) { + int64_t num_output_elements = indexer.NumOutputElements(); #pragma omp parallel for schedule(static) \ num_threads(utility::EstimateMaxThreads()) for (int64_t output_idx = 0; output_idx < num_output_elements; output_idx++) { // sub_indexer.NumWorkloads() == ipo. - // sub_indexer's workload_idx is indexer_'s ipo_idx. - Indexer sub_indexer = indexer_.GetPerOutputIndexer(output_idx); + // sub_indexer's workload_idx is indexer's ipo_idx. + Indexer sub_indexer = indexer.GetPerOutputIndexer(output_idx); scalar_t dst_val = identity; for (int64_t workload_idx = 0; workload_idx < sub_indexer.NumWorkloads(); workload_idx++) { @@ -212,6 +224,52 @@ class CPUArgReductionEngine { } } + /// Create num_threads workers to compute partial arg reductions + /// and then reduce to the final results. + /// This only applies to arg reduction op with one output. + template + static void LaunchArgReductionKernelTwoPass(const Indexer& indexer, + func_t reduce_func, + scalar_t identity) { + if (indexer.NumOutputElements() > 1) { + utility::LogError( + "Internal error: two-pass arg reduction only works for " + "single-output arg reduction ops."); + } + int64_t num_workloads = indexer.NumWorkloads(); + int64_t num_threads = utility::EstimateMaxThreads(); + int64_t workload_per_thread = + (num_workloads + num_threads - 1) / num_threads; + std::vector thread_results_idx(num_threads, 0); + std::vector thread_results_val(num_threads, identity); + +#pragma omp parallel for schedule(static) \ + num_threads(utility::EstimateMaxThreads()) + for (int64_t thread_idx = 0; thread_idx < num_threads; ++thread_idx) { + int64_t start = thread_idx * workload_per_thread; + int64_t end = std::min(start + workload_per_thread, num_workloads); + scalar_t local_result_val = identity; + int64_t local_result_idx = 0; + for (int64_t workload_idx = start; workload_idx < end; + ++workload_idx) { + int64_t src_idx = workload_idx; + scalar_t* src_val = reinterpret_cast( + indexer.GetInputPtr(0, workload_idx)); + std::tie(local_result_idx, local_result_val) = reduce_func( + src_idx, *src_val, local_result_idx, local_result_val); + } + thread_results_val[thread_idx] = local_result_val; + thread_results_idx[thread_idx] = local_result_idx; + } + scalar_t dst_val = identity; + int64_t* dst_idx = reinterpret_cast(indexer.GetOutputPtr(0)); + for (int64_t thread_idx = 0; thread_idx < num_threads; ++thread_idx) { + std::tie(*dst_idx, dst_val) = reduce_func( + thread_results_idx[thread_idx], + thread_results_val[thread_idx], *dst_idx, dst_val); + } + } + private: Indexer indexer_; }; diff --git a/cpp/open3d/core/kernel/ReductionCUDA.cu b/cpp/open3d/core/kernel/ReductionCUDA.cu index f209b4448d9..5f15f676d18 100644 --- a/cpp/open3d/core/kernel/ReductionCUDA.cu +++ b/cpp/open3d/core/kernel/ReductionCUDA.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/UnaryEW.cpp b/cpp/open3d/core/kernel/UnaryEW.cpp index 87b99a268aa..911b2885e34 100644 --- a/cpp/open3d/core/kernel/UnaryEW.cpp +++ b/cpp/open3d/core/kernel/UnaryEW.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/UnaryEW.h b/cpp/open3d/core/kernel/UnaryEW.h index 985eba0232a..907b3371167 100644 --- a/cpp/open3d/core/kernel/UnaryEW.h +++ b/cpp/open3d/core/kernel/UnaryEW.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/UnaryEWCPU.cpp b/cpp/open3d/core/kernel/UnaryEWCPU.cpp index de3a3f4514e..1a502e42a1d 100644 --- a/cpp/open3d/core/kernel/UnaryEWCPU.cpp +++ b/cpp/open3d/core/kernel/UnaryEWCPU.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/UnaryEWCPU.ispc b/cpp/open3d/core/kernel/UnaryEWCPU.ispc index 40ebd9515e5..a7019efad70 100644 --- a/cpp/open3d/core/kernel/UnaryEWCPU.ispc +++ b/cpp/open3d/core/kernel/UnaryEWCPU.ispc @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/UnaryEWCUDA.cu b/cpp/open3d/core/kernel/UnaryEWCUDA.cu index b7745e04ef0..1612a3d70cc 100644 --- a/cpp/open3d/core/kernel/UnaryEWCUDA.cu +++ b/cpp/open3d/core/kernel/UnaryEWCUDA.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/kernel/UnaryEWSYCL.cpp b/cpp/open3d/core/kernel/UnaryEWSYCL.cpp index e32005c4b36..fed05af7b47 100644 --- a/cpp/open3d/core/kernel/UnaryEWSYCL.cpp +++ b/cpp/open3d/core/kernel/UnaryEWSYCL.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/AddMM.cpp b/cpp/open3d/core/linalg/AddMM.cpp index 0f44ac926e3..aea908cecbb 100644 --- a/cpp/open3d/core/linalg/AddMM.cpp +++ b/cpp/open3d/core/linalg/AddMM.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/AddMM.h b/cpp/open3d/core/linalg/AddMM.h index 6d4a5dc608f..1754e430fef 100644 --- a/cpp/open3d/core/linalg/AddMM.h +++ b/cpp/open3d/core/linalg/AddMM.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/AddMMCPU.cpp b/cpp/open3d/core/linalg/AddMMCPU.cpp index c839ccd6df2..1f97049dbfe 100644 --- a/cpp/open3d/core/linalg/AddMMCPU.cpp +++ b/cpp/open3d/core/linalg/AddMMCPU.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/AddMMCUDA.cpp b/cpp/open3d/core/linalg/AddMMCUDA.cpp index 4d13857f8ab..122f8f178b1 100644 --- a/cpp/open3d/core/linalg/AddMMCUDA.cpp +++ b/cpp/open3d/core/linalg/AddMMCUDA.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/BlasWrapper.h b/cpp/open3d/core/linalg/BlasWrapper.h index 9c35fed74a5..d82363614c9 100644 --- a/cpp/open3d/core/linalg/BlasWrapper.h +++ b/cpp/open3d/core/linalg/BlasWrapper.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/Det.cpp b/cpp/open3d/core/linalg/Det.cpp index 8ca57f05fdd..a2e05344b21 100644 --- a/cpp/open3d/core/linalg/Det.cpp +++ b/cpp/open3d/core/linalg/Det.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/Det.h b/cpp/open3d/core/linalg/Det.h index fa68a25ecdb..a69e4c9166b 100644 --- a/cpp/open3d/core/linalg/Det.h +++ b/cpp/open3d/core/linalg/Det.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/Inverse.cpp b/cpp/open3d/core/linalg/Inverse.cpp index dad96c211cd..51cf7693217 100644 --- a/cpp/open3d/core/linalg/Inverse.cpp +++ b/cpp/open3d/core/linalg/Inverse.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/Inverse.h b/cpp/open3d/core/linalg/Inverse.h index 6c3d63817e9..8809f8f176c 100644 --- a/cpp/open3d/core/linalg/Inverse.h +++ b/cpp/open3d/core/linalg/Inverse.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/InverseCPU.cpp b/cpp/open3d/core/linalg/InverseCPU.cpp index d69c49f353e..bcedaf75d3e 100644 --- a/cpp/open3d/core/linalg/InverseCPU.cpp +++ b/cpp/open3d/core/linalg/InverseCPU.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/InverseCUDA.cpp b/cpp/open3d/core/linalg/InverseCUDA.cpp index 3fdfba452c5..dca871c9bc3 100644 --- a/cpp/open3d/core/linalg/InverseCUDA.cpp +++ b/cpp/open3d/core/linalg/InverseCUDA.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/LU.cpp b/cpp/open3d/core/linalg/LU.cpp index 85de3e2fb48..5bfafdac425 100644 --- a/cpp/open3d/core/linalg/LU.cpp +++ b/cpp/open3d/core/linalg/LU.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/LU.h b/cpp/open3d/core/linalg/LU.h index bf17f7befc7..d7c1f054954 100644 --- a/cpp/open3d/core/linalg/LU.h +++ b/cpp/open3d/core/linalg/LU.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/LUCPU.cpp b/cpp/open3d/core/linalg/LUCPU.cpp index 4026fde7ed4..5ea4ba63fdd 100644 --- a/cpp/open3d/core/linalg/LUCPU.cpp +++ b/cpp/open3d/core/linalg/LUCPU.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/LUCUDA.cpp b/cpp/open3d/core/linalg/LUCUDA.cpp index 4cac8097152..6a5f9f89544 100644 --- a/cpp/open3d/core/linalg/LUCUDA.cpp +++ b/cpp/open3d/core/linalg/LUCUDA.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/LUImpl.h b/cpp/open3d/core/linalg/LUImpl.h index 3edd3ae905c..36898fa3de9 100644 --- a/cpp/open3d/core/linalg/LUImpl.h +++ b/cpp/open3d/core/linalg/LUImpl.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/LapackWrapper.h b/cpp/open3d/core/linalg/LapackWrapper.h index f49cfbf9d10..a27a69cf8ee 100644 --- a/cpp/open3d/core/linalg/LapackWrapper.h +++ b/cpp/open3d/core/linalg/LapackWrapper.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/LeastSquares.cpp b/cpp/open3d/core/linalg/LeastSquares.cpp index 5eac4cd6ae2..6340331c5ce 100644 --- a/cpp/open3d/core/linalg/LeastSquares.cpp +++ b/cpp/open3d/core/linalg/LeastSquares.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/LeastSquares.h b/cpp/open3d/core/linalg/LeastSquares.h index 79ca7aeef59..c2e79935f5d 100644 --- a/cpp/open3d/core/linalg/LeastSquares.h +++ b/cpp/open3d/core/linalg/LeastSquares.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/LeastSquaresCPU.cpp b/cpp/open3d/core/linalg/LeastSquaresCPU.cpp index 83418947d77..96e85da2f21 100644 --- a/cpp/open3d/core/linalg/LeastSquaresCPU.cpp +++ b/cpp/open3d/core/linalg/LeastSquaresCPU.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/LeastSquaresCUDA.cpp b/cpp/open3d/core/linalg/LeastSquaresCUDA.cpp index ca9b8ab0dca..82f59ec2c34 100644 --- a/cpp/open3d/core/linalg/LeastSquaresCUDA.cpp +++ b/cpp/open3d/core/linalg/LeastSquaresCUDA.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/LinalgHeadersCPU.h b/cpp/open3d/core/linalg/LinalgHeadersCPU.h index 5a72c2ae531..3f94a9ae274 100644 --- a/cpp/open3d/core/linalg/LinalgHeadersCPU.h +++ b/cpp/open3d/core/linalg/LinalgHeadersCPU.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/LinalgHeadersCUDA.h b/cpp/open3d/core/linalg/LinalgHeadersCUDA.h index cf1b8d635ba..2cef17c1758 100644 --- a/cpp/open3d/core/linalg/LinalgHeadersCUDA.h +++ b/cpp/open3d/core/linalg/LinalgHeadersCUDA.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/LinalgUtils.cpp b/cpp/open3d/core/linalg/LinalgUtils.cpp index 12d061664aa..723abeca704 100644 --- a/cpp/open3d/core/linalg/LinalgUtils.cpp +++ b/cpp/open3d/core/linalg/LinalgUtils.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/LinalgUtils.h b/cpp/open3d/core/linalg/LinalgUtils.h index 5eaae8cfa65..4435faced72 100644 --- a/cpp/open3d/core/linalg/LinalgUtils.h +++ b/cpp/open3d/core/linalg/LinalgUtils.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/Matmul.cpp b/cpp/open3d/core/linalg/Matmul.cpp index 41cb2c4dae2..1b616c5f335 100644 --- a/cpp/open3d/core/linalg/Matmul.cpp +++ b/cpp/open3d/core/linalg/Matmul.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/Matmul.h b/cpp/open3d/core/linalg/Matmul.h index 724db1bcc84..da29240b0c4 100644 --- a/cpp/open3d/core/linalg/Matmul.h +++ b/cpp/open3d/core/linalg/Matmul.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/MatmulCPU.cpp b/cpp/open3d/core/linalg/MatmulCPU.cpp index 209683d338f..2757d29a63d 100644 --- a/cpp/open3d/core/linalg/MatmulCPU.cpp +++ b/cpp/open3d/core/linalg/MatmulCPU.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/MatmulCUDA.cpp b/cpp/open3d/core/linalg/MatmulCUDA.cpp index 0982bf57cec..f5a517ef4bd 100644 --- a/cpp/open3d/core/linalg/MatmulCUDA.cpp +++ b/cpp/open3d/core/linalg/MatmulCUDA.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/SVD.cpp b/cpp/open3d/core/linalg/SVD.cpp index 757a138d416..935d014ef4e 100644 --- a/cpp/open3d/core/linalg/SVD.cpp +++ b/cpp/open3d/core/linalg/SVD.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/SVD.h b/cpp/open3d/core/linalg/SVD.h index caf83ed6481..9e6deefa6c1 100644 --- a/cpp/open3d/core/linalg/SVD.h +++ b/cpp/open3d/core/linalg/SVD.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/SVDCPU.cpp b/cpp/open3d/core/linalg/SVDCPU.cpp index 682ea9e08cf..4803e1ee576 100644 --- a/cpp/open3d/core/linalg/SVDCPU.cpp +++ b/cpp/open3d/core/linalg/SVDCPU.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/SVDCUDA.cpp b/cpp/open3d/core/linalg/SVDCUDA.cpp index a811090bffb..a7acbf07b99 100644 --- a/cpp/open3d/core/linalg/SVDCUDA.cpp +++ b/cpp/open3d/core/linalg/SVDCUDA.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/Solve.cpp b/cpp/open3d/core/linalg/Solve.cpp index 9956bddf5f0..f1025520fac 100644 --- a/cpp/open3d/core/linalg/Solve.cpp +++ b/cpp/open3d/core/linalg/Solve.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/Solve.h b/cpp/open3d/core/linalg/Solve.h index 49d73d3179f..485de7ef0f2 100644 --- a/cpp/open3d/core/linalg/Solve.h +++ b/cpp/open3d/core/linalg/Solve.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/SolveCPU.cpp b/cpp/open3d/core/linalg/SolveCPU.cpp index 08452a17ea9..05a589e1072 100644 --- a/cpp/open3d/core/linalg/SolveCPU.cpp +++ b/cpp/open3d/core/linalg/SolveCPU.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/SolveCUDA.cpp b/cpp/open3d/core/linalg/SolveCUDA.cpp index cc1f28dcdd3..1e2c656103b 100644 --- a/cpp/open3d/core/linalg/SolveCUDA.cpp +++ b/cpp/open3d/core/linalg/SolveCUDA.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/Tri.cpp b/cpp/open3d/core/linalg/Tri.cpp index 1852ac01606..77e72b076a2 100644 --- a/cpp/open3d/core/linalg/Tri.cpp +++ b/cpp/open3d/core/linalg/Tri.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/Tri.h b/cpp/open3d/core/linalg/Tri.h index 280ab3bb174..cafb41fb046 100644 --- a/cpp/open3d/core/linalg/Tri.h +++ b/cpp/open3d/core/linalg/Tri.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/TriCPU.cpp b/cpp/open3d/core/linalg/TriCPU.cpp index 1962b3010cf..1bbb10a9fdf 100644 --- a/cpp/open3d/core/linalg/TriCPU.cpp +++ b/cpp/open3d/core/linalg/TriCPU.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/TriCUDA.cu b/cpp/open3d/core/linalg/TriCUDA.cu index 333d640c8f2..20407d8d7c5 100644 --- a/cpp/open3d/core/linalg/TriCUDA.cu +++ b/cpp/open3d/core/linalg/TriCUDA.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/TriImpl.h b/cpp/open3d/core/linalg/TriImpl.h index 5219ddfe8eb..441d9c69c93 100644 --- a/cpp/open3d/core/linalg/TriImpl.h +++ b/cpp/open3d/core/linalg/TriImpl.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/kernel/Matrix.h b/cpp/open3d/core/linalg/kernel/Matrix.h index 9ebe2d341b9..2968f69bc84 100644 --- a/cpp/open3d/core/linalg/kernel/Matrix.h +++ b/cpp/open3d/core/linalg/kernel/Matrix.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/linalg/kernel/SVD3x3.h b/cpp/open3d/core/linalg/kernel/SVD3x3.h index e591e6a6920..84965343ffd 100644 --- a/cpp/open3d/core/linalg/kernel/SVD3x3.h +++ b/cpp/open3d/core/linalg/kernel/SVD3x3.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- /************************************************************************** diff --git a/cpp/open3d/core/nns/FixedRadiusIndex.cpp b/cpp/open3d/core/nns/FixedRadiusIndex.cpp index 1faba40060c..fb50820bb70 100644 --- a/cpp/open3d/core/nns/FixedRadiusIndex.cpp +++ b/cpp/open3d/core/nns/FixedRadiusIndex.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/nns/FixedRadiusIndex.h b/cpp/open3d/core/nns/FixedRadiusIndex.h index 47929950023..838c1ccc484 100644 --- a/cpp/open3d/core/nns/FixedRadiusIndex.h +++ b/cpp/open3d/core/nns/FixedRadiusIndex.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/nns/FixedRadiusSearchImpl.cuh b/cpp/open3d/core/nns/FixedRadiusSearchImpl.cuh index 42a7ff3c9b2..c4eb31c8532 100644 --- a/cpp/open3d/core/nns/FixedRadiusSearchImpl.cuh +++ b/cpp/open3d/core/nns/FixedRadiusSearchImpl.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- #pragma once diff --git a/cpp/open3d/core/nns/FixedRadiusSearchImpl.h b/cpp/open3d/core/nns/FixedRadiusSearchImpl.h index be8cfd32012..ae65f493637 100644 --- a/cpp/open3d/core/nns/FixedRadiusSearchImpl.h +++ b/cpp/open3d/core/nns/FixedRadiusSearchImpl.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/nns/FixedRadiusSearchOps.cpp b/cpp/open3d/core/nns/FixedRadiusSearchOps.cpp index 789690dd098..7a9dc4b4077 100644 --- a/cpp/open3d/core/nns/FixedRadiusSearchOps.cpp +++ b/cpp/open3d/core/nns/FixedRadiusSearchOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/core/nns/FixedRadiusSearchOps.cu b/cpp/open3d/core/nns/FixedRadiusSearchOps.cu index 6e93c03cd0a..6f2a7e1df9e 100644 --- a/cpp/open3d/core/nns/FixedRadiusSearchOps.cu +++ b/cpp/open3d/core/nns/FixedRadiusSearchOps.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/core/nns/KnnIndex.cpp b/cpp/open3d/core/nns/KnnIndex.cpp index 4266f57449a..fc68f6dbe54 100644 --- a/cpp/open3d/core/nns/KnnIndex.cpp +++ b/cpp/open3d/core/nns/KnnIndex.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/nns/KnnIndex.h b/cpp/open3d/core/nns/KnnIndex.h index e5f5e3baf7c..458a3dd0b35 100644 --- a/cpp/open3d/core/nns/KnnIndex.h +++ b/cpp/open3d/core/nns/KnnIndex.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/nns/KnnSearchImpl.cuh b/cpp/open3d/core/nns/KnnSearchImpl.cuh index 2ab909f804e..2f1e8f653c7 100644 --- a/cpp/open3d/core/nns/KnnSearchImpl.cuh +++ b/cpp/open3d/core/nns/KnnSearchImpl.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/nns/KnnSearchOps.cu b/cpp/open3d/core/nns/KnnSearchOps.cu index 2b20a8852cd..8fbaf466b5c 100644 --- a/cpp/open3d/core/nns/KnnSearchOps.cu +++ b/cpp/open3d/core/nns/KnnSearchOps.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/nns/MemoryAllocation.h b/cpp/open3d/core/nns/MemoryAllocation.h index 64c7d879178..78c8d7ebbd2 100644 --- a/cpp/open3d/core/nns/MemoryAllocation.h +++ b/cpp/open3d/core/nns/MemoryAllocation.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/nns/NNSIndex.cpp b/cpp/open3d/core/nns/NNSIndex.cpp index 3300d7686d5..f9c41535f81 100644 --- a/cpp/open3d/core/nns/NNSIndex.cpp +++ b/cpp/open3d/core/nns/NNSIndex.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/nns/NNSIndex.h b/cpp/open3d/core/nns/NNSIndex.h index 8eb8160da5d..ac07638b145 100644 --- a/cpp/open3d/core/nns/NNSIndex.h +++ b/cpp/open3d/core/nns/NNSIndex.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/nns/NanoFlannImpl.h b/cpp/open3d/core/nns/NanoFlannImpl.h index 027d6d0c4ee..c9491da8377 100644 --- a/cpp/open3d/core/nns/NanoFlannImpl.h +++ b/cpp/open3d/core/nns/NanoFlannImpl.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- #pragma once @@ -118,13 +118,6 @@ void _KnnSearchCPU(NanoFlannIndexHolderBase *holder, return; } - auto points_equal = [](const T *const p1, const T *const p2, - size_t dimension) { - std::vector p1_vec(p1, p1 + dimension); - std::vector p2_vec(p2, p2 + dimension); - return p1_vec == p2_vec; - }; - std::vector> neighbors_indices(num_queries); std::vector> neighbors_distances(num_queries); std::vector neighbors_count(num_queries, 0); @@ -147,8 +140,9 @@ void _KnnSearchCPU(NanoFlannIndexHolderBase *holder, for (size_t valid_i = 0; valid_i < num_valid; ++valid_i) { TIndex idx = result_indices[valid_i]; if (ignore_query_point && - points_equal(&queries[i * dimension], - &points[idx * dimension], dimension)) { + std::equal(&queries[i * dimension], + &queries[i * dimension] + dimension, + &points[idx * dimension])) { continue; } neighbors_indices[i].push_back(idx); @@ -222,13 +216,6 @@ void _RadiusSearchCPU(NanoFlannIndexHolderBase *holder, return; } - auto points_equal = [](const T *const p1, const T *const p2, - size_t dimension) { - std::vector p1_vec(p1, p1 + dimension); - std::vector p2_vec(p2, p2 + dimension); - return p1_vec == p2_vec; - }; - std::vector> neighbors_indices(num_queries); std::vector> neighbors_distances(num_queries); std::vector neighbors_count(num_queries, 0); @@ -255,9 +242,9 @@ void _RadiusSearchCPU(NanoFlannIndexHolderBase *holder, int num_neighbors = 0; for (const auto &idx_dist : search_result) { if (ignore_query_point && - points_equal(&queries[i * dimension], - &points[idx_dist.first * dimension], - dimension)) { + std::equal(&queries[i * dimension], + &queries[i * dimension] + dimension, + &points[idx_dist.first * dimension])) { continue; } neighbors_indices[i].push_back(idx_dist.first); diff --git a/cpp/open3d/core/nns/NanoFlannIndex.cpp b/cpp/open3d/core/nns/NanoFlannIndex.cpp index 4be2aa189eb..b4d39299a7f 100644 --- a/cpp/open3d/core/nns/NanoFlannIndex.cpp +++ b/cpp/open3d/core/nns/NanoFlannIndex.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/nns/NanoFlannIndex.h b/cpp/open3d/core/nns/NanoFlannIndex.h index e092099d46e..ec2be8a3ca1 100644 --- a/cpp/open3d/core/nns/NanoFlannIndex.h +++ b/cpp/open3d/core/nns/NanoFlannIndex.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/nns/NearestNeighborSearch.cpp b/cpp/open3d/core/nns/NearestNeighborSearch.cpp index 3a7c3122162..ebf38ec05b3 100644 --- a/cpp/open3d/core/nns/NearestNeighborSearch.cpp +++ b/cpp/open3d/core/nns/NearestNeighborSearch.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/nns/NearestNeighborSearch.h b/cpp/open3d/core/nns/NearestNeighborSearch.h index 7ce92811dd9..98898cdd7b2 100644 --- a/cpp/open3d/core/nns/NearestNeighborSearch.h +++ b/cpp/open3d/core/nns/NearestNeighborSearch.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/nns/NeighborSearchAllocator.h b/cpp/open3d/core/nns/NeighborSearchAllocator.h index 1845282151f..c0e66e2acf5 100644 --- a/cpp/open3d/core/nns/NeighborSearchAllocator.h +++ b/cpp/open3d/core/nns/NeighborSearchAllocator.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/nns/NeighborSearchCommon.h b/cpp/open3d/core/nns/NeighborSearchCommon.h index 0a010dc6eaa..97ffb810ffb 100644 --- a/cpp/open3d/core/nns/NeighborSearchCommon.h +++ b/cpp/open3d/core/nns/NeighborSearchCommon.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/core/nns/kernel/BlockMerge.cuh b/cpp/open3d/core/nns/kernel/BlockMerge.cuh index 870d87847c8..07e1bd40727 100644 --- a/cpp/open3d/core/nns/kernel/BlockMerge.cuh +++ b/cpp/open3d/core/nns/kernel/BlockMerge.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // MIT License diff --git a/cpp/open3d/core/nns/kernel/BlockSelect.cuh b/cpp/open3d/core/nns/kernel/BlockSelect.cuh index d54ebd0e5f5..c369854578a 100644 --- a/cpp/open3d/core/nns/kernel/BlockSelect.cuh +++ b/cpp/open3d/core/nns/kernel/BlockSelect.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // MIT License diff --git a/cpp/open3d/core/nns/kernel/BlockSelectFloat32.cu b/cpp/open3d/core/nns/kernel/BlockSelectFloat32.cu index 8b56f0a7ed7..4bd77af5423 100644 --- a/cpp/open3d/core/nns/kernel/BlockSelectFloat32.cu +++ b/cpp/open3d/core/nns/kernel/BlockSelectFloat32.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // MIT License diff --git a/cpp/open3d/core/nns/kernel/BlockSelectFloat64.cu b/cpp/open3d/core/nns/kernel/BlockSelectFloat64.cu index fd181c4645d..d23d1a3a488 100644 --- a/cpp/open3d/core/nns/kernel/BlockSelectFloat64.cu +++ b/cpp/open3d/core/nns/kernel/BlockSelectFloat64.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // MIT License diff --git a/cpp/open3d/core/nns/kernel/BlockSelectImpl.cuh b/cpp/open3d/core/nns/kernel/BlockSelectImpl.cuh index efc35f9d9d7..dae57ae99d9 100644 --- a/cpp/open3d/core/nns/kernel/BlockSelectImpl.cuh +++ b/cpp/open3d/core/nns/kernel/BlockSelectImpl.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // MIT License diff --git a/cpp/open3d/core/nns/kernel/DeviceDefs.cuh b/cpp/open3d/core/nns/kernel/DeviceDefs.cuh index 89ef8f228e4..85b67c436ea 100644 --- a/cpp/open3d/core/nns/kernel/DeviceDefs.cuh +++ b/cpp/open3d/core/nns/kernel/DeviceDefs.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // MIT License diff --git a/cpp/open3d/core/nns/kernel/DistancesUtils.cuh b/cpp/open3d/core/nns/kernel/DistancesUtils.cuh index 62f08005a1d..9a297d70324 100644 --- a/cpp/open3d/core/nns/kernel/DistancesUtils.cuh +++ b/cpp/open3d/core/nns/kernel/DistancesUtils.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // MIT License diff --git a/cpp/open3d/core/nns/kernel/L2Select.cuh b/cpp/open3d/core/nns/kernel/L2Select.cuh index 3abd83cfe39..61c37bd0b37 100644 --- a/cpp/open3d/core/nns/kernel/L2Select.cuh +++ b/cpp/open3d/core/nns/kernel/L2Select.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // MIT License diff --git a/cpp/open3d/core/nns/kernel/Limits.cuh b/cpp/open3d/core/nns/kernel/Limits.cuh index 70b22d75d67..bad35dee8ae 100644 --- a/cpp/open3d/core/nns/kernel/Limits.cuh +++ b/cpp/open3d/core/nns/kernel/Limits.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // MIT License diff --git a/cpp/open3d/core/nns/kernel/MergeNetwork.cuh b/cpp/open3d/core/nns/kernel/MergeNetwork.cuh index 5fcc5321959..5306eb7dc33 100644 --- a/cpp/open3d/core/nns/kernel/MergeNetwork.cuh +++ b/cpp/open3d/core/nns/kernel/MergeNetwork.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // MIT License diff --git a/cpp/open3d/core/nns/kernel/Pair.cuh b/cpp/open3d/core/nns/kernel/Pair.cuh index 026cbcdec44..15928ba6eae 100644 --- a/cpp/open3d/core/nns/kernel/Pair.cuh +++ b/cpp/open3d/core/nns/kernel/Pair.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // MIT License diff --git a/cpp/open3d/core/nns/kernel/PtxUtils.cuh b/cpp/open3d/core/nns/kernel/PtxUtils.cuh index a23bc194f40..8c497b4c2ba 100644 --- a/cpp/open3d/core/nns/kernel/PtxUtils.cuh +++ b/cpp/open3d/core/nns/kernel/PtxUtils.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // MIT License diff --git a/cpp/open3d/core/nns/kernel/Reduction.cuh b/cpp/open3d/core/nns/kernel/Reduction.cuh index 6e867f95551..a87dc0ac9bd 100644 --- a/cpp/open3d/core/nns/kernel/Reduction.cuh +++ b/cpp/open3d/core/nns/kernel/Reduction.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // MIT License diff --git a/cpp/open3d/core/nns/kernel/ReductionOps.cuh b/cpp/open3d/core/nns/kernel/ReductionOps.cuh index fee64e9a52e..da8eb4710a1 100644 --- a/cpp/open3d/core/nns/kernel/ReductionOps.cuh +++ b/cpp/open3d/core/nns/kernel/ReductionOps.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // MIT License diff --git a/cpp/open3d/core/nns/kernel/Select.cuh b/cpp/open3d/core/nns/kernel/Select.cuh index b1bc1d40758..cadfea81925 100644 --- a/cpp/open3d/core/nns/kernel/Select.cuh +++ b/cpp/open3d/core/nns/kernel/Select.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // MIT License diff --git a/cpp/open3d/core/nns/kernel/StaticUtils.cuh b/cpp/open3d/core/nns/kernel/StaticUtils.cuh index 625d740a731..f636ff9e430 100644 --- a/cpp/open3d/core/nns/kernel/StaticUtils.cuh +++ b/cpp/open3d/core/nns/kernel/StaticUtils.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // MIT License diff --git a/cpp/open3d/core/nns/kernel/WarpShuffle.cuh b/cpp/open3d/core/nns/kernel/WarpShuffle.cuh index f5b437de2a3..bce9a4a9362 100644 --- a/cpp/open3d/core/nns/kernel/WarpShuffle.cuh +++ b/cpp/open3d/core/nns/kernel/WarpShuffle.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // MIT License diff --git a/cpp/open3d/data/Dataset.cpp b/cpp/open3d/data/Dataset.cpp index 8cd568c9856..60f475958c6 100644 --- a/cpp/open3d/data/Dataset.cpp +++ b/cpp/open3d/data/Dataset.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/Dataset.h b/cpp/open3d/data/Dataset.h index 35c448d11e0..be723fd30a7 100644 --- a/cpp/open3d/data/Dataset.h +++ b/cpp/open3d/data/Dataset.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/ArmadilloMesh.cpp b/cpp/open3d/data/dataset/ArmadilloMesh.cpp index f2a73720a3a..2627515c323 100644 --- a/cpp/open3d/data/dataset/ArmadilloMesh.cpp +++ b/cpp/open3d/data/dataset/ArmadilloMesh.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/AvocadoModel.cpp b/cpp/open3d/data/dataset/AvocadoModel.cpp index 5c67cddbebd..0ea705aae63 100644 --- a/cpp/open3d/data/dataset/AvocadoModel.cpp +++ b/cpp/open3d/data/dataset/AvocadoModel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/BedroomRGBDImages.cpp b/cpp/open3d/data/dataset/BedroomRGBDImages.cpp index 053184ded91..d9c17488739 100644 --- a/cpp/open3d/data/dataset/BedroomRGBDImages.cpp +++ b/cpp/open3d/data/dataset/BedroomRGBDImages.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/BunnyMesh.cpp b/cpp/open3d/data/dataset/BunnyMesh.cpp index 0555fa9291c..ffb07cb3c2c 100644 --- a/cpp/open3d/data/dataset/BunnyMesh.cpp +++ b/cpp/open3d/data/dataset/BunnyMesh.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/CrateModel.cpp b/cpp/open3d/data/dataset/CrateModel.cpp index b99d9ac97e5..ecc1e956b9c 100644 --- a/cpp/open3d/data/dataset/CrateModel.cpp +++ b/cpp/open3d/data/dataset/CrateModel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/DamagedHelmetModel.cpp b/cpp/open3d/data/dataset/DamagedHelmetModel.cpp index b97d3e20359..b64d2a5ff3f 100644 --- a/cpp/open3d/data/dataset/DamagedHelmetModel.cpp +++ b/cpp/open3d/data/dataset/DamagedHelmetModel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/DemoColoredICPPointClouds.cpp b/cpp/open3d/data/dataset/DemoColoredICPPointClouds.cpp index b6660ae083c..49e883cde06 100644 --- a/cpp/open3d/data/dataset/DemoColoredICPPointClouds.cpp +++ b/cpp/open3d/data/dataset/DemoColoredICPPointClouds.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/DemoCropPointCloud.cpp b/cpp/open3d/data/dataset/DemoCropPointCloud.cpp index c637a0fa173..33e07e82610 100644 --- a/cpp/open3d/data/dataset/DemoCropPointCloud.cpp +++ b/cpp/open3d/data/dataset/DemoCropPointCloud.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/DemoCustomVisualization.cpp b/cpp/open3d/data/dataset/DemoCustomVisualization.cpp index e7da973324a..b7ee361a93d 100644 --- a/cpp/open3d/data/dataset/DemoCustomVisualization.cpp +++ b/cpp/open3d/data/dataset/DemoCustomVisualization.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/DemoDopplerICPSequence.cpp b/cpp/open3d/data/dataset/DemoDopplerICPSequence.cpp index f4f29a17645..172fc305b8a 100644 --- a/cpp/open3d/data/dataset/DemoDopplerICPSequence.cpp +++ b/cpp/open3d/data/dataset/DemoDopplerICPSequence.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/DemoFeatureMatchingPointClouds.cpp b/cpp/open3d/data/dataset/DemoFeatureMatchingPointClouds.cpp index f2e3aa8fbb2..4774e6bcf00 100644 --- a/cpp/open3d/data/dataset/DemoFeatureMatchingPointClouds.cpp +++ b/cpp/open3d/data/dataset/DemoFeatureMatchingPointClouds.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/DemoICPPointClouds.cpp b/cpp/open3d/data/dataset/DemoICPPointClouds.cpp index eafc71d66a3..7c18c3ef8b3 100644 --- a/cpp/open3d/data/dataset/DemoICPPointClouds.cpp +++ b/cpp/open3d/data/dataset/DemoICPPointClouds.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/DemoPoseGraphOptimization.cpp b/cpp/open3d/data/dataset/DemoPoseGraphOptimization.cpp index a570c362cae..6bb09273733 100644 --- a/cpp/open3d/data/dataset/DemoPoseGraphOptimization.cpp +++ b/cpp/open3d/data/dataset/DemoPoseGraphOptimization.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/EaglePointCloud.cpp b/cpp/open3d/data/dataset/EaglePointCloud.cpp index 0c80b82c865..35a5c51f40e 100644 --- a/cpp/open3d/data/dataset/EaglePointCloud.cpp +++ b/cpp/open3d/data/dataset/EaglePointCloud.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/FlightHelmetModel.cpp b/cpp/open3d/data/dataset/FlightHelmetModel.cpp index 94f226fc16d..ab5a104c4f9 100644 --- a/cpp/open3d/data/dataset/FlightHelmetModel.cpp +++ b/cpp/open3d/data/dataset/FlightHelmetModel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/JackJackL515Bag.cpp b/cpp/open3d/data/dataset/JackJackL515Bag.cpp index 9ba9d270a08..4dd4f8c7eac 100644 --- a/cpp/open3d/data/dataset/JackJackL515Bag.cpp +++ b/cpp/open3d/data/dataset/JackJackL515Bag.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/JuneauImage.cpp b/cpp/open3d/data/dataset/JuneauImage.cpp index 18357465a55..349d05348c1 100644 --- a/cpp/open3d/data/dataset/JuneauImage.cpp +++ b/cpp/open3d/data/dataset/JuneauImage.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/KnotMesh.cpp b/cpp/open3d/data/dataset/KnotMesh.cpp index b900b4859b6..1f9e00aa352 100644 --- a/cpp/open3d/data/dataset/KnotMesh.cpp +++ b/cpp/open3d/data/dataset/KnotMesh.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/LivingRoomPointClouds.cpp b/cpp/open3d/data/dataset/LivingRoomPointClouds.cpp index 6de432c9b20..73fab7b9699 100644 --- a/cpp/open3d/data/dataset/LivingRoomPointClouds.cpp +++ b/cpp/open3d/data/dataset/LivingRoomPointClouds.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/LoungeRGBDImages.cpp b/cpp/open3d/data/dataset/LoungeRGBDImages.cpp index d1b6a39b1a9..7f2268788b8 100644 --- a/cpp/open3d/data/dataset/LoungeRGBDImages.cpp +++ b/cpp/open3d/data/dataset/LoungeRGBDImages.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/MetalTexture.cpp b/cpp/open3d/data/dataset/MetalTexture.cpp index 0176b5b7803..b778fa003b1 100644 --- a/cpp/open3d/data/dataset/MetalTexture.cpp +++ b/cpp/open3d/data/dataset/MetalTexture.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/MonkeyModel.cpp b/cpp/open3d/data/dataset/MonkeyModel.cpp index 7685760aa4f..d39580936d0 100644 --- a/cpp/open3d/data/dataset/MonkeyModel.cpp +++ b/cpp/open3d/data/dataset/MonkeyModel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/OfficePointClouds.cpp b/cpp/open3d/data/dataset/OfficePointClouds.cpp index 45955901abf..0066f70fd59 100644 --- a/cpp/open3d/data/dataset/OfficePointClouds.cpp +++ b/cpp/open3d/data/dataset/OfficePointClouds.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/PCDPointCloud.cpp b/cpp/open3d/data/dataset/PCDPointCloud.cpp index 64e4168f933..f1495559d4f 100644 --- a/cpp/open3d/data/dataset/PCDPointCloud.cpp +++ b/cpp/open3d/data/dataset/PCDPointCloud.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/PLYPointCloud.cpp b/cpp/open3d/data/dataset/PLYPointCloud.cpp index 7d67d66a5e3..b08c2929e07 100644 --- a/cpp/open3d/data/dataset/PLYPointCloud.cpp +++ b/cpp/open3d/data/dataset/PLYPointCloud.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/PTSPointCloud.cpp b/cpp/open3d/data/dataset/PTSPointCloud.cpp index ea2e963264b..ce5b1f1ede8 100644 --- a/cpp/open3d/data/dataset/PTSPointCloud.cpp +++ b/cpp/open3d/data/dataset/PTSPointCloud.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/PaintedPlasterTexture.cpp b/cpp/open3d/data/dataset/PaintedPlasterTexture.cpp index a7ff8f3842d..2cafe5e8522 100644 --- a/cpp/open3d/data/dataset/PaintedPlasterTexture.cpp +++ b/cpp/open3d/data/dataset/PaintedPlasterTexture.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/RedwoodIndoorLivingRoom1.cpp b/cpp/open3d/data/dataset/RedwoodIndoorLivingRoom1.cpp index 54710d28c54..0ae3258355c 100644 --- a/cpp/open3d/data/dataset/RedwoodIndoorLivingRoom1.cpp +++ b/cpp/open3d/data/dataset/RedwoodIndoorLivingRoom1.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/RedwoodIndoorLivingRoom2.cpp b/cpp/open3d/data/dataset/RedwoodIndoorLivingRoom2.cpp index b9d6070c0f7..9f8e65d173f 100644 --- a/cpp/open3d/data/dataset/RedwoodIndoorLivingRoom2.cpp +++ b/cpp/open3d/data/dataset/RedwoodIndoorLivingRoom2.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/RedwoodIndoorOffice1.cpp b/cpp/open3d/data/dataset/RedwoodIndoorOffice1.cpp index 0fbfcf329d5..45a8bb32243 100644 --- a/cpp/open3d/data/dataset/RedwoodIndoorOffice1.cpp +++ b/cpp/open3d/data/dataset/RedwoodIndoorOffice1.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/RedwoodIndoorOffice2.cpp b/cpp/open3d/data/dataset/RedwoodIndoorOffice2.cpp index bdd61f9986c..b9167c48706 100644 --- a/cpp/open3d/data/dataset/RedwoodIndoorOffice2.cpp +++ b/cpp/open3d/data/dataset/RedwoodIndoorOffice2.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/SampleFountainRGBDImages.cpp b/cpp/open3d/data/dataset/SampleFountainRGBDImages.cpp index 1b4436a42d5..c65c8b1ede2 100644 --- a/cpp/open3d/data/dataset/SampleFountainRGBDImages.cpp +++ b/cpp/open3d/data/dataset/SampleFountainRGBDImages.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/SampleICPPointClouds.cpp b/cpp/open3d/data/dataset/SampleICPPointClouds.cpp index 445ce35aff2..d2e989c6f0f 100644 --- a/cpp/open3d/data/dataset/SampleICPPointClouds.cpp +++ b/cpp/open3d/data/dataset/SampleICPPointClouds.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/SampleL515Bag.cpp b/cpp/open3d/data/dataset/SampleL515Bag.cpp index bb442d329cc..c889699b746 100644 --- a/cpp/open3d/data/dataset/SampleL515Bag.cpp +++ b/cpp/open3d/data/dataset/SampleL515Bag.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/SampleNYURGBDImage.cpp b/cpp/open3d/data/dataset/SampleNYURGBDImage.cpp index 20c9ceb8304..6d6b83c570a 100644 --- a/cpp/open3d/data/dataset/SampleNYURGBDImage.cpp +++ b/cpp/open3d/data/dataset/SampleNYURGBDImage.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/SampleRedwoodRGBDImages.cpp b/cpp/open3d/data/dataset/SampleRedwoodRGBDImages.cpp index f8e7c96b45a..30144480523 100644 --- a/cpp/open3d/data/dataset/SampleRedwoodRGBDImages.cpp +++ b/cpp/open3d/data/dataset/SampleRedwoodRGBDImages.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/SampleSUNRGBDImage.cpp b/cpp/open3d/data/dataset/SampleSUNRGBDImage.cpp index 308ab925adf..b8053f5ef7f 100644 --- a/cpp/open3d/data/dataset/SampleSUNRGBDImage.cpp +++ b/cpp/open3d/data/dataset/SampleSUNRGBDImage.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/SampleTUMRGBDImage.cpp b/cpp/open3d/data/dataset/SampleTUMRGBDImage.cpp index 19798c5e333..60aa04e56e4 100644 --- a/cpp/open3d/data/dataset/SampleTUMRGBDImage.cpp +++ b/cpp/open3d/data/dataset/SampleTUMRGBDImage.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/SwordModel.cpp b/cpp/open3d/data/dataset/SwordModel.cpp index c9d74e7cb32..0d1db667e8d 100644 --- a/cpp/open3d/data/dataset/SwordModel.cpp +++ b/cpp/open3d/data/dataset/SwordModel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/TerrazzoTexture.cpp b/cpp/open3d/data/dataset/TerrazzoTexture.cpp index beb70b3284d..08d1f74445b 100644 --- a/cpp/open3d/data/dataset/TerrazzoTexture.cpp +++ b/cpp/open3d/data/dataset/TerrazzoTexture.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/TilesTexture.cpp b/cpp/open3d/data/dataset/TilesTexture.cpp index 719f9bf6a37..d3983e5d0cb 100644 --- a/cpp/open3d/data/dataset/TilesTexture.cpp +++ b/cpp/open3d/data/dataset/TilesTexture.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/WoodFloorTexture.cpp b/cpp/open3d/data/dataset/WoodFloorTexture.cpp index ae6e0a26771..9640f9d811c 100644 --- a/cpp/open3d/data/dataset/WoodFloorTexture.cpp +++ b/cpp/open3d/data/dataset/WoodFloorTexture.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/data/dataset/WoodTexture.cpp b/cpp/open3d/data/dataset/WoodTexture.cpp index d62549f5e04..2198ecd009d 100644 --- a/cpp/open3d/data/dataset/WoodTexture.cpp +++ b/cpp/open3d/data/dataset/WoodTexture.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/BoundingVolume.cpp b/cpp/open3d/geometry/BoundingVolume.cpp index 89b0ca70e5d..5f5f5c6a6e3 100644 --- a/cpp/open3d/geometry/BoundingVolume.cpp +++ b/cpp/open3d/geometry/BoundingVolume.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/BoundingVolume.h b/cpp/open3d/geometry/BoundingVolume.h index b4b310f3ca0..432050bccdc 100644 --- a/cpp/open3d/geometry/BoundingVolume.h +++ b/cpp/open3d/geometry/BoundingVolume.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/EstimateNormals.cpp b/cpp/open3d/geometry/EstimateNormals.cpp index 5bc9abc0ba3..d51423182f0 100644 --- a/cpp/open3d/geometry/EstimateNormals.cpp +++ b/cpp/open3d/geometry/EstimateNormals.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/Geometry.h b/cpp/open3d/geometry/Geometry.h index bb76b55e8c2..4ddf79bcc0c 100644 --- a/cpp/open3d/geometry/Geometry.h +++ b/cpp/open3d/geometry/Geometry.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/Geometry2D.h b/cpp/open3d/geometry/Geometry2D.h index 0c66887410b..f2794883f63 100644 --- a/cpp/open3d/geometry/Geometry2D.h +++ b/cpp/open3d/geometry/Geometry2D.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/Geometry3D.cpp b/cpp/open3d/geometry/Geometry3D.cpp index af3ecceb6d2..dc240d5afa3 100644 --- a/cpp/open3d/geometry/Geometry3D.cpp +++ b/cpp/open3d/geometry/Geometry3D.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/Geometry3D.h b/cpp/open3d/geometry/Geometry3D.h index 46ebd388690..74a0cc887a3 100644 --- a/cpp/open3d/geometry/Geometry3D.h +++ b/cpp/open3d/geometry/Geometry3D.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/HalfEdgeTriangleMesh.cpp b/cpp/open3d/geometry/HalfEdgeTriangleMesh.cpp index 92b3f201d39..c9a7c32e3c4 100644 --- a/cpp/open3d/geometry/HalfEdgeTriangleMesh.cpp +++ b/cpp/open3d/geometry/HalfEdgeTriangleMesh.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/HalfEdgeTriangleMesh.h b/cpp/open3d/geometry/HalfEdgeTriangleMesh.h index 33ceeda71f6..d1ce3e4d893 100644 --- a/cpp/open3d/geometry/HalfEdgeTriangleMesh.h +++ b/cpp/open3d/geometry/HalfEdgeTriangleMesh.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/ISSKeypoints.cpp b/cpp/open3d/geometry/ISSKeypoints.cpp index f47abae1ad2..a1c5257cea2 100644 --- a/cpp/open3d/geometry/ISSKeypoints.cpp +++ b/cpp/open3d/geometry/ISSKeypoints.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // @author Ignacio Vizzo [ivizzo@uni-bonn.de] diff --git a/cpp/open3d/geometry/Image.cpp b/cpp/open3d/geometry/Image.cpp index f14f709a108..9b145b676cb 100644 --- a/cpp/open3d/geometry/Image.cpp +++ b/cpp/open3d/geometry/Image.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/Image.h b/cpp/open3d/geometry/Image.h index ae89866a289..0dcf5469c66 100644 --- a/cpp/open3d/geometry/Image.h +++ b/cpp/open3d/geometry/Image.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/ImageFactory.cpp b/cpp/open3d/geometry/ImageFactory.cpp index d9ad9561e81..2e48af52b26 100644 --- a/cpp/open3d/geometry/ImageFactory.cpp +++ b/cpp/open3d/geometry/ImageFactory.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/IntersectionTest.cpp b/cpp/open3d/geometry/IntersectionTest.cpp index 851ac59b441..118c9f5d056 100644 --- a/cpp/open3d/geometry/IntersectionTest.cpp +++ b/cpp/open3d/geometry/IntersectionTest.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/IntersectionTest.h b/cpp/open3d/geometry/IntersectionTest.h index aa93b54a531..90f22fc9eb6 100644 --- a/cpp/open3d/geometry/IntersectionTest.h +++ b/cpp/open3d/geometry/IntersectionTest.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/KDTreeFlann.cpp b/cpp/open3d/geometry/KDTreeFlann.cpp index c81814a724d..c435a0fa2a3 100644 --- a/cpp/open3d/geometry/KDTreeFlann.cpp +++ b/cpp/open3d/geometry/KDTreeFlann.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/KDTreeFlann.h b/cpp/open3d/geometry/KDTreeFlann.h index cb41fccafb7..88fd9b946f0 100644 --- a/cpp/open3d/geometry/KDTreeFlann.h +++ b/cpp/open3d/geometry/KDTreeFlann.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/KDTreeSearchParam.h b/cpp/open3d/geometry/KDTreeSearchParam.h index 2032228e67a..9e1914e33cf 100644 --- a/cpp/open3d/geometry/KDTreeSearchParam.h +++ b/cpp/open3d/geometry/KDTreeSearchParam.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/Keypoint.h b/cpp/open3d/geometry/Keypoint.h index 7e13d4dc110..48a8d1d78bd 100644 --- a/cpp/open3d/geometry/Keypoint.h +++ b/cpp/open3d/geometry/Keypoint.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // @author Ignacio Vizzo [ivizzo@uni-bonn.de] diff --git a/cpp/open3d/geometry/Line3D.cpp b/cpp/open3d/geometry/Line3D.cpp index 310603893ac..17b6a2f1dc7 100644 --- a/cpp/open3d/geometry/Line3D.cpp +++ b/cpp/open3d/geometry/Line3D.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/Line3D.h b/cpp/open3d/geometry/Line3D.h index 5be5567e7c9..ea2f2d44521 100644 --- a/cpp/open3d/geometry/Line3D.h +++ b/cpp/open3d/geometry/Line3D.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/LineSet.cpp b/cpp/open3d/geometry/LineSet.cpp index ca6ce664b29..9a38d2a7371 100644 --- a/cpp/open3d/geometry/LineSet.cpp +++ b/cpp/open3d/geometry/LineSet.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/LineSet.h b/cpp/open3d/geometry/LineSet.h index 1dbffbb5e75..3718b6d446c 100644 --- a/cpp/open3d/geometry/LineSet.h +++ b/cpp/open3d/geometry/LineSet.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/LineSetFactory.cpp b/cpp/open3d/geometry/LineSetFactory.cpp index 3a66d86d300..029fdd9d1bb 100644 --- a/cpp/open3d/geometry/LineSetFactory.cpp +++ b/cpp/open3d/geometry/LineSetFactory.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/MeshBase.cpp b/cpp/open3d/geometry/MeshBase.cpp index 1e403968900..3d5714d9072 100644 --- a/cpp/open3d/geometry/MeshBase.cpp +++ b/cpp/open3d/geometry/MeshBase.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -51,7 +51,7 @@ OrientedBoundingBox MeshBase::GetOrientedBoundingBox(bool robust) const { } OrientedBoundingBox MeshBase::GetMinimalOrientedBoundingBox(bool robust) const { - return OrientedBoundingBox::CreateFromPoints(vertices_, robust); + return OrientedBoundingBox::CreateFromPointsMinimal(vertices_, robust); } MeshBase &MeshBase::Transform(const Eigen::Matrix4d &transformation) { diff --git a/cpp/open3d/geometry/MeshBase.h b/cpp/open3d/geometry/MeshBase.h index f479a925913..2a5793ac62b 100644 --- a/cpp/open3d/geometry/MeshBase.h +++ b/cpp/open3d/geometry/MeshBase.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/Octree.cpp b/cpp/open3d/geometry/Octree.cpp index ad62a7ece63..23efcb06e81 100644 --- a/cpp/open3d/geometry/Octree.cpp +++ b/cpp/open3d/geometry/Octree.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/Octree.h b/cpp/open3d/geometry/Octree.h index d2b57262a06..5b3b6d90c52 100644 --- a/cpp/open3d/geometry/Octree.h +++ b/cpp/open3d/geometry/Octree.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/PointCloud.cpp b/cpp/open3d/geometry/PointCloud.cpp index b0b6e0130ae..12da953bb11 100644 --- a/cpp/open3d/geometry/PointCloud.cpp +++ b/cpp/open3d/geometry/PointCloud.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -507,7 +507,7 @@ std::shared_ptr PointCloud::RandomDownSample( } std::shared_ptr PointCloud::FarthestPointDownSample( - size_t num_samples) const { + const size_t num_samples, const size_t start_index) const { if (num_samples == 0) { return std::make_shared(); } else if (num_samples == points_.size()) { @@ -516,6 +516,9 @@ std::shared_ptr PointCloud::FarthestPointDownSample( utility::LogError( "Illegal number of samples: {}, must <= point size: {}", num_samples, points_.size()); + } else if (start_index >= points_.size()) { + utility::LogError("Illegal start index: {}, must < point size: {}", + start_index, points_.size()); } // We can also keep track of the non-selected indices with unordered_set, // but since typically num_samples << num_points, it may not be worth it. @@ -524,7 +527,7 @@ std::shared_ptr PointCloud::FarthestPointDownSample( const size_t num_points = points_.size(); std::vector distances(num_points, std::numeric_limits::infinity()); - size_t farthest_index = 0; + size_t farthest_index = start_index; for (size_t i = 0; i < num_samples; i++) { selected_indices.push_back(farthest_index); const Eigen::Vector3d &selected = points_[farthest_index]; diff --git a/cpp/open3d/geometry/PointCloud.h b/cpp/open3d/geometry/PointCloud.h index fec0d3033d1..e55d89e4b88 100644 --- a/cpp/open3d/geometry/PointCloud.h +++ b/cpp/open3d/geometry/PointCloud.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -173,11 +173,12 @@ class PointCloud : public Geometry3D { /// with a set of points has farthest distance. /// /// The sample is performed by selecting the farthest point from previous - /// selected points iteratively. + /// selected points iteratively, starting from `start_index`. /// /// \param num_samples Number of points to be sampled. + /// \param start_index Index to start downsampling from. std::shared_ptr FarthestPointDownSample( - size_t num_samples) const; + const size_t num_samples, const size_t start_index = 0) const; /// \brief Function to crop pointcloud into output pointcloud /// diff --git a/cpp/open3d/geometry/PointCloudCluster.cpp b/cpp/open3d/geometry/PointCloudCluster.cpp index 6efad46bd50..9dd5f0dc162 100644 --- a/cpp/open3d/geometry/PointCloudCluster.cpp +++ b/cpp/open3d/geometry/PointCloudCluster.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/PointCloudFactory.cpp b/cpp/open3d/geometry/PointCloudFactory.cpp index 184b93a62b8..183919fa9a1 100644 --- a/cpp/open3d/geometry/PointCloudFactory.cpp +++ b/cpp/open3d/geometry/PointCloudFactory.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/PointCloudPlanarPatchDetection.cpp b/cpp/open3d/geometry/PointCloudPlanarPatchDetection.cpp index b76bc9f3fc4..56f275f150b 100644 --- a/cpp/open3d/geometry/PointCloudPlanarPatchDetection.cpp +++ b/cpp/open3d/geometry/PointCloudPlanarPatchDetection.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/PointCloudSegmentation.cpp b/cpp/open3d/geometry/PointCloudSegmentation.cpp index 2968810cecc..8eb0a4972da 100644 --- a/cpp/open3d/geometry/PointCloudSegmentation.cpp +++ b/cpp/open3d/geometry/PointCloudSegmentation.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -29,7 +29,6 @@ class RandomSampler { explicit RandomSampler(const size_t total_size) : total_size_(total_size) {} std::vector operator()(size_t sample_size) { - std::lock_guard lock(mutex_); std::vector samples; samples.reserve(sample_size); @@ -43,13 +42,11 @@ class RandomSampler { valid_sample++; } } - return samples; } private: size_t total_size_; - std::mutex mutex_; }; /// \class RANSACResult @@ -156,21 +153,7 @@ std::tuple> PointCloud::SegmentPlane( utility::LogError("Probability must be > 0 and <= 1.0"); } - RANSACResult result; - - // Initialize the best plane model. - Eigen::Vector4d best_plane_model = Eigen::Vector4d(0, 0, 0, 0); - size_t num_points = points_.size(); - RandomSampler sampler(num_points); - // Pre-generate all random samples before entering the parallel region - std::vector> all_sampled_indices; - all_sampled_indices.reserve(num_iterations); - for (int i = 0; i < num_iterations; i++) { - all_sampled_indices.push_back(sampler(ransac_n)); - } - - // Return if ransac_n is less than the required plane model parameters. if (ransac_n < 3) { utility::LogError( "ransac_n should be set to higher than or equal to 3."); @@ -183,6 +166,17 @@ std::tuple> PointCloud::SegmentPlane( std::vector{}); } + RANSACResult result; + Eigen::Vector4d best_plane_model = Eigen::Vector4d(0, 0, 0, 0); + + RandomSampler sampler(num_points); + // Pre-generate all random samples before entering the parallel region + std::vector> all_sampled_indices; + all_sampled_indices.reserve(num_iterations); + for (int i = 0; i < num_iterations; i++) { + all_sampled_indices.push_back(sampler(ransac_n)); + } + // Use size_t here to avoid large integer which acceed max of int. size_t break_iteration = std::numeric_limits::max(); int iteration_count = 0; diff --git a/cpp/open3d/geometry/Qhull.cpp b/cpp/open3d/geometry/Qhull.cpp index 30fb485e12c..4ae7de218a3 100644 --- a/cpp/open3d/geometry/Qhull.cpp +++ b/cpp/open3d/geometry/Qhull.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/Qhull.h b/cpp/open3d/geometry/Qhull.h index c80bb0b4ac9..b8b56e684f9 100644 --- a/cpp/open3d/geometry/Qhull.h +++ b/cpp/open3d/geometry/Qhull.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/RGBDImage.cpp b/cpp/open3d/geometry/RGBDImage.cpp index 08292097ebb..baaecad4938 100644 --- a/cpp/open3d/geometry/RGBDImage.cpp +++ b/cpp/open3d/geometry/RGBDImage.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/RGBDImage.h b/cpp/open3d/geometry/RGBDImage.h index 75db0b68cee..9d179ad0783 100644 --- a/cpp/open3d/geometry/RGBDImage.h +++ b/cpp/open3d/geometry/RGBDImage.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/RGBDImageFactory.cpp b/cpp/open3d/geometry/RGBDImageFactory.cpp index 1f2819ebe3a..2d68a9fdf46 100644 --- a/cpp/open3d/geometry/RGBDImageFactory.cpp +++ b/cpp/open3d/geometry/RGBDImageFactory.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/SurfaceReconstructionAlphaShape.cpp b/cpp/open3d/geometry/SurfaceReconstructionAlphaShape.cpp index 2fc58c9c8d3..f5b941e2b7d 100644 --- a/cpp/open3d/geometry/SurfaceReconstructionAlphaShape.cpp +++ b/cpp/open3d/geometry/SurfaceReconstructionAlphaShape.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -158,28 +158,37 @@ std::shared_ptr TriangleMesh::CreateFromPointCloudAlphaShape( "[CreateFromPointCloudAlphaShape] done remove duplicate triangles " "and unreferenced vertices"); - auto tmesh = t::geometry::TriangleMesh::FromLegacy(*mesh); - - // use new object tmesh2 here even if some arrays share memory with tmesh. - // We don't want to replace the blobs in tmesh. - auto tmesh2 = t::geometry::vtkutils::ComputeNormals( - tmesh, /*vertex_normals=*/true, /*face_normals=*/false, - /*consistency=*/true, /*auto_orient_normals=*/true, - /*splitting=*/false); - - mesh->vertices_ = core::eigen_converter::TensorToEigenVector3dVector( - tmesh2.GetVertexPositions()); - mesh->triangles_ = core::eigen_converter::TensorToEigenVector3iVector( - tmesh2.GetTriangleIndices()); - if (mesh->HasVertexColors()) { - mesh->vertex_colors_ = - core::eigen_converter::TensorToEigenVector3dVector( - tmesh2.GetVertexColors()); - } - if (mesh->HasVertexNormals()) { - mesh->vertex_normals_ = - core::eigen_converter::TensorToEigenVector3dVector( - tmesh2.GetVertexNormals()); + if (mesh->vertices_.size() > 0) { + auto tmesh = t::geometry::TriangleMesh::FromLegacy(*mesh); + + // use new object tmesh2 here even if some arrays share memory with + // tmesh. We don't want to replace the blobs in tmesh. + auto tmesh2 = t::geometry::vtkutils::ComputeNormals( + tmesh, /*vertex_normals=*/true, /*face_normals=*/false, + /*consistency=*/true, /*auto_orient_normals=*/true, + /*splitting=*/false); + + mesh->vertices_ = core::eigen_converter::TensorToEigenVector3dVector( + tmesh2.GetVertexPositions()); + mesh->triangles_ = core::eigen_converter::TensorToEigenVector3iVector( + tmesh2.GetTriangleIndices()); + if (mesh->HasVertexColors()) { + mesh->vertex_colors_ = + core::eigen_converter::TensorToEigenVector3dVector( + tmesh2.GetVertexColors()); + } + if (mesh->HasVertexNormals()) { + mesh->vertex_normals_ = + core::eigen_converter::TensorToEigenVector3dVector( + tmesh2.GetVertexNormals()); + } + } else { + utility::LogWarning( + fmt::format("[CreateFromPointCloudAlphaShape] alpha shape " + "reconstruction resulted in empty mesh. Alpha " + "value ({}) could be too small.", + alpha) + .c_str()); } return mesh; diff --git a/cpp/open3d/geometry/SurfaceReconstructionBallPivoting.cpp b/cpp/open3d/geometry/SurfaceReconstructionBallPivoting.cpp index 73e399309ed..2774b314364 100644 --- a/cpp/open3d/geometry/SurfaceReconstructionBallPivoting.cpp +++ b/cpp/open3d/geometry/SurfaceReconstructionBallPivoting.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -17,6 +17,7 @@ namespace open3d { namespace geometry { +namespace { class BallPivotingVertex; class BallPivotingEdge; @@ -733,6 +734,7 @@ class BallPivoting { std::vector vertices; std::shared_ptr mesh_; }; +} // namespace std::shared_ptr TriangleMesh::CreateFromPointCloudBallPivoting( const PointCloud& pcd, const std::vector& radii) { diff --git a/cpp/open3d/geometry/SurfaceReconstructionPoisson.cpp b/cpp/open3d/geometry/SurfaceReconstructionPoisson.cpp index 08da79d9365..7195166701f 100644 --- a/cpp/open3d/geometry/SurfaceReconstructionPoisson.cpp +++ b/cpp/open3d/geometry/SurfaceReconstructionPoisson.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -39,7 +39,7 @@ namespace open3d { namespace geometry { -namespace poisson { +namespace { // The order of the B-Spline used to splat in data for color interpolation static const int DATA_DEGREE = 0; @@ -713,7 +713,7 @@ void Execute(const open3d::geometry::PointCloud& pcd, Time() - startTime, FEMTree::MaxMemoryUsage()); } -} // namespace poisson +} // namespace std::tuple, std::vector> TriangleMesh::CreateFromPointCloudPoisson(const PointCloud& pcd, @@ -722,10 +722,9 @@ TriangleMesh::CreateFromPointCloudPoisson(const PointCloud& pcd, float scale, bool linear_fit, int n_threads) { - static const BoundaryType BType = poisson::DEFAULT_FEM_BOUNDARY; + static const BoundaryType BType = DEFAULT_FEM_BOUNDARY; typedef IsotropicUIntPack< - poisson::DIMENSION, - FEMDegreeAndBType::Signature> + DIMENSION, FEMDegreeAndBType::Signature> FEMSigs; if (!pcd.HasNormals()) { @@ -746,8 +745,8 @@ TriangleMesh::CreateFromPointCloudPoisson(const PointCloud& pcd, auto mesh = std::make_shared(); std::vector densities; - poisson::Execute(pcd, mesh, densities, static_cast(depth), - width, scale, linear_fit, FEMSigs()); + Execute(pcd, mesh, densities, static_cast(depth), width, scale, + linear_fit, FEMSigs()); ThreadPool::Terminate(); diff --git a/cpp/open3d/geometry/TetraMesh.cpp b/cpp/open3d/geometry/TetraMesh.cpp index a742f17431b..5274736fadf 100644 --- a/cpp/open3d/geometry/TetraMesh.cpp +++ b/cpp/open3d/geometry/TetraMesh.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/TetraMesh.h b/cpp/open3d/geometry/TetraMesh.h index a23dd9dc623..b2869c520b9 100644 --- a/cpp/open3d/geometry/TetraMesh.h +++ b/cpp/open3d/geometry/TetraMesh.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/TetraMeshFactory.cpp b/cpp/open3d/geometry/TetraMeshFactory.cpp index dfa21d715d6..522417045ba 100644 --- a/cpp/open3d/geometry/TetraMeshFactory.cpp +++ b/cpp/open3d/geometry/TetraMeshFactory.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/TriangleMesh.cpp b/cpp/open3d/geometry/TriangleMesh.cpp index 88f602770cb..390557f762b 100644 --- a/cpp/open3d/geometry/TriangleMesh.cpp +++ b/cpp/open3d/geometry/TriangleMesh.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -52,9 +52,12 @@ TriangleMesh &TriangleMesh::Rotate(const Eigen::Matrix3d &R, TriangleMesh &TriangleMesh::operator+=(const TriangleMesh &mesh) { if (mesh.IsEmpty()) return (*this); - bool add_textures = HasTriangleUvs() && HasTextures() && - HasTriangleMaterialIds() && mesh.HasTriangleUvs() && - mesh.HasTextures() && mesh.HasTriangleMaterialIds(); + bool is_empty = IsEmpty(); + bool add_triangle_uvs = + mesh.HasTriangleUvs() && (HasTriangleUvs() || is_empty); + bool add_textures_and_material_ids = + mesh.HasTextures() && mesh.HasTriangleMaterialIds() && + ((HasTextures() && HasTriangleMaterialIds()) || is_empty); size_t old_vert_num = vertices_.size(); MeshBase::operator+=(mesh); size_t old_tri_num = triangles_.size(); @@ -77,19 +80,21 @@ TriangleMesh &TriangleMesh::operator+=(const TriangleMesh &mesh) { if (HasAdjacencyList()) { ComputeAdjacencyList(); } - if (add_textures) { + if (add_triangle_uvs) { size_t old_tri_uv_num = triangle_uvs_.size(); triangle_uvs_.resize(old_tri_uv_num + mesh.triangle_uvs_.size()); for (size_t i = 0; i < mesh.triangle_uvs_.size(); i++) { triangle_uvs_[old_tri_uv_num + i] = mesh.triangle_uvs_[i]; } - + } else { + triangle_uvs_.clear(); + } + if (add_textures_and_material_ids) { size_t old_tex_num = textures_.size(); textures_.resize(old_tex_num + mesh.textures_.size()); for (size_t i = 0; i < mesh.textures_.size(); i++) { textures_[old_tex_num + i] = mesh.textures_[i]; } - size_t old_mat_id_num = triangle_material_ids_.size(); triangle_material_ids_.resize(old_mat_id_num + mesh.triangle_material_ids_.size()); @@ -98,7 +103,6 @@ TriangleMesh &TriangleMesh::operator+=(const TriangleMesh &mesh) { mesh.triangle_material_ids_[i] + (int)old_tex_num; } } else { - triangle_uvs_.clear(); textures_.clear(); triangle_material_ids_.clear(); } @@ -126,7 +130,9 @@ TriangleMesh &TriangleMesh::ComputeTriangleNormals( TriangleMesh &TriangleMesh::ComputeVertexNormals(bool normalized /* = true*/) { ComputeTriangleNormals(false); - vertex_normals_.resize(vertices_.size(), Eigen::Vector3d::Zero()); + vertex_normals_.resize(vertices_.size()); + std::fill(vertex_normals_.begin(), vertex_normals_.end(), + Eigen::Vector3d::Zero()); for (size_t i = 0; i < triangles_.size(); i++) { auto &triangle = triangles_[i]; vertex_normals_[triangle(0)] += triangle_normals_[i]; @@ -441,6 +447,10 @@ std::shared_ptr TriangleMesh::SamplePointsUniformlyImpl( // sample point cloud bool has_vert_normal = HasVertexNormals(); bool has_vert_color = HasVertexColors(); + bool has_textures_ = HasTextures(); + bool has_triangle_uvs_ = HasTriangleUvs(); + bool has_triangle_material_ids_ = HasTriangleMaterialIds(); + utility::random::UniformRealGenerator uniform_generator(0.0, 1.0); auto pcd = std::make_shared(); pcd->points_.resize(number_of_points); @@ -450,10 +460,9 @@ std::shared_ptr TriangleMesh::SamplePointsUniformlyImpl( if (use_triangle_normal && !HasTriangleNormals()) { ComputeTriangleNormals(true); } - if (has_vert_color) { + if (has_vert_color || (has_textures_ && has_triangle_uvs_)) { pcd->colors_.resize(number_of_points); } - for (size_t point_idx = 0; point_idx < number_of_points; ++point_idx) { double r1 = uniform_generator(); double r2 = uniform_generator(); @@ -473,13 +482,33 @@ std::shared_ptr TriangleMesh::SamplePointsUniformlyImpl( if (use_triangle_normal) { pcd->normals_[point_idx] = triangle_normals_[tidx]; } - if (has_vert_color) { + // if there is no texture, sample from vertex color + if (has_vert_color && !has_textures_ && !has_triangle_uvs_) { pcd->colors_[point_idx] = a * vertex_colors_[triangle(0)] + b * vertex_colors_[triangle(1)] + c * vertex_colors_[triangle(2)]; } + // if there is a texture, sample from texture instead + if (has_textures_ && has_triangle_uvs_ && has_triangle_material_ids_) { + Eigen::Vector2d uv = a * triangle_uvs_[3 * tidx] + + b * triangle_uvs_[3 * tidx + 1] + + c * triangle_uvs_[3 * tidx + 2]; + int material_id = triangle_material_ids_[tidx]; + int w = textures_[material_id].width_; + int h = textures_[material_id].height_; + + pcd->colors_[point_idx] = Eigen::Vector3d( + (double)*(textures_[material_id].PointerAt( + uv(0) * w, uv(1) * h, 0)) / + 255, + (double)*(textures_[material_id].PointerAt( + uv(0) * w, uv(1) * h, 1)) / + 255, + (double)*(textures_[material_id].PointerAt( + uv(0) * w, uv(1) * h, 2)) / + 255); + } } - return pcd; } @@ -619,6 +648,8 @@ std::shared_ptr TriangleMesh::SamplePointsPoissonDisk( // update pcl bool has_vert_normal = pcl->HasNormals(); bool has_vert_color = pcl->HasColors(); + bool has_textures_ = HasTextures(); + bool has_triangle_uvs_ = HasTriangleUvs(); int next_free = 0; for (size_t idx = 0; idx < pcl->points_.size(); ++idx) { if (!deleted[idx]) { @@ -626,7 +657,7 @@ std::shared_ptr TriangleMesh::SamplePointsPoissonDisk( if (has_vert_normal) { pcl->normals_[next_free] = pcl->normals_[idx]; } - if (has_vert_color) { + if (has_vert_color || (has_textures_ && has_triangle_uvs_)) { pcl->colors_[next_free] = pcl->colors_[idx]; } next_free++; diff --git a/cpp/open3d/geometry/TriangleMesh.h b/cpp/open3d/geometry/TriangleMesh.h index ba3105f0d60..1da782fd9b6 100644 --- a/cpp/open3d/geometry/TriangleMesh.h +++ b/cpp/open3d/geometry/TriangleMesh.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/TriangleMeshDeformation.cpp b/cpp/open3d/geometry/TriangleMeshDeformation.cpp index adfe76b76ed..3c037092341 100644 --- a/cpp/open3d/geometry/TriangleMeshDeformation.cpp +++ b/cpp/open3d/geometry/TriangleMeshDeformation.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/TriangleMeshFactory.cpp b/cpp/open3d/geometry/TriangleMeshFactory.cpp index 395b6622bbc..68341245bf4 100644 --- a/cpp/open3d/geometry/TriangleMeshFactory.cpp +++ b/cpp/open3d/geometry/TriangleMeshFactory.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/TriangleMeshSimplification.cpp b/cpp/open3d/geometry/TriangleMeshSimplification.cpp index 90a2a166ce7..12f98d7d011 100644 --- a/cpp/open3d/geometry/TriangleMeshSimplification.cpp +++ b/cpp/open3d/geometry/TriangleMeshSimplification.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -298,7 +298,8 @@ std::shared_ptr TriangleMesh::SimplifyQuadricDecimation( const auto& vert1 = mesh->vertices_[vidx1]; const auto& vert2 = mesh->vertices_[vidx2]; Eigen::Vector3d vert2p = (vert2 - vert0).cross(vert2 - vert1); - Eigen::Vector4d plane = ComputeTrianglePlane(vert0, vert1, vert2p); + Eigen::Vector4d plane = + ComputeTrianglePlane(vert0, vert1, vert0 + vert2p); Quadric quad(plane, area * boundary_weight); Qs[vidx0] += quad; Qs[vidx1] += quad; diff --git a/cpp/open3d/geometry/TriangleMeshSubdivide.cpp b/cpp/open3d/geometry/TriangleMeshSubdivide.cpp index 685e316b6f1..b6791df4db9 100644 --- a/cpp/open3d/geometry/TriangleMeshSubdivide.cpp +++ b/cpp/open3d/geometry/TriangleMeshSubdivide.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/VoxelGrid.cpp b/cpp/open3d/geometry/VoxelGrid.cpp index dafe6b52c01..aa028b22ac9 100644 --- a/cpp/open3d/geometry/VoxelGrid.cpp +++ b/cpp/open3d/geometry/VoxelGrid.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/VoxelGrid.h b/cpp/open3d/geometry/VoxelGrid.h index 30a228206e0..1c15a5073bb 100644 --- a/cpp/open3d/geometry/VoxelGrid.h +++ b/cpp/open3d/geometry/VoxelGrid.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/geometry/VoxelGridFactory.cpp b/cpp/open3d/geometry/VoxelGridFactory.cpp index a083c6524d5..bbe5df52c3f 100644 --- a/cpp/open3d/geometry/VoxelGridFactory.cpp +++ b/cpp/open3d/geometry/VoxelGridFactory.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/FeatureIO.cpp b/cpp/open3d/io/FeatureIO.cpp index a0320f94de6..db7a675760e 100644 --- a/cpp/open3d/io/FeatureIO.cpp +++ b/cpp/open3d/io/FeatureIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/FeatureIO.h b/cpp/open3d/io/FeatureIO.h index cb8bb133643..1cbf9e56c90 100644 --- a/cpp/open3d/io/FeatureIO.h +++ b/cpp/open3d/io/FeatureIO.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/FileFormatIO.cpp b/cpp/open3d/io/FileFormatIO.cpp index 008b0debdb4..89089978292 100644 --- a/cpp/open3d/io/FileFormatIO.cpp +++ b/cpp/open3d/io/FileFormatIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/FileFormatIO.h b/cpp/open3d/io/FileFormatIO.h index 02233604bb8..0f3b9343be7 100644 --- a/cpp/open3d/io/FileFormatIO.h +++ b/cpp/open3d/io/FileFormatIO.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/IJsonConvertibleIO.cpp b/cpp/open3d/io/IJsonConvertibleIO.cpp index 719213e9abc..25543f4a786 100644 --- a/cpp/open3d/io/IJsonConvertibleIO.cpp +++ b/cpp/open3d/io/IJsonConvertibleIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/IJsonConvertibleIO.h b/cpp/open3d/io/IJsonConvertibleIO.h index a366b4f5ef8..0e6d6f6af18 100644 --- a/cpp/open3d/io/IJsonConvertibleIO.h +++ b/cpp/open3d/io/IJsonConvertibleIO.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/ImageIO.cpp b/cpp/open3d/io/ImageIO.cpp index c00361a449a..737d2ebbdaf 100644 --- a/cpp/open3d/io/ImageIO.cpp +++ b/cpp/open3d/io/ImageIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/ImageIO.h b/cpp/open3d/io/ImageIO.h index 45b0a3f71ed..843231c442b 100644 --- a/cpp/open3d/io/ImageIO.h +++ b/cpp/open3d/io/ImageIO.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/ImageWarpingFieldIO.cpp b/cpp/open3d/io/ImageWarpingFieldIO.cpp index 98d660ca1c7..42d97bb909a 100644 --- a/cpp/open3d/io/ImageWarpingFieldIO.cpp +++ b/cpp/open3d/io/ImageWarpingFieldIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/ImageWarpingFieldIO.h b/cpp/open3d/io/ImageWarpingFieldIO.h index 915c7d731d9..f1b749fbc34 100644 --- a/cpp/open3d/io/ImageWarpingFieldIO.h +++ b/cpp/open3d/io/ImageWarpingFieldIO.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/LineSetIO.cpp b/cpp/open3d/io/LineSetIO.cpp index 72d04c1e6af..03810afdf7f 100644 --- a/cpp/open3d/io/LineSetIO.cpp +++ b/cpp/open3d/io/LineSetIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/LineSetIO.h b/cpp/open3d/io/LineSetIO.h index 00cf61c0112..6965b75be83 100644 --- a/cpp/open3d/io/LineSetIO.h +++ b/cpp/open3d/io/LineSetIO.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/ModelIO.cpp b/cpp/open3d/io/ModelIO.cpp index b663307a451..cacc9b5323a 100644 --- a/cpp/open3d/io/ModelIO.cpp +++ b/cpp/open3d/io/ModelIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/ModelIO.h b/cpp/open3d/io/ModelIO.h index 57bd7f7d792..c97370e120e 100644 --- a/cpp/open3d/io/ModelIO.h +++ b/cpp/open3d/io/ModelIO.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/OctreeIO.cpp b/cpp/open3d/io/OctreeIO.cpp index a6d6d11f1ba..ae43c3724b2 100644 --- a/cpp/open3d/io/OctreeIO.cpp +++ b/cpp/open3d/io/OctreeIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/OctreeIO.h b/cpp/open3d/io/OctreeIO.h index 30eda19e81e..57ee3b3f400 100644 --- a/cpp/open3d/io/OctreeIO.h +++ b/cpp/open3d/io/OctreeIO.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/PinholeCameraTrajectoryIO.cpp b/cpp/open3d/io/PinholeCameraTrajectoryIO.cpp index cf64c593c2c..7319e9fc56a 100644 --- a/cpp/open3d/io/PinholeCameraTrajectoryIO.cpp +++ b/cpp/open3d/io/PinholeCameraTrajectoryIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/PinholeCameraTrajectoryIO.h b/cpp/open3d/io/PinholeCameraTrajectoryIO.h index 5a043300325..2568ff5725e 100644 --- a/cpp/open3d/io/PinholeCameraTrajectoryIO.h +++ b/cpp/open3d/io/PinholeCameraTrajectoryIO.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/PointCloudIO.cpp b/cpp/open3d/io/PointCloudIO.cpp index b5d10f33a00..479a5e47203 100644 --- a/cpp/open3d/io/PointCloudIO.cpp +++ b/cpp/open3d/io/PointCloudIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/PointCloudIO.h b/cpp/open3d/io/PointCloudIO.h index e7811ab58ff..a2b27971f22 100644 --- a/cpp/open3d/io/PointCloudIO.h +++ b/cpp/open3d/io/PointCloudIO.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/PoseGraphIO.cpp b/cpp/open3d/io/PoseGraphIO.cpp index 64de70f945c..805b5e3de9b 100644 --- a/cpp/open3d/io/PoseGraphIO.cpp +++ b/cpp/open3d/io/PoseGraphIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/PoseGraphIO.h b/cpp/open3d/io/PoseGraphIO.h index 3d8ad1fb9fa..c761c65212d 100644 --- a/cpp/open3d/io/PoseGraphIO.h +++ b/cpp/open3d/io/PoseGraphIO.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/TriangleMeshIO.cpp b/cpp/open3d/io/TriangleMeshIO.cpp index 59672c8ce2d..eab7648a6c2 100644 --- a/cpp/open3d/io/TriangleMeshIO.cpp +++ b/cpp/open3d/io/TriangleMeshIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/TriangleMeshIO.h b/cpp/open3d/io/TriangleMeshIO.h index 3ee4cb0f492..561efe8bd20 100644 --- a/cpp/open3d/io/TriangleMeshIO.h +++ b/cpp/open3d/io/TriangleMeshIO.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -31,6 +31,7 @@ struct ReadTriangleMeshOptions { /// `aiProcessPreset_TargetRealtime_Fast, /// aiProcess_RemoveRedundantMaterials, aiProcess_OptimizeMeshes, /// aiProcess_PreTransformVertices`. + /// https://github.com/assimp/assimp/blob/master/include/assimp/postprocess.h /// /// Note that identical vertices will always be joined regardless of whether /// post-processing is enabled or not, which changes the number of vertices diff --git a/cpp/open3d/io/VoxelGridIO.cpp b/cpp/open3d/io/VoxelGridIO.cpp index d8e5a2e757a..bbe6b3e1953 100644 --- a/cpp/open3d/io/VoxelGridIO.cpp +++ b/cpp/open3d/io/VoxelGridIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/VoxelGridIO.h b/cpp/open3d/io/VoxelGridIO.h index 70cb90a4a10..8c5484ca091 100644 --- a/cpp/open3d/io/VoxelGridIO.h +++ b/cpp/open3d/io/VoxelGridIO.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/file_format/FileASSIMP.cpp b/cpp/open3d/io/file_format/FileASSIMP.cpp index 92a2fda8077..548ffad165e 100644 --- a/cpp/open3d/io/file_format/FileASSIMP.cpp +++ b/cpp/open3d/io/file_format/FileASSIMP.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -36,13 +36,16 @@ FileGeometry ReadFileGeometryTypeFBX(const std::string& path) { return FileGeometry(CONTAINS_TRIANGLES | CONTAINS_POINTS); } +// Ref: +// https://github.com/assimp/assimp/blob/master/include/assimp/postprocess.h const unsigned int kPostProcessFlags_compulsory = - aiProcess_JoinIdenticalVertices; + aiProcess_JoinIdenticalVertices | aiProcess_SortByPType | + aiProcess_PreTransformVertices; const unsigned int kPostProcessFlags_fast = - aiProcessPreset_TargetRealtime_Fast | - aiProcess_RemoveRedundantMaterials | aiProcess_OptimizeMeshes | - aiProcess_PreTransformVertices; + kPostProcessFlags_compulsory | aiProcess_GenNormals | + aiProcess_Triangulate | aiProcess_GenUVCoords | + aiProcess_RemoveRedundantMaterials | aiProcess_OptimizeMeshes; struct TextureImages { std::shared_ptr albedo; @@ -65,7 +68,7 @@ void LoadTextures(const std::string& filename, std::string base_path = utility::filesystem::GetFileParentDirectory(filename); - auto texture_loader = [&base_path, &scene, &mat]( + auto texture_loader = [&base_path, &scene, &mat, &filename]( aiTextureType type, std::shared_ptr& img) { if (mat->GetTextureCount(type) > 0) { @@ -94,7 +97,10 @@ void LoadTextures(const std::string& filename, } } else { utility::LogWarning( - "This format of image is not supported."); + "Unsupported texture format for texture {} for " + "file {}: Only jpg and " + "png textures are supported.", + path.C_Str(), filename); } } // Else, build the path to it. @@ -170,7 +176,8 @@ bool ReadTriangleMeshUsingASSIMP( const auto* scene = importer.ReadFile(filename.c_str(), post_process_flags); if (!scene) { - utility::LogWarning("Unable to load file {} with ASSIMP", filename); + utility::LogWarning("Unable to load file {} with ASSIMP: {}", filename, + importer.GetErrorString()); return false; } @@ -326,7 +333,8 @@ bool ReadModelUsingAssimp(const std::string& filename, const auto* scene = importer.ReadFile(filename.c_str(), kPostProcessFlags_fast); if (!scene) { - utility::LogWarning("Unable to load file {} with ASSIMP", filename); + utility::LogWarning("Unable to load file {} with ASSIMP: {}", filename, + importer.GetErrorString()); return false; } diff --git a/cpp/open3d/io/file_format/FileBIN.cpp b/cpp/open3d/io/file_format/FileBIN.cpp index 2399c9b3ead..27ef362f13b 100644 --- a/cpp/open3d/io/file_format/FileBIN.cpp +++ b/cpp/open3d/io/file_format/FileBIN.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/file_format/FileGLTF.cpp b/cpp/open3d/io/file_format/FileGLTF.cpp index a5474b4021a..7d82eb7be4d 100644 --- a/cpp/open3d/io/file_format/FileGLTF.cpp +++ b/cpp/open3d/io/file_format/FileGLTF.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/file_format/FileJPG.cpp b/cpp/open3d/io/file_format/FileJPG.cpp index cb9cf6760e9..de0a098fc21 100644 --- a/cpp/open3d/io/file_format/FileJPG.cpp +++ b/cpp/open3d/io/file_format/FileJPG.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/file_format/FileJSON.cpp b/cpp/open3d/io/file_format/FileJSON.cpp index 6e1c0c8bbea..260971aaa44 100644 --- a/cpp/open3d/io/file_format/FileJSON.cpp +++ b/cpp/open3d/io/file_format/FileJSON.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/file_format/FileLOG.cpp b/cpp/open3d/io/file_format/FileLOG.cpp index 64748edcc60..daf20fb632a 100644 --- a/cpp/open3d/io/file_format/FileLOG.cpp +++ b/cpp/open3d/io/file_format/FileLOG.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/file_format/FileOBJ.cpp b/cpp/open3d/io/file_format/FileOBJ.cpp index a06b30a97fb..dfa715f860d 100644 --- a/cpp/open3d/io/file_format/FileOBJ.cpp +++ b/cpp/open3d/io/file_format/FileOBJ.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/file_format/FileOFF.cpp b/cpp/open3d/io/file_format/FileOFF.cpp index 080da77041b..a4716f86e40 100644 --- a/cpp/open3d/io/file_format/FileOFF.cpp +++ b/cpp/open3d/io/file_format/FileOFF.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/file_format/FilePCD.cpp b/cpp/open3d/io/file_format/FilePCD.cpp index ce04f2e2d5b..950d51eadf8 100644 --- a/cpp/open3d/io/file_format/FilePCD.cpp +++ b/cpp/open3d/io/file_format/FilePCD.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -220,7 +220,8 @@ bool ReadPCDHeader(FILE *file, PCDHeader &header) { double UnpackBinaryPCDElement(const char *data_ptr, const char type, const int size) { - if (type == 'I') { + const char type_uppercase = std::toupper(type, std::locale()); + if (type_uppercase == 'I') { if (size == 1) { std::int8_t data; memcpy(&data, data_ptr, sizeof(data)); @@ -236,7 +237,7 @@ double UnpackBinaryPCDElement(const char *data_ptr, } else { return 0.0; } - } else if (type == 'U') { + } else if (type_uppercase == 'U') { if (size == 1) { std::uint8_t data; memcpy(&data, data_ptr, sizeof(data)); @@ -252,7 +253,7 @@ double UnpackBinaryPCDElement(const char *data_ptr, } else { return 0.0; } - } else if (type == 'F') { + } else if (type_uppercase == 'F') { if (size == 4) { float data; memcpy(&data, data_ptr, sizeof(data)); @@ -281,11 +282,12 @@ double UnpackASCIIPCDElement(const char *data_ptr, const char type, const int size) { char *end; - if (type == 'I') { + const char type_uppercase = std::toupper(type, std::locale()); + if (type_uppercase == 'I') { return (double)std::strtol(data_ptr, &end, 0); - } else if (type == 'U') { + } else if (type_uppercase == 'U') { return (double)std::strtoul(data_ptr, &end, 0); - } else if (type == 'F') { + } else if (type_uppercase == 'F') { return std::strtod(data_ptr, &end); } return 0.0; @@ -297,13 +299,14 @@ Eigen::Vector3d UnpackASCIIPCDColor(const char *data_ptr, if (size == 4) { std::uint8_t data[4] = {0, 0, 0, 0}; char *end; - if (type == 'I') { + const char type_uppercase = std::toupper(type, std::locale()); + if (type_uppercase == 'I') { std::int32_t value = std::strtol(data_ptr, &end, 0); memcpy(data, &value, 4); - } else if (type == 'U') { + } else if (type_uppercase == 'U') { std::uint32_t value = std::strtoul(data_ptr, &end, 0); memcpy(data, &value, 4); - } else if (type == 'F') { + } else if (type_uppercase == 'F') { float value = std::strtof(data_ptr, &end); memcpy(data, &value, 4); } diff --git a/cpp/open3d/io/file_format/FilePLY.cpp b/cpp/open3d/io/file_format/FilePLY.cpp index fa4cd73b027..fc2d9212281 100644 --- a/cpp/open3d/io/file_format/FilePLY.cpp +++ b/cpp/open3d/io/file_format/FilePLY.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/file_format/FilePNG.cpp b/cpp/open3d/io/file_format/FilePNG.cpp index 55a7e410eda..e261c635ca1 100644 --- a/cpp/open3d/io/file_format/FilePNG.cpp +++ b/cpp/open3d/io/file_format/FilePNG.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/file_format/FilePTS.cpp b/cpp/open3d/io/file_format/FilePTS.cpp index 3773bd7fe5b..0d1f5545da2 100644 --- a/cpp/open3d/io/file_format/FilePTS.cpp +++ b/cpp/open3d/io/file_format/FilePTS.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/file_format/FileSTL.cpp b/cpp/open3d/io/file_format/FileSTL.cpp index ed73697c302..e8144414770 100644 --- a/cpp/open3d/io/file_format/FileSTL.cpp +++ b/cpp/open3d/io/file_format/FileSTL.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/file_format/FileTUM.cpp b/cpp/open3d/io/file_format/FileTUM.cpp index 53ba84fc650..f17bb1d25e6 100644 --- a/cpp/open3d/io/file_format/FileTUM.cpp +++ b/cpp/open3d/io/file_format/FileTUM.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/file_format/FileXYZ.cpp b/cpp/open3d/io/file_format/FileXYZ.cpp index ceaa00245f2..a20035c0cd9 100644 --- a/cpp/open3d/io/file_format/FileXYZ.cpp +++ b/cpp/open3d/io/file_format/FileXYZ.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/file_format/FileXYZN.cpp b/cpp/open3d/io/file_format/FileXYZN.cpp index 7dc92850982..a2579bddca2 100644 --- a/cpp/open3d/io/file_format/FileXYZN.cpp +++ b/cpp/open3d/io/file_format/FileXYZN.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/file_format/FileXYZRGB.cpp b/cpp/open3d/io/file_format/FileXYZRGB.cpp index 26a62fcd28f..7714574d44c 100644 --- a/cpp/open3d/io/file_format/FileXYZRGB.cpp +++ b/cpp/open3d/io/file_format/FileXYZRGB.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/rpc/BufferConnection.cpp b/cpp/open3d/io/rpc/BufferConnection.cpp index fcc5d29e2bd..2ea5b7da5d2 100644 --- a/cpp/open3d/io/rpc/BufferConnection.cpp +++ b/cpp/open3d/io/rpc/BufferConnection.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/rpc/BufferConnection.h b/cpp/open3d/io/rpc/BufferConnection.h index aacec80e928..0af6073c206 100644 --- a/cpp/open3d/io/rpc/BufferConnection.h +++ b/cpp/open3d/io/rpc/BufferConnection.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/rpc/Connection.cpp b/cpp/open3d/io/rpc/Connection.cpp index c0d80b4d9fe..f4446c85628 100644 --- a/cpp/open3d/io/rpc/Connection.cpp +++ b/cpp/open3d/io/rpc/Connection.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/rpc/Connection.h b/cpp/open3d/io/rpc/Connection.h index fb5fcd63bbe..20c2f4c9ef0 100644 --- a/cpp/open3d/io/rpc/Connection.h +++ b/cpp/open3d/io/rpc/Connection.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/rpc/ConnectionBase.h b/cpp/open3d/io/rpc/ConnectionBase.h index ed977410680..94d0d67b0b0 100644 --- a/cpp/open3d/io/rpc/ConnectionBase.h +++ b/cpp/open3d/io/rpc/ConnectionBase.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/rpc/DummyMessageProcessor.h b/cpp/open3d/io/rpc/DummyMessageProcessor.h index 55a8d71229e..f57a955b609 100644 --- a/cpp/open3d/io/rpc/DummyMessageProcessor.h +++ b/cpp/open3d/io/rpc/DummyMessageProcessor.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/rpc/DummyReceiver.cpp b/cpp/open3d/io/rpc/DummyReceiver.cpp index ce10e6d94e8..785184ec147 100644 --- a/cpp/open3d/io/rpc/DummyReceiver.cpp +++ b/cpp/open3d/io/rpc/DummyReceiver.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/rpc/DummyReceiver.h b/cpp/open3d/io/rpc/DummyReceiver.h index c1a73f74730..71eef978b5b 100644 --- a/cpp/open3d/io/rpc/DummyReceiver.h +++ b/cpp/open3d/io/rpc/DummyReceiver.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/rpc/MessageProcessorBase.cpp b/cpp/open3d/io/rpc/MessageProcessorBase.cpp index 6bd8d3345b0..3097500ffa2 100644 --- a/cpp/open3d/io/rpc/MessageProcessorBase.cpp +++ b/cpp/open3d/io/rpc/MessageProcessorBase.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/rpc/MessageProcessorBase.h b/cpp/open3d/io/rpc/MessageProcessorBase.h index d0869b0252a..0bd332d6b3a 100644 --- a/cpp/open3d/io/rpc/MessageProcessorBase.h +++ b/cpp/open3d/io/rpc/MessageProcessorBase.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/rpc/MessageUtils.cpp b/cpp/open3d/io/rpc/MessageUtils.cpp index 10cb9375dfb..91cf8bf55a3 100644 --- a/cpp/open3d/io/rpc/MessageUtils.cpp +++ b/cpp/open3d/io/rpc/MessageUtils.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/rpc/MessageUtils.h b/cpp/open3d/io/rpc/MessageUtils.h index 9c529fe3776..16a191a2636 100644 --- a/cpp/open3d/io/rpc/MessageUtils.h +++ b/cpp/open3d/io/rpc/MessageUtils.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/rpc/Messages.h b/cpp/open3d/io/rpc/Messages.h index 06f6c7fe933..674cc981089 100644 --- a/cpp/open3d/io/rpc/Messages.h +++ b/cpp/open3d/io/rpc/Messages.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/rpc/RemoteFunctions.cpp b/cpp/open3d/io/rpc/RemoteFunctions.cpp index 9fcf9805f70..ec6a6de8aef 100644 --- a/cpp/open3d/io/rpc/RemoteFunctions.cpp +++ b/cpp/open3d/io/rpc/RemoteFunctions.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/rpc/RemoteFunctions.h b/cpp/open3d/io/rpc/RemoteFunctions.h index cc75b3d9cac..f9e42fac280 100644 --- a/cpp/open3d/io/rpc/RemoteFunctions.h +++ b/cpp/open3d/io/rpc/RemoteFunctions.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/rpc/ZMQContext.cpp b/cpp/open3d/io/rpc/ZMQContext.cpp index 1d537b2ceb1..102d57f1875 100644 --- a/cpp/open3d/io/rpc/ZMQContext.cpp +++ b/cpp/open3d/io/rpc/ZMQContext.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/rpc/ZMQContext.h b/cpp/open3d/io/rpc/ZMQContext.h index 78b584dfbc1..9034b24eb32 100644 --- a/cpp/open3d/io/rpc/ZMQContext.h +++ b/cpp/open3d/io/rpc/ZMQContext.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/rpc/ZMQReceiver.cpp b/cpp/open3d/io/rpc/ZMQReceiver.cpp index 333c546bcd9..4f72310883c 100644 --- a/cpp/open3d/io/rpc/ZMQReceiver.cpp +++ b/cpp/open3d/io/rpc/ZMQReceiver.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/rpc/ZMQReceiver.h b/cpp/open3d/io/rpc/ZMQReceiver.h index f7f6d091f76..eb3bf21f54e 100644 --- a/cpp/open3d/io/rpc/ZMQReceiver.h +++ b/cpp/open3d/io/rpc/ZMQReceiver.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/sensor/RGBDRecorder.h b/cpp/open3d/io/sensor/RGBDRecorder.h index f13d6eb7546..e444d881dae 100644 --- a/cpp/open3d/io/sensor/RGBDRecorder.h +++ b/cpp/open3d/io/sensor/RGBDRecorder.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/sensor/RGBDSensor.h b/cpp/open3d/io/sensor/RGBDSensor.h index 977bdc03821..0119916828b 100644 --- a/cpp/open3d/io/sensor/RGBDSensor.h +++ b/cpp/open3d/io/sensor/RGBDSensor.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/sensor/RGBDSensorConfig.h b/cpp/open3d/io/sensor/RGBDSensorConfig.h index 96e26b69f31..9b6f70e85cd 100644 --- a/cpp/open3d/io/sensor/RGBDSensorConfig.h +++ b/cpp/open3d/io/sensor/RGBDSensorConfig.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/sensor/azure_kinect/AzureKinectRecorder.cpp b/cpp/open3d/io/sensor/azure_kinect/AzureKinectRecorder.cpp index 8c8a9f41571..0ff6ef1135b 100644 --- a/cpp/open3d/io/sensor/azure_kinect/AzureKinectRecorder.cpp +++ b/cpp/open3d/io/sensor/azure_kinect/AzureKinectRecorder.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/sensor/azure_kinect/AzureKinectRecorder.h b/cpp/open3d/io/sensor/azure_kinect/AzureKinectRecorder.h index 0fecd26e0cb..7a973506503 100644 --- a/cpp/open3d/io/sensor/azure_kinect/AzureKinectRecorder.h +++ b/cpp/open3d/io/sensor/azure_kinect/AzureKinectRecorder.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/sensor/azure_kinect/AzureKinectSensor.cpp b/cpp/open3d/io/sensor/azure_kinect/AzureKinectSensor.cpp index 962113b2df3..92d06eac28a 100644 --- a/cpp/open3d/io/sensor/azure_kinect/AzureKinectSensor.cpp +++ b/cpp/open3d/io/sensor/azure_kinect/AzureKinectSensor.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/sensor/azure_kinect/AzureKinectSensor.h b/cpp/open3d/io/sensor/azure_kinect/AzureKinectSensor.h index eb795432860..2fadf38dbad 100644 --- a/cpp/open3d/io/sensor/azure_kinect/AzureKinectSensor.h +++ b/cpp/open3d/io/sensor/azure_kinect/AzureKinectSensor.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/sensor/azure_kinect/AzureKinectSensorConfig.cpp b/cpp/open3d/io/sensor/azure_kinect/AzureKinectSensorConfig.cpp index bb28b55def8..a2a8cf5ad89 100644 --- a/cpp/open3d/io/sensor/azure_kinect/AzureKinectSensorConfig.cpp +++ b/cpp/open3d/io/sensor/azure_kinect/AzureKinectSensorConfig.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/sensor/azure_kinect/AzureKinectSensorConfig.h b/cpp/open3d/io/sensor/azure_kinect/AzureKinectSensorConfig.h index 28dd15c90f7..6e4f7767ed3 100644 --- a/cpp/open3d/io/sensor/azure_kinect/AzureKinectSensorConfig.h +++ b/cpp/open3d/io/sensor/azure_kinect/AzureKinectSensorConfig.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/sensor/azure_kinect/K4aPlugin.cpp b/cpp/open3d/io/sensor/azure_kinect/K4aPlugin.cpp index 71b28bed59d..34b7e30ed19 100644 --- a/cpp/open3d/io/sensor/azure_kinect/K4aPlugin.cpp +++ b/cpp/open3d/io/sensor/azure_kinect/K4aPlugin.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/sensor/azure_kinect/K4aPlugin.h b/cpp/open3d/io/sensor/azure_kinect/K4aPlugin.h index 15e461d4285..fbca95dd71b 100644 --- a/cpp/open3d/io/sensor/azure_kinect/K4aPlugin.h +++ b/cpp/open3d/io/sensor/azure_kinect/K4aPlugin.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/sensor/azure_kinect/MKVMetadata.cpp b/cpp/open3d/io/sensor/azure_kinect/MKVMetadata.cpp index c3b26726668..16ce06a0f87 100644 --- a/cpp/open3d/io/sensor/azure_kinect/MKVMetadata.cpp +++ b/cpp/open3d/io/sensor/azure_kinect/MKVMetadata.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/sensor/azure_kinect/MKVMetadata.h b/cpp/open3d/io/sensor/azure_kinect/MKVMetadata.h index e74bc9fc8d0..02e2ed06a10 100644 --- a/cpp/open3d/io/sensor/azure_kinect/MKVMetadata.h +++ b/cpp/open3d/io/sensor/azure_kinect/MKVMetadata.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/sensor/azure_kinect/MKVReader.cpp b/cpp/open3d/io/sensor/azure_kinect/MKVReader.cpp index 74dae9b5728..fe94cf65bf0 100644 --- a/cpp/open3d/io/sensor/azure_kinect/MKVReader.cpp +++ b/cpp/open3d/io/sensor/azure_kinect/MKVReader.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/sensor/azure_kinect/MKVReader.h b/cpp/open3d/io/sensor/azure_kinect/MKVReader.h index 14e5b25c2a4..0e86cf8aec6 100644 --- a/cpp/open3d/io/sensor/azure_kinect/MKVReader.h +++ b/cpp/open3d/io/sensor/azure_kinect/MKVReader.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/sensor/azure_kinect/MKVWriter.cpp b/cpp/open3d/io/sensor/azure_kinect/MKVWriter.cpp index 2546b6ea897..81864bc12b3 100644 --- a/cpp/open3d/io/sensor/azure_kinect/MKVWriter.cpp +++ b/cpp/open3d/io/sensor/azure_kinect/MKVWriter.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/sensor/azure_kinect/MKVWriter.h b/cpp/open3d/io/sensor/azure_kinect/MKVWriter.h index f2ddcb17b50..961cf02989a 100644 --- a/cpp/open3d/io/sensor/azure_kinect/MKVWriter.h +++ b/cpp/open3d/io/sensor/azure_kinect/MKVWriter.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/io/sensor/azure_kinect/PluginMacros.h b/cpp/open3d/io/sensor/azure_kinect/PluginMacros.h index be28bf4eaf3..3af24031819 100644 --- a/cpp/open3d/io/sensor/azure_kinect/PluginMacros.h +++ b/cpp/open3d/io/sensor/azure_kinect/PluginMacros.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/Helper.h b/cpp/open3d/ml/Helper.h index c305ca24e0e..4193cfac984 100644 --- a/cpp/open3d/ml/Helper.h +++ b/cpp/open3d/ml/Helper.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/ShapeChecking.h b/cpp/open3d/ml/ShapeChecking.h index 8a2d643613f..c978b4af573 100644 --- a/cpp/open3d/ml/ShapeChecking.h +++ b/cpp/open3d/ml/ShapeChecking.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/contrib/BallQuery.cu b/cpp/open3d/ml/contrib/BallQuery.cu index cb315de98fe..c68877765f5 100644 --- a/cpp/open3d/ml/contrib/BallQuery.cu +++ b/cpp/open3d/ml/contrib/BallQuery.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/contrib/BallQuery.cuh b/cpp/open3d/ml/contrib/BallQuery.cuh index fb51fbf580b..67d2c48a242 100644 --- a/cpp/open3d/ml/contrib/BallQuery.cuh +++ b/cpp/open3d/ml/contrib/BallQuery.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/contrib/Cloud.cpp b/cpp/open3d/ml/contrib/Cloud.cpp index a7d1acb730a..576927fe232 100644 --- a/cpp/open3d/ml/contrib/Cloud.cpp +++ b/cpp/open3d/ml/contrib/Cloud.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // Source code from: https://github.com/HuguesTHOMAS/KPConv. diff --git a/cpp/open3d/ml/contrib/Cloud.h b/cpp/open3d/ml/contrib/Cloud.h index 017b0daa3cd..ca13718e064 100644 --- a/cpp/open3d/ml/contrib/Cloud.h +++ b/cpp/open3d/ml/contrib/Cloud.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // Source code from: https://github.com/HuguesTHOMAS/KPConv. diff --git a/cpp/open3d/ml/contrib/GridSubsampling.cpp b/cpp/open3d/ml/contrib/GridSubsampling.cpp index cc845211ebb..7b74d9a44e1 100644 --- a/cpp/open3d/ml/contrib/GridSubsampling.cpp +++ b/cpp/open3d/ml/contrib/GridSubsampling.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // Source code from: https://github.com/HuguesTHOMAS/KPConv. diff --git a/cpp/open3d/ml/contrib/GridSubsampling.h b/cpp/open3d/ml/contrib/GridSubsampling.h index 09c62805d89..7c484fddca1 100644 --- a/cpp/open3d/ml/contrib/GridSubsampling.h +++ b/cpp/open3d/ml/contrib/GridSubsampling.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // Source code from: https://github.com/HuguesTHOMAS/KPConv. diff --git a/cpp/open3d/ml/contrib/InterpolatePoints.cu b/cpp/open3d/ml/contrib/InterpolatePoints.cu index b55991366ba..12417e39037 100644 --- a/cpp/open3d/ml/contrib/InterpolatePoints.cu +++ b/cpp/open3d/ml/contrib/InterpolatePoints.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/contrib/InterpolatePoints.cuh b/cpp/open3d/ml/contrib/InterpolatePoints.cuh index 694d57a53bb..ab18c4cfbd5 100644 --- a/cpp/open3d/ml/contrib/InterpolatePoints.cuh +++ b/cpp/open3d/ml/contrib/InterpolatePoints.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/contrib/IoU.cpp b/cpp/open3d/ml/contrib/IoU.cpp index 8ce9088df51..4abd32ceb6c 100644 --- a/cpp/open3d/ml/contrib/IoU.cpp +++ b/cpp/open3d/ml/contrib/IoU.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/contrib/IoU.cu b/cpp/open3d/ml/contrib/IoU.cu index 48d594b6a0b..5c11ed9dc19 100644 --- a/cpp/open3d/ml/contrib/IoU.cu +++ b/cpp/open3d/ml/contrib/IoU.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/contrib/IoU.h b/cpp/open3d/ml/contrib/IoU.h index df2cbcec9e8..f97ea34003e 100644 --- a/cpp/open3d/ml/contrib/IoU.h +++ b/cpp/open3d/ml/contrib/IoU.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/contrib/IoUImpl.h b/cpp/open3d/ml/contrib/IoUImpl.h index 80741309515..6a2d90b4f8a 100644 --- a/cpp/open3d/ml/contrib/IoUImpl.h +++ b/cpp/open3d/ml/contrib/IoUImpl.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/contrib/Nms.cpp b/cpp/open3d/ml/contrib/Nms.cpp index c1ff5e3b9ca..94a35874e36 100644 --- a/cpp/open3d/ml/contrib/Nms.cpp +++ b/cpp/open3d/ml/contrib/Nms.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/contrib/Nms.cu b/cpp/open3d/ml/contrib/Nms.cu index 3f3c52a1d90..5acdb949cd7 100644 --- a/cpp/open3d/ml/contrib/Nms.cu +++ b/cpp/open3d/ml/contrib/Nms.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/contrib/Nms.h b/cpp/open3d/ml/contrib/Nms.h index 914289ff82d..c7a2f84e452 100644 --- a/cpp/open3d/ml/contrib/Nms.h +++ b/cpp/open3d/ml/contrib/Nms.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/contrib/PointSampling.cuh b/cpp/open3d/ml/contrib/PointSampling.cuh index d17f3501b58..88e525aeb88 100644 --- a/cpp/open3d/ml/contrib/PointSampling.cuh +++ b/cpp/open3d/ml/contrib/PointSampling.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/contrib/RoiPoolKernel.cu b/cpp/open3d/ml/contrib/RoiPoolKernel.cu index 7b633070034..208772851c9 100644 --- a/cpp/open3d/ml/contrib/RoiPoolKernel.cu +++ b/cpp/open3d/ml/contrib/RoiPoolKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- //***************************************************************************************/ diff --git a/cpp/open3d/ml/contrib/RoiPoolKernel.h b/cpp/open3d/ml/contrib/RoiPoolKernel.h index 123d31a13cb..393150a5cc1 100644 --- a/cpp/open3d/ml/contrib/RoiPoolKernel.h +++ b/cpp/open3d/ml/contrib/RoiPoolKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- //***************************************************************************************/ diff --git a/cpp/open3d/ml/contrib/TrilinearDevoxelize.cu b/cpp/open3d/ml/contrib/TrilinearDevoxelize.cu index 0cc1dff271b..abe9c4b8593 100644 --- a/cpp/open3d/ml/contrib/TrilinearDevoxelize.cu +++ b/cpp/open3d/ml/contrib/TrilinearDevoxelize.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/contrib/TrilinearDevoxelize.cuh b/cpp/open3d/ml/contrib/TrilinearDevoxelize.cuh index bb3fc8d7ea7..093caf84e5a 100644 --- a/cpp/open3d/ml/contrib/TrilinearDevoxelize.cuh +++ b/cpp/open3d/ml/contrib/TrilinearDevoxelize.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/contrib/cuda_utils.h b/cpp/open3d/ml/contrib/cuda_utils.h index e7069c79a00..63b7ee40818 100644 --- a/cpp/open3d/ml/contrib/cuda_utils.h +++ b/cpp/open3d/ml/contrib/cuda_utils.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- //***************************************************************************************/ diff --git a/cpp/open3d/ml/impl/continuous_conv/ContinuousConv.cuh b/cpp/open3d/ml/impl/continuous_conv/ContinuousConv.cuh index 42025064423..322b38180ff 100644 --- a/cpp/open3d/ml/impl/continuous_conv/ContinuousConv.cuh +++ b/cpp/open3d/ml/impl/continuous_conv/ContinuousConv.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/continuous_conv/ContinuousConv.h b/cpp/open3d/ml/impl/continuous_conv/ContinuousConv.h index eef2f4e702e..570cdd84730 100644 --- a/cpp/open3d/ml/impl/continuous_conv/ContinuousConv.h +++ b/cpp/open3d/ml/impl/continuous_conv/ContinuousConv.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/continuous_conv/ContinuousConvBackpropFilter.cuh b/cpp/open3d/ml/impl/continuous_conv/ContinuousConvBackpropFilter.cuh index c40ae43874e..ef03b9f0540 100644 --- a/cpp/open3d/ml/impl/continuous_conv/ContinuousConvBackpropFilter.cuh +++ b/cpp/open3d/ml/impl/continuous_conv/ContinuousConvBackpropFilter.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/continuous_conv/ContinuousConvBackpropFilter.h b/cpp/open3d/ml/impl/continuous_conv/ContinuousConvBackpropFilter.h index b9b37e9410c..b75089cd889 100644 --- a/cpp/open3d/ml/impl/continuous_conv/ContinuousConvBackpropFilter.h +++ b/cpp/open3d/ml/impl/continuous_conv/ContinuousConvBackpropFilter.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/continuous_conv/ContinuousConvCUDAKernels.cu b/cpp/open3d/ml/impl/continuous_conv/ContinuousConvCUDAKernels.cu index 9b0498a70b2..218e4c2b6e4 100644 --- a/cpp/open3d/ml/impl/continuous_conv/ContinuousConvCUDAKernels.cu +++ b/cpp/open3d/ml/impl/continuous_conv/ContinuousConvCUDAKernels.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/continuous_conv/ContinuousConvCUDAKernels.h b/cpp/open3d/ml/impl/continuous_conv/ContinuousConvCUDAKernels.h index 4013d093022..8cf1fb14417 100644 --- a/cpp/open3d/ml/impl/continuous_conv/ContinuousConvCUDAKernels.h +++ b/cpp/open3d/ml/impl/continuous_conv/ContinuousConvCUDAKernels.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/continuous_conv/ContinuousConvTranspose.cuh b/cpp/open3d/ml/impl/continuous_conv/ContinuousConvTranspose.cuh index 1c362eb8a2f..29d8aba31e3 100644 --- a/cpp/open3d/ml/impl/continuous_conv/ContinuousConvTranspose.cuh +++ b/cpp/open3d/ml/impl/continuous_conv/ContinuousConvTranspose.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/continuous_conv/ContinuousConvTranspose.h b/cpp/open3d/ml/impl/continuous_conv/ContinuousConvTranspose.h index 960800e7980..1a19cdc4034 100644 --- a/cpp/open3d/ml/impl/continuous_conv/ContinuousConvTranspose.h +++ b/cpp/open3d/ml/impl/continuous_conv/ContinuousConvTranspose.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/continuous_conv/ContinuousConvTransposeBackpropFilter.cuh b/cpp/open3d/ml/impl/continuous_conv/ContinuousConvTransposeBackpropFilter.cuh index 8d06fe9284a..2c1dc7a1680 100644 --- a/cpp/open3d/ml/impl/continuous_conv/ContinuousConvTransposeBackpropFilter.cuh +++ b/cpp/open3d/ml/impl/continuous_conv/ContinuousConvTransposeBackpropFilter.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/continuous_conv/ContinuousConvTransposeBackpropFilter.h b/cpp/open3d/ml/impl/continuous_conv/ContinuousConvTransposeBackpropFilter.h index 251f59cdf18..296850f24a2 100644 --- a/cpp/open3d/ml/impl/continuous_conv/ContinuousConvTransposeBackpropFilter.h +++ b/cpp/open3d/ml/impl/continuous_conv/ContinuousConvTransposeBackpropFilter.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/continuous_conv/ContinuousConvTypes.h b/cpp/open3d/ml/impl/continuous_conv/ContinuousConvTypes.h index 13919c7d2f4..d758d134443 100644 --- a/cpp/open3d/ml/impl/continuous_conv/ContinuousConvTypes.h +++ b/cpp/open3d/ml/impl/continuous_conv/ContinuousConvTypes.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/continuous_conv/CoordinateTransformation.cuh b/cpp/open3d/ml/impl/continuous_conv/CoordinateTransformation.cuh index 672b349a1f5..a56b73ee8ee 100644 --- a/cpp/open3d/ml/impl/continuous_conv/CoordinateTransformation.cuh +++ b/cpp/open3d/ml/impl/continuous_conv/CoordinateTransformation.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/continuous_conv/CoordinateTransformation.h b/cpp/open3d/ml/impl/continuous_conv/CoordinateTransformation.h index a7d0eec37f2..ca3670774f8 100644 --- a/cpp/open3d/ml/impl/continuous_conv/CoordinateTransformation.h +++ b/cpp/open3d/ml/impl/continuous_conv/CoordinateTransformation.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/misc/InvertNeighborsList.cuh b/cpp/open3d/ml/impl/misc/InvertNeighborsList.cuh index b94a454b62a..20123b4375f 100644 --- a/cpp/open3d/ml/impl/misc/InvertNeighborsList.cuh +++ b/cpp/open3d/ml/impl/misc/InvertNeighborsList.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/misc/InvertNeighborsList.h b/cpp/open3d/ml/impl/misc/InvertNeighborsList.h index 212fedfbae6..0715c744c74 100644 --- a/cpp/open3d/ml/impl/misc/InvertNeighborsList.h +++ b/cpp/open3d/ml/impl/misc/InvertNeighborsList.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/misc/MemoryAllocation.h b/cpp/open3d/ml/impl/misc/MemoryAllocation.h index 2d240da4ac6..5ec00e0e600 100644 --- a/cpp/open3d/ml/impl/misc/MemoryAllocation.h +++ b/cpp/open3d/ml/impl/misc/MemoryAllocation.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/misc/NeighborSearchCommon.h b/cpp/open3d/ml/impl/misc/NeighborSearchCommon.h index c93cce0d151..4f1d1b740b8 100644 --- a/cpp/open3d/ml/impl/misc/NeighborSearchCommon.h +++ b/cpp/open3d/ml/impl/misc/NeighborSearchCommon.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/misc/RaggedToDense.cuh b/cpp/open3d/ml/impl/misc/RaggedToDense.cuh index 4cf30555f0f..95abffe2b4b 100644 --- a/cpp/open3d/ml/impl/misc/RaggedToDense.cuh +++ b/cpp/open3d/ml/impl/misc/RaggedToDense.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/misc/RaggedToDense.h b/cpp/open3d/ml/impl/misc/RaggedToDense.h index 5fcccfb87ef..5c3be2a1f0c 100644 --- a/cpp/open3d/ml/impl/misc/RaggedToDense.h +++ b/cpp/open3d/ml/impl/misc/RaggedToDense.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/misc/ReduceSubarraysSum.cuh b/cpp/open3d/ml/impl/misc/ReduceSubarraysSum.cuh index fafff52641f..ac901660206 100644 --- a/cpp/open3d/ml/impl/misc/ReduceSubarraysSum.cuh +++ b/cpp/open3d/ml/impl/misc/ReduceSubarraysSum.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/misc/ReduceSubarraysSum.h b/cpp/open3d/ml/impl/misc/ReduceSubarraysSum.h index d268692b63e..b51a3e14c46 100644 --- a/cpp/open3d/ml/impl/misc/ReduceSubarraysSum.h +++ b/cpp/open3d/ml/impl/misc/ReduceSubarraysSum.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/misc/VoxelPooling.h b/cpp/open3d/ml/impl/misc/VoxelPooling.h index bd8f73d8990..4da3da4d002 100644 --- a/cpp/open3d/ml/impl/misc/VoxelPooling.h +++ b/cpp/open3d/ml/impl/misc/VoxelPooling.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/misc/Voxelize.cuh b/cpp/open3d/ml/impl/misc/Voxelize.cuh index e7b50cd7f6e..2258175cf84 100644 --- a/cpp/open3d/ml/impl/misc/Voxelize.cuh +++ b/cpp/open3d/ml/impl/misc/Voxelize.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/misc/Voxelize.h b/cpp/open3d/ml/impl/misc/Voxelize.h index 36814c5db55..c02fb0f7779 100644 --- a/cpp/open3d/ml/impl/misc/Voxelize.h +++ b/cpp/open3d/ml/impl/misc/Voxelize.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/sparse_conv/SparseConv.cuh b/cpp/open3d/ml/impl/sparse_conv/SparseConv.cuh index 16df749064f..3bbc297db24 100644 --- a/cpp/open3d/ml/impl/sparse_conv/SparseConv.cuh +++ b/cpp/open3d/ml/impl/sparse_conv/SparseConv.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/sparse_conv/SparseConv.h b/cpp/open3d/ml/impl/sparse_conv/SparseConv.h index 50fa3e098b2..d8b59a51a43 100644 --- a/cpp/open3d/ml/impl/sparse_conv/SparseConv.h +++ b/cpp/open3d/ml/impl/sparse_conv/SparseConv.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/sparse_conv/SparseConvBackpropFilter.cuh b/cpp/open3d/ml/impl/sparse_conv/SparseConvBackpropFilter.cuh index 0e151f8c58e..5dc0e6973cb 100644 --- a/cpp/open3d/ml/impl/sparse_conv/SparseConvBackpropFilter.cuh +++ b/cpp/open3d/ml/impl/sparse_conv/SparseConvBackpropFilter.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/sparse_conv/SparseConvBackpropFilter.h b/cpp/open3d/ml/impl/sparse_conv/SparseConvBackpropFilter.h index 67a2712f556..38c44a5d2c1 100644 --- a/cpp/open3d/ml/impl/sparse_conv/SparseConvBackpropFilter.h +++ b/cpp/open3d/ml/impl/sparse_conv/SparseConvBackpropFilter.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/sparse_conv/SparseConvCUDAKernels.cu b/cpp/open3d/ml/impl/sparse_conv/SparseConvCUDAKernels.cu index c111a38502f..87d11ba3a3a 100644 --- a/cpp/open3d/ml/impl/sparse_conv/SparseConvCUDAKernels.cu +++ b/cpp/open3d/ml/impl/sparse_conv/SparseConvCUDAKernels.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/sparse_conv/SparseConvCUDAKernels.h b/cpp/open3d/ml/impl/sparse_conv/SparseConvCUDAKernels.h index 887e6a21a5b..cf1c4749f9c 100644 --- a/cpp/open3d/ml/impl/sparse_conv/SparseConvCUDAKernels.h +++ b/cpp/open3d/ml/impl/sparse_conv/SparseConvCUDAKernels.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/sparse_conv/SparseConvTranspose.cuh b/cpp/open3d/ml/impl/sparse_conv/SparseConvTranspose.cuh index f5946ff248b..efd0a51152a 100644 --- a/cpp/open3d/ml/impl/sparse_conv/SparseConvTranspose.cuh +++ b/cpp/open3d/ml/impl/sparse_conv/SparseConvTranspose.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/sparse_conv/SparseConvTranspose.h b/cpp/open3d/ml/impl/sparse_conv/SparseConvTranspose.h index 641ad132a4f..5a8eb5be3ef 100644 --- a/cpp/open3d/ml/impl/sparse_conv/SparseConvTranspose.h +++ b/cpp/open3d/ml/impl/sparse_conv/SparseConvTranspose.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/sparse_conv/SparseConvTransposeBackpropFilter.cuh b/cpp/open3d/ml/impl/sparse_conv/SparseConvTransposeBackpropFilter.cuh index bb628b60764..3c6f546a079 100644 --- a/cpp/open3d/ml/impl/sparse_conv/SparseConvTransposeBackpropFilter.cuh +++ b/cpp/open3d/ml/impl/sparse_conv/SparseConvTransposeBackpropFilter.cuh @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/impl/sparse_conv/SparseConvTransposeBackpropFilter.h b/cpp/open3d/ml/impl/sparse_conv/SparseConvTransposeBackpropFilter.h index d6559844c0b..48ef0e4f334 100644 --- a/cpp/open3d/ml/impl/sparse_conv/SparseConvTransposeBackpropFilter.h +++ b/cpp/open3d/ml/impl/sparse_conv/SparseConvTransposeBackpropFilter.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/pytorch/CMakeLists.txt b/cpp/open3d/ml/pytorch/CMakeLists.txt index 3cb75e531de..76e40b82791 100644 --- a/cpp/open3d/ml/pytorch/CMakeLists.txt +++ b/cpp/open3d/ml/pytorch/CMakeLists.txt @@ -128,6 +128,12 @@ set_target_properties(open3d_torch_ops PROPERTIES # Do not add "lib" prefix set_target_properties(open3d_torch_ops PROPERTIES PREFIX "") set_target_properties(open3d_torch_ops PROPERTIES DEBUG_POSTFIX "_debug") +# Set BUILD_RPATH to find tbb. We don't install through cmake. +if (APPLE) + set_target_properties(open3d_torch_ops PROPERTIES BUILD_RPATH "@loader_path/..") +elseif (UNIX) + set_target_properties(open3d_torch_ops PROPERTIES BUILD_RPATH "$ORIGIN/..") +endif() target_include_directories(open3d_torch_ops SYSTEM PRIVATE ${PROJECT_SOURCE_DIR}/cpp @@ -140,7 +146,7 @@ target_link_libraries(open3d_torch_ops PRIVATE Open3D::3rdparty_eigen3 Open3D::3rdparty_fmt Open3D::3rdparty_nanoflann - Open3D::3rdparty_tbb + TBB::tbb ) if (TARGET Open3D::3rdparty_parallelstl) target_link_libraries(open3d_torch_ops PRIVATE @@ -185,7 +191,7 @@ URL: @PROJECT_HOMEPAGE_URL@ Version: @PROJECT_VERSION@ Requires: Open3D = @PROJECT_VERSION@ Cflags: -Libs: -lopen3d_torch_ops]=] @ONLY NEWLINE_STYLE LF) +Libs: -lopen3d_torch_ops -ltbb]=] @ONLY NEWLINE_STYLE LF) file(GENERATE OUTPUT open3d_torch_ops.pc INPUT "${CMAKE_CURRENT_BINARY_DIR}/open3d_torch_ops.pc.in" TARGET open3d_torch_ops) diff --git a/cpp/open3d/ml/pytorch/TorchHelper.h b/cpp/open3d/ml/pytorch/TorchHelper.h index 22f9ed8cd2f..c4de5d5d74e 100644 --- a/cpp/open3d/ml/pytorch/TorchHelper.h +++ b/cpp/open3d/ml/pytorch/TorchHelper.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvBackpropFilterOpKernel.cpp b/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvBackpropFilterOpKernel.cpp index 1e4e754f700..584ff5bb589 100644 --- a/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvBackpropFilterOpKernel.cpp +++ b/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvBackpropFilterOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvBackpropFilterOpKernel.cu b/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvBackpropFilterOpKernel.cu index 83072ce76b6..b4bb6719999 100644 --- a/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvBackpropFilterOpKernel.cu +++ b/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvBackpropFilterOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvBackpropFilterOpKernel.h b/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvBackpropFilterOpKernel.h index 9c4b7a6f6dc..976d6e9181e 100644 --- a/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvBackpropFilterOpKernel.h +++ b/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvBackpropFilterOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvHelper.h b/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvHelper.h index adb4cbd5c6f..b96dcaee219 100644 --- a/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvHelper.h +++ b/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvHelper.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvOpKernel.cpp b/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvOpKernel.cpp index 8cb0c201495..fbd76a4bb61 100644 --- a/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvOpKernel.cpp +++ b/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvOpKernel.cu b/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvOpKernel.cu index 4f8f19143b5..7b7949b7def 100644 --- a/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvOpKernel.cu +++ b/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvOpKernel.h b/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvOpKernel.h index 376fda0a145..e547bc6a365 100644 --- a/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvOpKernel.h +++ b/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvOps.cpp b/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvOps.cpp index e7e662c34c0..8f992b1c49a 100644 --- a/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvOps.cpp +++ b/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvTransposeBackpropFilterOpKernel.cpp b/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvTransposeBackpropFilterOpKernel.cpp index 2420b302df9..e91ca4a51e6 100644 --- a/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvTransposeBackpropFilterOpKernel.cpp +++ b/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvTransposeBackpropFilterOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvTransposeBackpropFilterOpKernel.cu b/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvTransposeBackpropFilterOpKernel.cu index 6ea1d2ed3d5..d70f22a680a 100644 --- a/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvTransposeBackpropFilterOpKernel.cu +++ b/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvTransposeBackpropFilterOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvTransposeBackpropFilterOpKernel.h b/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvTransposeBackpropFilterOpKernel.h index 06db6cb4067..1d7188ba812 100644 --- a/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvTransposeBackpropFilterOpKernel.h +++ b/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvTransposeBackpropFilterOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvTransposeOpKernel.cpp b/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvTransposeOpKernel.cpp index d7ecffea16a..134e14b8eb5 100644 --- a/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvTransposeOpKernel.cpp +++ b/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvTransposeOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvTransposeOpKernel.cu b/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvTransposeOpKernel.cu index bc9e66c89f7..d190c584791 100644 --- a/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvTransposeOpKernel.cu +++ b/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvTransposeOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvTransposeOpKernel.h b/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvTransposeOpKernel.h index 28d8d7400e4..3749d2856ae 100644 --- a/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvTransposeOpKernel.h +++ b/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvTransposeOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvTransposeOps.cpp b/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvTransposeOps.cpp index 78c6ae19f77..55338b2fadf 100644 --- a/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvTransposeOps.cpp +++ b/cpp/open3d/ml/pytorch/continuous_conv/ContinuousConvTransposeOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/BuildSpatialHashTableOpKernel.cpp b/cpp/open3d/ml/pytorch/misc/BuildSpatialHashTableOpKernel.cpp index 3ed9233edf4..78c53314899 100644 --- a/cpp/open3d/ml/pytorch/misc/BuildSpatialHashTableOpKernel.cpp +++ b/cpp/open3d/ml/pytorch/misc/BuildSpatialHashTableOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/BuildSpatialHashTableOpKernel.cu b/cpp/open3d/ml/pytorch/misc/BuildSpatialHashTableOpKernel.cu index bdad3726177..23c95d3088f 100644 --- a/cpp/open3d/ml/pytorch/misc/BuildSpatialHashTableOpKernel.cu +++ b/cpp/open3d/ml/pytorch/misc/BuildSpatialHashTableOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/BuildSpatialHashTableOps.cpp b/cpp/open3d/ml/pytorch/misc/BuildSpatialHashTableOps.cpp index 49a5b8e32a6..02683a68203 100644 --- a/cpp/open3d/ml/pytorch/misc/BuildSpatialHashTableOps.cpp +++ b/cpp/open3d/ml/pytorch/misc/BuildSpatialHashTableOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/FixedRadiusSearchOpKernel.cpp b/cpp/open3d/ml/pytorch/misc/FixedRadiusSearchOpKernel.cpp index 679036e8c1c..6019ad3a1fb 100644 --- a/cpp/open3d/ml/pytorch/misc/FixedRadiusSearchOpKernel.cpp +++ b/cpp/open3d/ml/pytorch/misc/FixedRadiusSearchOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/FixedRadiusSearchOpKernel.cu b/cpp/open3d/ml/pytorch/misc/FixedRadiusSearchOpKernel.cu index 0088897be67..1e5f12b532d 100644 --- a/cpp/open3d/ml/pytorch/misc/FixedRadiusSearchOpKernel.cu +++ b/cpp/open3d/ml/pytorch/misc/FixedRadiusSearchOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/FixedRadiusSearchOps.cpp b/cpp/open3d/ml/pytorch/misc/FixedRadiusSearchOps.cpp index 289c52687e8..4b517ec9f0c 100644 --- a/cpp/open3d/ml/pytorch/misc/FixedRadiusSearchOps.cpp +++ b/cpp/open3d/ml/pytorch/misc/FixedRadiusSearchOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/InvertNeighborsListOpKernel.cpp b/cpp/open3d/ml/pytorch/misc/InvertNeighborsListOpKernel.cpp index ca460507223..134f9eeb0f1 100644 --- a/cpp/open3d/ml/pytorch/misc/InvertNeighborsListOpKernel.cpp +++ b/cpp/open3d/ml/pytorch/misc/InvertNeighborsListOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/InvertNeighborsListOpKernel.cu b/cpp/open3d/ml/pytorch/misc/InvertNeighborsListOpKernel.cu index c5257ba2db9..6f66561869a 100644 --- a/cpp/open3d/ml/pytorch/misc/InvertNeighborsListOpKernel.cu +++ b/cpp/open3d/ml/pytorch/misc/InvertNeighborsListOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/InvertNeighborsListOpKernel.h b/cpp/open3d/ml/pytorch/misc/InvertNeighborsListOpKernel.h index 28fb53ed469..499bf8b193b 100644 --- a/cpp/open3d/ml/pytorch/misc/InvertNeighborsListOpKernel.h +++ b/cpp/open3d/ml/pytorch/misc/InvertNeighborsListOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/InvertNeighborsListOps.cpp b/cpp/open3d/ml/pytorch/misc/InvertNeighborsListOps.cpp index 4389447a571..247e2b3ecc1 100644 --- a/cpp/open3d/ml/pytorch/misc/InvertNeighborsListOps.cpp +++ b/cpp/open3d/ml/pytorch/misc/InvertNeighborsListOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/InvertNeighborsListOps.h b/cpp/open3d/ml/pytorch/misc/InvertNeighborsListOps.h index 738fd455dc9..d61502c7fc1 100644 --- a/cpp/open3d/ml/pytorch/misc/InvertNeighborsListOps.h +++ b/cpp/open3d/ml/pytorch/misc/InvertNeighborsListOps.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/KnnSearchOpKernel.cpp b/cpp/open3d/ml/pytorch/misc/KnnSearchOpKernel.cpp index 7ecd8039a50..d78cc1845a3 100644 --- a/cpp/open3d/ml/pytorch/misc/KnnSearchOpKernel.cpp +++ b/cpp/open3d/ml/pytorch/misc/KnnSearchOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/KnnSearchOps.cpp b/cpp/open3d/ml/pytorch/misc/KnnSearchOps.cpp index 295f8551bde..48bed5ccc8e 100644 --- a/cpp/open3d/ml/pytorch/misc/KnnSearchOps.cpp +++ b/cpp/open3d/ml/pytorch/misc/KnnSearchOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/NeighborSearchAllocator.h b/cpp/open3d/ml/pytorch/misc/NeighborSearchAllocator.h index f1666338411..611e8003031 100644 --- a/cpp/open3d/ml/pytorch/misc/NeighborSearchAllocator.h +++ b/cpp/open3d/ml/pytorch/misc/NeighborSearchAllocator.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/NmsOps.cpp b/cpp/open3d/ml/pytorch/misc/NmsOps.cpp index c1427b09cd0..9c7a29f6ffb 100644 --- a/cpp/open3d/ml/pytorch/misc/NmsOps.cpp +++ b/cpp/open3d/ml/pytorch/misc/NmsOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/pytorch/misc/RadiusSearchOpKernel.cpp b/cpp/open3d/ml/pytorch/misc/RadiusSearchOpKernel.cpp index 5a40fb45730..5796b30daac 100644 --- a/cpp/open3d/ml/pytorch/misc/RadiusSearchOpKernel.cpp +++ b/cpp/open3d/ml/pytorch/misc/RadiusSearchOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/RadiusSearchOps.cpp b/cpp/open3d/ml/pytorch/misc/RadiusSearchOps.cpp index 173cb982608..b99c740b1cc 100644 --- a/cpp/open3d/ml/pytorch/misc/RadiusSearchOps.cpp +++ b/cpp/open3d/ml/pytorch/misc/RadiusSearchOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/RaggedToDenseOpKernel.cpp b/cpp/open3d/ml/pytorch/misc/RaggedToDenseOpKernel.cpp index b2ade4863a9..6ac67dbb56b 100644 --- a/cpp/open3d/ml/pytorch/misc/RaggedToDenseOpKernel.cpp +++ b/cpp/open3d/ml/pytorch/misc/RaggedToDenseOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/RaggedToDenseOpKernel.cu b/cpp/open3d/ml/pytorch/misc/RaggedToDenseOpKernel.cu index 878bfccf2bf..aaf26a9efa6 100644 --- a/cpp/open3d/ml/pytorch/misc/RaggedToDenseOpKernel.cu +++ b/cpp/open3d/ml/pytorch/misc/RaggedToDenseOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/RaggedToDenseOpKernel.h b/cpp/open3d/ml/pytorch/misc/RaggedToDenseOpKernel.h index 1d106b5b945..17f75ba89b8 100644 --- a/cpp/open3d/ml/pytorch/misc/RaggedToDenseOpKernel.h +++ b/cpp/open3d/ml/pytorch/misc/RaggedToDenseOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/RaggedToDenseOps.cpp b/cpp/open3d/ml/pytorch/misc/RaggedToDenseOps.cpp index 349e17f41e3..444362c4e26 100644 --- a/cpp/open3d/ml/pytorch/misc/RaggedToDenseOps.cpp +++ b/cpp/open3d/ml/pytorch/misc/RaggedToDenseOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/ReduceSubarraysSumOpKernel.cpp b/cpp/open3d/ml/pytorch/misc/ReduceSubarraysSumOpKernel.cpp index 0aceb671fe7..6f63c583fc9 100644 --- a/cpp/open3d/ml/pytorch/misc/ReduceSubarraysSumOpKernel.cpp +++ b/cpp/open3d/ml/pytorch/misc/ReduceSubarraysSumOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/ReduceSubarraysSumOpKernel.cu b/cpp/open3d/ml/pytorch/misc/ReduceSubarraysSumOpKernel.cu index d1daa755728..6a4c5ee9438 100644 --- a/cpp/open3d/ml/pytorch/misc/ReduceSubarraysSumOpKernel.cu +++ b/cpp/open3d/ml/pytorch/misc/ReduceSubarraysSumOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/ReduceSubarraysSumOpKernel.h b/cpp/open3d/ml/pytorch/misc/ReduceSubarraysSumOpKernel.h index 4a5d259eb1c..ad5a35af778 100644 --- a/cpp/open3d/ml/pytorch/misc/ReduceSubarraysSumOpKernel.h +++ b/cpp/open3d/ml/pytorch/misc/ReduceSubarraysSumOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/ReduceSubarraysSumOps.cpp b/cpp/open3d/ml/pytorch/misc/ReduceSubarraysSumOps.cpp index 420367397cc..445ee943a4d 100644 --- a/cpp/open3d/ml/pytorch/misc/ReduceSubarraysSumOps.cpp +++ b/cpp/open3d/ml/pytorch/misc/ReduceSubarraysSumOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/ReduceSubarraysSumOps.h b/cpp/open3d/ml/pytorch/misc/ReduceSubarraysSumOps.h index 75333d48aeb..54ea8813b3a 100644 --- a/cpp/open3d/ml/pytorch/misc/ReduceSubarraysSumOps.h +++ b/cpp/open3d/ml/pytorch/misc/ReduceSubarraysSumOps.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/RoiPoolOps.cpp b/cpp/open3d/ml/pytorch/misc/RoiPoolOps.cpp index 6f4ffc0ea09..f2d37021e0a 100644 --- a/cpp/open3d/ml/pytorch/misc/RoiPoolOps.cpp +++ b/cpp/open3d/ml/pytorch/misc/RoiPoolOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- //***************************************************************************************/ diff --git a/cpp/open3d/ml/pytorch/misc/VoxelPoolingOpKernel.cpp b/cpp/open3d/ml/pytorch/misc/VoxelPoolingOpKernel.cpp index 52ec16364d9..4eb12beb966 100644 --- a/cpp/open3d/ml/pytorch/misc/VoxelPoolingOpKernel.cpp +++ b/cpp/open3d/ml/pytorch/misc/VoxelPoolingOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/VoxelPoolingOps.cpp b/cpp/open3d/ml/pytorch/misc/VoxelPoolingOps.cpp index 5c4e86b3704..d294229a2ed 100644 --- a/cpp/open3d/ml/pytorch/misc/VoxelPoolingOps.cpp +++ b/cpp/open3d/ml/pytorch/misc/VoxelPoolingOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/VoxelizeOpKernel.cpp b/cpp/open3d/ml/pytorch/misc/VoxelizeOpKernel.cpp index 947d3e133de..431209a26d4 100644 --- a/cpp/open3d/ml/pytorch/misc/VoxelizeOpKernel.cpp +++ b/cpp/open3d/ml/pytorch/misc/VoxelizeOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/VoxelizeOpKernel.cu b/cpp/open3d/ml/pytorch/misc/VoxelizeOpKernel.cu index a704ad30d0a..ec7baf67c1a 100644 --- a/cpp/open3d/ml/pytorch/misc/VoxelizeOpKernel.cu +++ b/cpp/open3d/ml/pytorch/misc/VoxelizeOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/VoxelizeOpKernel.h b/cpp/open3d/ml/pytorch/misc/VoxelizeOpKernel.h index c2668fb4de4..a09eecc8ad0 100644 --- a/cpp/open3d/ml/pytorch/misc/VoxelizeOpKernel.h +++ b/cpp/open3d/ml/pytorch/misc/VoxelizeOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/misc/VoxelizeOps.cpp b/cpp/open3d/ml/pytorch/misc/VoxelizeOps.cpp index 87e7b71c72c..ef13d7b9084 100644 --- a/cpp/open3d/ml/pytorch/misc/VoxelizeOps.cpp +++ b/cpp/open3d/ml/pytorch/misc/VoxelizeOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/pointnet/BallQueryKernel.cu b/cpp/open3d/ml/pytorch/pointnet/BallQueryKernel.cu index adbafde2dc2..37ae7b118c0 100644 --- a/cpp/open3d/ml/pytorch/pointnet/BallQueryKernel.cu +++ b/cpp/open3d/ml/pytorch/pointnet/BallQueryKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- //***************************************************************************************/ diff --git a/cpp/open3d/ml/pytorch/pointnet/BallQueryKernel.h b/cpp/open3d/ml/pytorch/pointnet/BallQueryKernel.h index 9af88c3cc0e..281e7fc5372 100644 --- a/cpp/open3d/ml/pytorch/pointnet/BallQueryKernel.h +++ b/cpp/open3d/ml/pytorch/pointnet/BallQueryKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- //***************************************************************************************/ diff --git a/cpp/open3d/ml/pytorch/pointnet/BallQueryOps.cpp b/cpp/open3d/ml/pytorch/pointnet/BallQueryOps.cpp index 526688e6b59..1e7c872d341 100644 --- a/cpp/open3d/ml/pytorch/pointnet/BallQueryOps.cpp +++ b/cpp/open3d/ml/pytorch/pointnet/BallQueryOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- //***************************************************************************************/ diff --git a/cpp/open3d/ml/pytorch/pointnet/InterpolateKernel.cu b/cpp/open3d/ml/pytorch/pointnet/InterpolateKernel.cu index eaabe8c06f2..42500e7d53f 100644 --- a/cpp/open3d/ml/pytorch/pointnet/InterpolateKernel.cu +++ b/cpp/open3d/ml/pytorch/pointnet/InterpolateKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- //***************************************************************************************/ diff --git a/cpp/open3d/ml/pytorch/pointnet/InterpolateKernel.h b/cpp/open3d/ml/pytorch/pointnet/InterpolateKernel.h index 435342a00d5..830b52173f6 100644 --- a/cpp/open3d/ml/pytorch/pointnet/InterpolateKernel.h +++ b/cpp/open3d/ml/pytorch/pointnet/InterpolateKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- //***************************************************************************************/ diff --git a/cpp/open3d/ml/pytorch/pointnet/InterpolateOps.cpp b/cpp/open3d/ml/pytorch/pointnet/InterpolateOps.cpp index 796542802d9..2de025bcf46 100644 --- a/cpp/open3d/ml/pytorch/pointnet/InterpolateOps.cpp +++ b/cpp/open3d/ml/pytorch/pointnet/InterpolateOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- //***************************************************************************************/ diff --git a/cpp/open3d/ml/pytorch/pointnet/SamplingKernel.cu b/cpp/open3d/ml/pytorch/pointnet/SamplingKernel.cu index bb5b70d9450..b72414acb56 100644 --- a/cpp/open3d/ml/pytorch/pointnet/SamplingKernel.cu +++ b/cpp/open3d/ml/pytorch/pointnet/SamplingKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- //***************************************************************************************/ diff --git a/cpp/open3d/ml/pytorch/pointnet/SamplingKernel.h b/cpp/open3d/ml/pytorch/pointnet/SamplingKernel.h index ae14b3c51d8..fa6879b1e0b 100644 --- a/cpp/open3d/ml/pytorch/pointnet/SamplingKernel.h +++ b/cpp/open3d/ml/pytorch/pointnet/SamplingKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- //***************************************************************************************/ diff --git a/cpp/open3d/ml/pytorch/pointnet/SamplingOps.cpp b/cpp/open3d/ml/pytorch/pointnet/SamplingOps.cpp index 0727d9e645f..8bd422280b5 100644 --- a/cpp/open3d/ml/pytorch/pointnet/SamplingOps.cpp +++ b/cpp/open3d/ml/pytorch/pointnet/SamplingOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- //***************************************************************************************/ diff --git a/cpp/open3d/ml/pytorch/pvcnn/TrilinearDevoxelizeKernel.cu b/cpp/open3d/ml/pytorch/pvcnn/TrilinearDevoxelizeKernel.cu index 496cc2bd35d..8a25bfb5d52 100644 --- a/cpp/open3d/ml/pytorch/pvcnn/TrilinearDevoxelizeKernel.cu +++ b/cpp/open3d/ml/pytorch/pvcnn/TrilinearDevoxelizeKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/pvcnn/TrilinearDevoxelizeKernel.h b/cpp/open3d/ml/pytorch/pvcnn/TrilinearDevoxelizeKernel.h index 1ec2987d953..075bd87bdc1 100644 --- a/cpp/open3d/ml/pytorch/pvcnn/TrilinearDevoxelizeKernel.h +++ b/cpp/open3d/ml/pytorch/pvcnn/TrilinearDevoxelizeKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/pvcnn/TrilinearDevoxelizeOps.cpp b/cpp/open3d/ml/pytorch/pvcnn/TrilinearDevoxelizeOps.cpp index 78f6775d766..19896fbd057 100644 --- a/cpp/open3d/ml/pytorch/pvcnn/TrilinearDevoxelizeOps.cpp +++ b/cpp/open3d/ml/pytorch/pvcnn/TrilinearDevoxelizeOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/ragged_tensor/RaggedTensor.cpp b/cpp/open3d/ml/pytorch/ragged_tensor/RaggedTensor.cpp index 6cfc570ab89..dac299fa34c 100644 --- a/cpp/open3d/ml/pytorch/ragged_tensor/RaggedTensor.cpp +++ b/cpp/open3d/ml/pytorch/ragged_tensor/RaggedTensor.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/pytorch/ragged_tensor/RaggedTensor.h b/cpp/open3d/ml/pytorch/ragged_tensor/RaggedTensor.h index 236ad7f13e6..c8a671a88cf 100644 --- a/cpp/open3d/ml/pytorch/ragged_tensor/RaggedTensor.h +++ b/cpp/open3d/ml/pytorch/ragged_tensor/RaggedTensor.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/pytorch/sparse_conv/SparseConvBackpropFilterOpKernel.cpp b/cpp/open3d/ml/pytorch/sparse_conv/SparseConvBackpropFilterOpKernel.cpp index c42b7f75894..c30cd9acd54 100644 --- a/cpp/open3d/ml/pytorch/sparse_conv/SparseConvBackpropFilterOpKernel.cpp +++ b/cpp/open3d/ml/pytorch/sparse_conv/SparseConvBackpropFilterOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/sparse_conv/SparseConvBackpropFilterOpKernel.cu b/cpp/open3d/ml/pytorch/sparse_conv/SparseConvBackpropFilterOpKernel.cu index 3ca3d982891..09b34d8c2f9 100644 --- a/cpp/open3d/ml/pytorch/sparse_conv/SparseConvBackpropFilterOpKernel.cu +++ b/cpp/open3d/ml/pytorch/sparse_conv/SparseConvBackpropFilterOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/sparse_conv/SparseConvBackpropFilterOpKernel.h b/cpp/open3d/ml/pytorch/sparse_conv/SparseConvBackpropFilterOpKernel.h index 5e142c8b8bc..8af1a89e143 100644 --- a/cpp/open3d/ml/pytorch/sparse_conv/SparseConvBackpropFilterOpKernel.h +++ b/cpp/open3d/ml/pytorch/sparse_conv/SparseConvBackpropFilterOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/sparse_conv/SparseConvOpKernel.cpp b/cpp/open3d/ml/pytorch/sparse_conv/SparseConvOpKernel.cpp index ba4dd6980ac..86f587d31e7 100644 --- a/cpp/open3d/ml/pytorch/sparse_conv/SparseConvOpKernel.cpp +++ b/cpp/open3d/ml/pytorch/sparse_conv/SparseConvOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/sparse_conv/SparseConvOpKernel.cu b/cpp/open3d/ml/pytorch/sparse_conv/SparseConvOpKernel.cu index ac30a47947a..d582ad8bf83 100644 --- a/cpp/open3d/ml/pytorch/sparse_conv/SparseConvOpKernel.cu +++ b/cpp/open3d/ml/pytorch/sparse_conv/SparseConvOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/sparse_conv/SparseConvOpKernel.h b/cpp/open3d/ml/pytorch/sparse_conv/SparseConvOpKernel.h index 49f6c73c2d3..31e6e83c04e 100644 --- a/cpp/open3d/ml/pytorch/sparse_conv/SparseConvOpKernel.h +++ b/cpp/open3d/ml/pytorch/sparse_conv/SparseConvOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/sparse_conv/SparseConvOps.cpp b/cpp/open3d/ml/pytorch/sparse_conv/SparseConvOps.cpp index 8589a4b487c..e5fcef3f5bf 100644 --- a/cpp/open3d/ml/pytorch/sparse_conv/SparseConvOps.cpp +++ b/cpp/open3d/ml/pytorch/sparse_conv/SparseConvOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/sparse_conv/SparseConvTransposeBackpropFilterOpKernel.cpp b/cpp/open3d/ml/pytorch/sparse_conv/SparseConvTransposeBackpropFilterOpKernel.cpp index a311814feb1..a122727f4f2 100644 --- a/cpp/open3d/ml/pytorch/sparse_conv/SparseConvTransposeBackpropFilterOpKernel.cpp +++ b/cpp/open3d/ml/pytorch/sparse_conv/SparseConvTransposeBackpropFilterOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/sparse_conv/SparseConvTransposeBackpropFilterOpKernel.cu b/cpp/open3d/ml/pytorch/sparse_conv/SparseConvTransposeBackpropFilterOpKernel.cu index 5f295aca47e..b661b539a03 100644 --- a/cpp/open3d/ml/pytorch/sparse_conv/SparseConvTransposeBackpropFilterOpKernel.cu +++ b/cpp/open3d/ml/pytorch/sparse_conv/SparseConvTransposeBackpropFilterOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/sparse_conv/SparseConvTransposeBackpropFilterOpKernel.h b/cpp/open3d/ml/pytorch/sparse_conv/SparseConvTransposeBackpropFilterOpKernel.h index 665c5d9f987..0359cd73f26 100644 --- a/cpp/open3d/ml/pytorch/sparse_conv/SparseConvTransposeBackpropFilterOpKernel.h +++ b/cpp/open3d/ml/pytorch/sparse_conv/SparseConvTransposeBackpropFilterOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/sparse_conv/SparseConvTransposeOpKernel.cpp b/cpp/open3d/ml/pytorch/sparse_conv/SparseConvTransposeOpKernel.cpp index ffb5774f303..a59b63f0805 100644 --- a/cpp/open3d/ml/pytorch/sparse_conv/SparseConvTransposeOpKernel.cpp +++ b/cpp/open3d/ml/pytorch/sparse_conv/SparseConvTransposeOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/sparse_conv/SparseConvTransposeOpKernel.cu b/cpp/open3d/ml/pytorch/sparse_conv/SparseConvTransposeOpKernel.cu index 9c70f0a5323..26e2704900c 100644 --- a/cpp/open3d/ml/pytorch/sparse_conv/SparseConvTransposeOpKernel.cu +++ b/cpp/open3d/ml/pytorch/sparse_conv/SparseConvTransposeOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/sparse_conv/SparseConvTransposeOpKernel.h b/cpp/open3d/ml/pytorch/sparse_conv/SparseConvTransposeOpKernel.h index 1265093fc45..574e50d26b2 100644 --- a/cpp/open3d/ml/pytorch/sparse_conv/SparseConvTransposeOpKernel.h +++ b/cpp/open3d/ml/pytorch/sparse_conv/SparseConvTransposeOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/pytorch/sparse_conv/SparseConvTransposeOps.cpp b/cpp/open3d/ml/pytorch/sparse_conv/SparseConvTransposeOps.cpp index 5cb82deb52d..0ab4e1ff1dd 100644 --- a/cpp/open3d/ml/pytorch/sparse_conv/SparseConvTransposeOps.cpp +++ b/cpp/open3d/ml/pytorch/sparse_conv/SparseConvTransposeOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/tensorflow/CMakeLists.txt b/cpp/open3d/ml/tensorflow/CMakeLists.txt index cecd4152c49..41fd4c3eeeb 100644 --- a/cpp/open3d/ml/tensorflow/CMakeLists.txt +++ b/cpp/open3d/ml/tensorflow/CMakeLists.txt @@ -135,6 +135,12 @@ set_target_properties(open3d_tf_ops PROPERTIES # Do not add "lib" prefix set_target_properties(open3d_tf_ops PROPERTIES PREFIX "") set_target_properties(open3d_tf_ops PROPERTIES DEBUG_POSTFIX "_debug") +# Set BUILD_RPATH to find tbb. We don't install through cmake. +if (APPLE) + set_target_properties(open3d_tf_ops PROPERTIES BUILD_RPATH "@loader_path/..") +elseif (UNIX) + set_target_properties(open3d_tf_ops PROPERTIES BUILD_RPATH "$ORIGIN/..") +endif() # _GLIBCXX_USER_CXX11_ABI is set separately list(REMOVE_ITEM Tensorflow_DEFINITIONS "_GLIBCXX_USE_CXX11_ABI=0" @@ -159,8 +165,7 @@ target_link_libraries(open3d_tf_ops PRIVATE Open3D::Open3D Open3D::3rdparty_fmt Open3D::3rdparty_nanoflann - Open3D::3rdparty_parallelstl - Open3D::3rdparty_tbb + TBB::tbb ) if (BUILD_CUDA_MODULE) @@ -194,7 +199,7 @@ URL: @PROJECT_HOMEPAGE_URL@ Version: @PROJECT_VERSION@ Requires: Open3D = @PROJECT_VERSION@ Cflags: -Libs: -lopen3d_tf_ops]=] @ONLY NEWLINE_STYLE LF) +Libs: -lopen3d_tf_ops -ltbb]=] @ONLY NEWLINE_STYLE LF) file(GENERATE OUTPUT open3d_tf_ops.pc INPUT "${CMAKE_CURRENT_BINARY_DIR}/open3d_tf_ops.pc.in" TARGET open3d_tf_ops) diff --git a/cpp/open3d/ml/tensorflow/TensorFlowHelper.h b/cpp/open3d/ml/tensorflow/TensorFlowHelper.h index f8b7fab6e88..e7dd6b243d8 100644 --- a/cpp/open3d/ml/tensorflow/TensorFlowHelper.h +++ b/cpp/open3d/ml/tensorflow/TensorFlowHelper.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvBackpropFilterOpKernel.cpp b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvBackpropFilterOpKernel.cpp index 3d0b4409c3d..275d25b4fe2 100644 --- a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvBackpropFilterOpKernel.cpp +++ b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvBackpropFilterOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvBackpropFilterOpKernel.cu b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvBackpropFilterOpKernel.cu index 348117d24c6..cb60ffd9395 100644 --- a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvBackpropFilterOpKernel.cu +++ b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvBackpropFilterOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvBackpropFilterOpKernel.h b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvBackpropFilterOpKernel.h index 23e8a9ce735..b8adf46bda3 100644 --- a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvBackpropFilterOpKernel.h +++ b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvBackpropFilterOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvBackpropFilterOps.cpp b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvBackpropFilterOps.cpp index 06a4df2b463..7c3a41fedb9 100644 --- a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvBackpropFilterOps.cpp +++ b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvBackpropFilterOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvOpKernel.cpp b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvOpKernel.cpp index 192ba0438eb..ee3b2585cac 100644 --- a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvOpKernel.cpp +++ b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvOpKernel.cu b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvOpKernel.cu index fb28505b5d2..011703ee439 100644 --- a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvOpKernel.cu +++ b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvOpKernel.h b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvOpKernel.h index 2ee55522a75..b390d4bd2f4 100644 --- a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvOpKernel.h +++ b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvOps.cpp b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvOps.cpp index a86f9dc7396..a313ad7ee5f 100644 --- a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvOps.cpp +++ b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeBackpropFilterOpKernel.cpp b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeBackpropFilterOpKernel.cpp index 4228b75c7df..899946711a2 100644 --- a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeBackpropFilterOpKernel.cpp +++ b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeBackpropFilterOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeBackpropFilterOpKernel.cu b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeBackpropFilterOpKernel.cu index ad9cbb7f0d8..8faeb8c1420 100644 --- a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeBackpropFilterOpKernel.cu +++ b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeBackpropFilterOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeBackpropFilterOpKernel.h b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeBackpropFilterOpKernel.h index 0fa2766124f..9e9088e49eb 100644 --- a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeBackpropFilterOpKernel.h +++ b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeBackpropFilterOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeBackpropFilterOps.cpp b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeBackpropFilterOps.cpp index 613224b562c..349d5824bb5 100644 --- a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeBackpropFilterOps.cpp +++ b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeBackpropFilterOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeOpKernel.cpp b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeOpKernel.cpp index 5b65e21e6e1..9de66d2de70 100644 --- a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeOpKernel.cpp +++ b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeOpKernel.cu b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeOpKernel.cu index 672e9fcd84c..8ba176c4aa6 100644 --- a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeOpKernel.cu +++ b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeOpKernel.h b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeOpKernel.h index 5a257392e3d..cf4fd73f669 100644 --- a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeOpKernel.h +++ b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeOps.cpp b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeOps.cpp index b04c5b62afa..8b443d0b799 100644 --- a/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeOps.cpp +++ b/cpp/open3d/ml/tensorflow/continuous_conv/ContinuousConvTransposeOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/BuildSpatialHashTableOpKernel.cpp b/cpp/open3d/ml/tensorflow/misc/BuildSpatialHashTableOpKernel.cpp index 32b43eb772c..4bfa200e0f6 100644 --- a/cpp/open3d/ml/tensorflow/misc/BuildSpatialHashTableOpKernel.cpp +++ b/cpp/open3d/ml/tensorflow/misc/BuildSpatialHashTableOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/tensorflow/misc/BuildSpatialHashTableOpKernel.cu b/cpp/open3d/ml/tensorflow/misc/BuildSpatialHashTableOpKernel.cu index 7829c54deeb..d89dc139761 100644 --- a/cpp/open3d/ml/tensorflow/misc/BuildSpatialHashTableOpKernel.cu +++ b/cpp/open3d/ml/tensorflow/misc/BuildSpatialHashTableOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/tensorflow/misc/BuildSpatialHashTableOpKernel.h b/cpp/open3d/ml/tensorflow/misc/BuildSpatialHashTableOpKernel.h index 954cf8dbf2a..a0415504e53 100644 --- a/cpp/open3d/ml/tensorflow/misc/BuildSpatialHashTableOpKernel.h +++ b/cpp/open3d/ml/tensorflow/misc/BuildSpatialHashTableOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/BuildSpatialHashTableOps.cpp b/cpp/open3d/ml/tensorflow/misc/BuildSpatialHashTableOps.cpp index ff5289e95ac..16e0e7db408 100644 --- a/cpp/open3d/ml/tensorflow/misc/BuildSpatialHashTableOps.cpp +++ b/cpp/open3d/ml/tensorflow/misc/BuildSpatialHashTableOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/FixedRadiusSearchOpKernel.cpp b/cpp/open3d/ml/tensorflow/misc/FixedRadiusSearchOpKernel.cpp index b5ecb979004..2a56d54904e 100644 --- a/cpp/open3d/ml/tensorflow/misc/FixedRadiusSearchOpKernel.cpp +++ b/cpp/open3d/ml/tensorflow/misc/FixedRadiusSearchOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/tensorflow/misc/FixedRadiusSearchOpKernel.cu b/cpp/open3d/ml/tensorflow/misc/FixedRadiusSearchOpKernel.cu index bfd0d36496c..6f09cb6d80d 100644 --- a/cpp/open3d/ml/tensorflow/misc/FixedRadiusSearchOpKernel.cu +++ b/cpp/open3d/ml/tensorflow/misc/FixedRadiusSearchOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/tensorflow/misc/FixedRadiusSearchOpKernel.h b/cpp/open3d/ml/tensorflow/misc/FixedRadiusSearchOpKernel.h index 1af68ae4142..ccd900fdfff 100644 --- a/cpp/open3d/ml/tensorflow/misc/FixedRadiusSearchOpKernel.h +++ b/cpp/open3d/ml/tensorflow/misc/FixedRadiusSearchOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/FixedRadiusSearchOps.cpp b/cpp/open3d/ml/tensorflow/misc/FixedRadiusSearchOps.cpp index eeb2f02cffb..8de410b71bd 100644 --- a/cpp/open3d/ml/tensorflow/misc/FixedRadiusSearchOps.cpp +++ b/cpp/open3d/ml/tensorflow/misc/FixedRadiusSearchOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/InvertNeighborsListOpKernel.cpp b/cpp/open3d/ml/tensorflow/misc/InvertNeighborsListOpKernel.cpp index 5d7e2f35687..90bcd0c8510 100644 --- a/cpp/open3d/ml/tensorflow/misc/InvertNeighborsListOpKernel.cpp +++ b/cpp/open3d/ml/tensorflow/misc/InvertNeighborsListOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/InvertNeighborsListOpKernel.cu b/cpp/open3d/ml/tensorflow/misc/InvertNeighborsListOpKernel.cu index 3f17b9fc11c..d05d37464bc 100644 --- a/cpp/open3d/ml/tensorflow/misc/InvertNeighborsListOpKernel.cu +++ b/cpp/open3d/ml/tensorflow/misc/InvertNeighborsListOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/InvertNeighborsListOpKernel.h b/cpp/open3d/ml/tensorflow/misc/InvertNeighborsListOpKernel.h index d088dd6604b..b808bd48af3 100644 --- a/cpp/open3d/ml/tensorflow/misc/InvertNeighborsListOpKernel.h +++ b/cpp/open3d/ml/tensorflow/misc/InvertNeighborsListOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/InvertNeighborsListOps.cpp b/cpp/open3d/ml/tensorflow/misc/InvertNeighborsListOps.cpp index cc2c935bbb8..875b7fc13f6 100644 --- a/cpp/open3d/ml/tensorflow/misc/InvertNeighborsListOps.cpp +++ b/cpp/open3d/ml/tensorflow/misc/InvertNeighborsListOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/KnnSearchOpKernel.cpp b/cpp/open3d/ml/tensorflow/misc/KnnSearchOpKernel.cpp index fff8640ea29..c0a04c6c568 100644 --- a/cpp/open3d/ml/tensorflow/misc/KnnSearchOpKernel.cpp +++ b/cpp/open3d/ml/tensorflow/misc/KnnSearchOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/KnnSearchOpKernel.h b/cpp/open3d/ml/tensorflow/misc/KnnSearchOpKernel.h index 58d067bf572..9f34b0f1025 100644 --- a/cpp/open3d/ml/tensorflow/misc/KnnSearchOpKernel.h +++ b/cpp/open3d/ml/tensorflow/misc/KnnSearchOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/KnnSearchOps.cpp b/cpp/open3d/ml/tensorflow/misc/KnnSearchOps.cpp index 112d022e28c..9ec8ef4b373 100644 --- a/cpp/open3d/ml/tensorflow/misc/KnnSearchOps.cpp +++ b/cpp/open3d/ml/tensorflow/misc/KnnSearchOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/NmsOpKernel.cpp b/cpp/open3d/ml/tensorflow/misc/NmsOpKernel.cpp index 9dd7ea58148..9fdc87cf41e 100644 --- a/cpp/open3d/ml/tensorflow/misc/NmsOpKernel.cpp +++ b/cpp/open3d/ml/tensorflow/misc/NmsOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/NmsOpKernel.cu b/cpp/open3d/ml/tensorflow/misc/NmsOpKernel.cu index 6172781952c..66a85e72c08 100644 --- a/cpp/open3d/ml/tensorflow/misc/NmsOpKernel.cu +++ b/cpp/open3d/ml/tensorflow/misc/NmsOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/NmsOpKernel.h b/cpp/open3d/ml/tensorflow/misc/NmsOpKernel.h index 4c3359467a7..50dda33cb0b 100644 --- a/cpp/open3d/ml/tensorflow/misc/NmsOpKernel.h +++ b/cpp/open3d/ml/tensorflow/misc/NmsOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/NmsOps.cpp b/cpp/open3d/ml/tensorflow/misc/NmsOps.cpp index b8341190ea1..c43fe710425 100644 --- a/cpp/open3d/ml/tensorflow/misc/NmsOps.cpp +++ b/cpp/open3d/ml/tensorflow/misc/NmsOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/RadiusSearchOpKernel.cpp b/cpp/open3d/ml/tensorflow/misc/RadiusSearchOpKernel.cpp index 91e327121b0..f31d8c1aef8 100644 --- a/cpp/open3d/ml/tensorflow/misc/RadiusSearchOpKernel.cpp +++ b/cpp/open3d/ml/tensorflow/misc/RadiusSearchOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/RadiusSearchOpKernel.h b/cpp/open3d/ml/tensorflow/misc/RadiusSearchOpKernel.h index a0682b4e4e5..8cc56ec60f1 100644 --- a/cpp/open3d/ml/tensorflow/misc/RadiusSearchOpKernel.h +++ b/cpp/open3d/ml/tensorflow/misc/RadiusSearchOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/RadiusSearchOps.cpp b/cpp/open3d/ml/tensorflow/misc/RadiusSearchOps.cpp index 3dd99b9e460..fd715a0d5a3 100644 --- a/cpp/open3d/ml/tensorflow/misc/RadiusSearchOps.cpp +++ b/cpp/open3d/ml/tensorflow/misc/RadiusSearchOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/ReduceSubarraysSumOpKernel.cpp b/cpp/open3d/ml/tensorflow/misc/ReduceSubarraysSumOpKernel.cpp index 989f9faefa4..a1cfc94bed1 100644 --- a/cpp/open3d/ml/tensorflow/misc/ReduceSubarraysSumOpKernel.cpp +++ b/cpp/open3d/ml/tensorflow/misc/ReduceSubarraysSumOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/ReduceSubarraysSumOpKernel.cu b/cpp/open3d/ml/tensorflow/misc/ReduceSubarraysSumOpKernel.cu index b44f3d3582c..d7e93840ae4 100644 --- a/cpp/open3d/ml/tensorflow/misc/ReduceSubarraysSumOpKernel.cu +++ b/cpp/open3d/ml/tensorflow/misc/ReduceSubarraysSumOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/ReduceSubarraysSumOpKernel.h b/cpp/open3d/ml/tensorflow/misc/ReduceSubarraysSumOpKernel.h index da838d1a140..553105282f8 100644 --- a/cpp/open3d/ml/tensorflow/misc/ReduceSubarraysSumOpKernel.h +++ b/cpp/open3d/ml/tensorflow/misc/ReduceSubarraysSumOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/ReduceSubarraysSumOps.cpp b/cpp/open3d/ml/tensorflow/misc/ReduceSubarraysSumOps.cpp index 5226079e783..295365ec87f 100644 --- a/cpp/open3d/ml/tensorflow/misc/ReduceSubarraysSumOps.cpp +++ b/cpp/open3d/ml/tensorflow/misc/ReduceSubarraysSumOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/VoxelPoolingGradOpKernel.cpp b/cpp/open3d/ml/tensorflow/misc/VoxelPoolingGradOpKernel.cpp index 38bc4820ebc..a925e191911 100644 --- a/cpp/open3d/ml/tensorflow/misc/VoxelPoolingGradOpKernel.cpp +++ b/cpp/open3d/ml/tensorflow/misc/VoxelPoolingGradOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/VoxelPoolingGradOpKernel.h b/cpp/open3d/ml/tensorflow/misc/VoxelPoolingGradOpKernel.h index 2d702666bf4..0cbb0b7071f 100644 --- a/cpp/open3d/ml/tensorflow/misc/VoxelPoolingGradOpKernel.h +++ b/cpp/open3d/ml/tensorflow/misc/VoxelPoolingGradOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/VoxelPoolingOpKernel.cpp b/cpp/open3d/ml/tensorflow/misc/VoxelPoolingOpKernel.cpp index 77e278d72ee..5407764bd65 100644 --- a/cpp/open3d/ml/tensorflow/misc/VoxelPoolingOpKernel.cpp +++ b/cpp/open3d/ml/tensorflow/misc/VoxelPoolingOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/VoxelPoolingOpKernel.h b/cpp/open3d/ml/tensorflow/misc/VoxelPoolingOpKernel.h index f9fafbc010c..4bebcb132d5 100644 --- a/cpp/open3d/ml/tensorflow/misc/VoxelPoolingOpKernel.h +++ b/cpp/open3d/ml/tensorflow/misc/VoxelPoolingOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/VoxelPoolingOps.cpp b/cpp/open3d/ml/tensorflow/misc/VoxelPoolingOps.cpp index ec163ea415b..934092c24d1 100644 --- a/cpp/open3d/ml/tensorflow/misc/VoxelPoolingOps.cpp +++ b/cpp/open3d/ml/tensorflow/misc/VoxelPoolingOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/VoxelizeOpKernel.cpp b/cpp/open3d/ml/tensorflow/misc/VoxelizeOpKernel.cpp index 7034aab8068..88e65d4bd4c 100644 --- a/cpp/open3d/ml/tensorflow/misc/VoxelizeOpKernel.cpp +++ b/cpp/open3d/ml/tensorflow/misc/VoxelizeOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/VoxelizeOpKernel.cu b/cpp/open3d/ml/tensorflow/misc/VoxelizeOpKernel.cu index 698e7253114..ef5107a8b64 100644 --- a/cpp/open3d/ml/tensorflow/misc/VoxelizeOpKernel.cu +++ b/cpp/open3d/ml/tensorflow/misc/VoxelizeOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/VoxelizeOpKernel.h b/cpp/open3d/ml/tensorflow/misc/VoxelizeOpKernel.h index 0142aef2420..72c7c13dcd9 100644 --- a/cpp/open3d/ml/tensorflow/misc/VoxelizeOpKernel.h +++ b/cpp/open3d/ml/tensorflow/misc/VoxelizeOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/misc/VoxelizeOps.cpp b/cpp/open3d/ml/tensorflow/misc/VoxelizeOps.cpp index 7c345edfd3f..ffe2ed08f2e 100644 --- a/cpp/open3d/ml/tensorflow/misc/VoxelizeOps.cpp +++ b/cpp/open3d/ml/tensorflow/misc/VoxelizeOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/pointnet/BallQueryOpKernel.cu b/cpp/open3d/ml/tensorflow/pointnet/BallQueryOpKernel.cu index 587fd4adb95..473a328282d 100644 --- a/cpp/open3d/ml/tensorflow/pointnet/BallQueryOpKernel.cu +++ b/cpp/open3d/ml/tensorflow/pointnet/BallQueryOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/tensorflow/pointnet/BallQueryOpKernel.h b/cpp/open3d/ml/tensorflow/pointnet/BallQueryOpKernel.h index 5fe927ce7d7..510d6d44219 100644 --- a/cpp/open3d/ml/tensorflow/pointnet/BallQueryOpKernel.h +++ b/cpp/open3d/ml/tensorflow/pointnet/BallQueryOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/pointnet/BallQueryOps.cpp b/cpp/open3d/ml/tensorflow/pointnet/BallQueryOps.cpp index 07d7a03d34f..b04fb83bccd 100644 --- a/cpp/open3d/ml/tensorflow/pointnet/BallQueryOps.cpp +++ b/cpp/open3d/ml/tensorflow/pointnet/BallQueryOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- /* Furthest point sampling diff --git a/cpp/open3d/ml/tensorflow/pointnet/InterpolateOpKernel.cu b/cpp/open3d/ml/tensorflow/pointnet/InterpolateOpKernel.cu index b9ce6ee8c6c..e7b4671fe46 100644 --- a/cpp/open3d/ml/tensorflow/pointnet/InterpolateOpKernel.cu +++ b/cpp/open3d/ml/tensorflow/pointnet/InterpolateOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/tensorflow/pointnet/InterpolateOpKernel.h b/cpp/open3d/ml/tensorflow/pointnet/InterpolateOpKernel.h index 063d176e4ff..b30c68e075c 100644 --- a/cpp/open3d/ml/tensorflow/pointnet/InterpolateOpKernel.h +++ b/cpp/open3d/ml/tensorflow/pointnet/InterpolateOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/pointnet/InterpolateOps.cpp b/cpp/open3d/ml/tensorflow/pointnet/InterpolateOps.cpp index f16e9020609..2e26de2a744 100644 --- a/cpp/open3d/ml/tensorflow/pointnet/InterpolateOps.cpp +++ b/cpp/open3d/ml/tensorflow/pointnet/InterpolateOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- /* Furthest point sampling diff --git a/cpp/open3d/ml/tensorflow/pointnet/RoiPoolOpKernel.cu b/cpp/open3d/ml/tensorflow/pointnet/RoiPoolOpKernel.cu index e45c542fa53..54ddf16221a 100644 --- a/cpp/open3d/ml/tensorflow/pointnet/RoiPoolOpKernel.cu +++ b/cpp/open3d/ml/tensorflow/pointnet/RoiPoolOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/tensorflow/pointnet/RoiPoolOpKernel.h b/cpp/open3d/ml/tensorflow/pointnet/RoiPoolOpKernel.h index de0dea19f30..0d32043305c 100644 --- a/cpp/open3d/ml/tensorflow/pointnet/RoiPoolOpKernel.h +++ b/cpp/open3d/ml/tensorflow/pointnet/RoiPoolOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/pointnet/RoiPoolOps.cpp b/cpp/open3d/ml/tensorflow/pointnet/RoiPoolOps.cpp index 8a72b3b0027..7df0130020b 100644 --- a/cpp/open3d/ml/tensorflow/pointnet/RoiPoolOps.cpp +++ b/cpp/open3d/ml/tensorflow/pointnet/RoiPoolOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- /* Furthest point sampling diff --git a/cpp/open3d/ml/tensorflow/pointnet/SamplingOpKernel.cu b/cpp/open3d/ml/tensorflow/pointnet/SamplingOpKernel.cu index 3cb9005ab3d..52188a2defb 100644 --- a/cpp/open3d/ml/tensorflow/pointnet/SamplingOpKernel.cu +++ b/cpp/open3d/ml/tensorflow/pointnet/SamplingOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/tensorflow/pointnet/SamplingOpKernel.h b/cpp/open3d/ml/tensorflow/pointnet/SamplingOpKernel.h index 2f54a1f8daa..34db1c0c9eb 100644 --- a/cpp/open3d/ml/tensorflow/pointnet/SamplingOpKernel.h +++ b/cpp/open3d/ml/tensorflow/pointnet/SamplingOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/pointnet/SamplingOps.cpp b/cpp/open3d/ml/tensorflow/pointnet/SamplingOps.cpp index b33a636d3f1..0dacf4d7de0 100644 --- a/cpp/open3d/ml/tensorflow/pointnet/SamplingOps.cpp +++ b/cpp/open3d/ml/tensorflow/pointnet/SamplingOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- /* Furthest point sampling diff --git a/cpp/open3d/ml/tensorflow/pvcnn/TrilinearDevoxelizeKernel.cu b/cpp/open3d/ml/tensorflow/pvcnn/TrilinearDevoxelizeKernel.cu index 40a6678926e..f934575c9b0 100644 --- a/cpp/open3d/ml/tensorflow/pvcnn/TrilinearDevoxelizeKernel.cu +++ b/cpp/open3d/ml/tensorflow/pvcnn/TrilinearDevoxelizeKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/ml/tensorflow/pvcnn/TrilinearDevoxelizeKernel.h b/cpp/open3d/ml/tensorflow/pvcnn/TrilinearDevoxelizeKernel.h index 374a7ccdb04..871a8f50621 100644 --- a/cpp/open3d/ml/tensorflow/pvcnn/TrilinearDevoxelizeKernel.h +++ b/cpp/open3d/ml/tensorflow/pvcnn/TrilinearDevoxelizeKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/pvcnn/TrilinearDevoxelizeOps.cpp b/cpp/open3d/ml/tensorflow/pvcnn/TrilinearDevoxelizeOps.cpp index 7097f5f3287..61a3acefd82 100644 --- a/cpp/open3d/ml/tensorflow/pvcnn/TrilinearDevoxelizeOps.cpp +++ b/cpp/open3d/ml/tensorflow/pvcnn/TrilinearDevoxelizeOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvBackpropFilterOpKernel.cpp b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvBackpropFilterOpKernel.cpp index f83be319957..69855fa34ec 100644 --- a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvBackpropFilterOpKernel.cpp +++ b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvBackpropFilterOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvBackpropFilterOpKernel.cu b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvBackpropFilterOpKernel.cu index c6594ff84b2..863abe40dfd 100644 --- a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvBackpropFilterOpKernel.cu +++ b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvBackpropFilterOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvBackpropFilterOpKernel.h b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvBackpropFilterOpKernel.h index c5535393bbf..43b352edcb0 100644 --- a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvBackpropFilterOpKernel.h +++ b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvBackpropFilterOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvBackpropFilterOps.cpp b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvBackpropFilterOps.cpp index 5cc83701568..658a4ec7305 100644 --- a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvBackpropFilterOps.cpp +++ b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvBackpropFilterOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvOpKernel.cpp b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvOpKernel.cpp index 381457c8b2d..abc3f477357 100644 --- a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvOpKernel.cpp +++ b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvOpKernel.cu b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvOpKernel.cu index 03c35edff27..aa04277a067 100644 --- a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvOpKernel.cu +++ b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvOpKernel.h b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvOpKernel.h index d5ed4c431eb..b960eb9207b 100644 --- a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvOpKernel.h +++ b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvOps.cpp b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvOps.cpp index 264a443ef25..e08b06ef29b 100644 --- a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvOps.cpp +++ b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeBackpropFilterOpKernel.cpp b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeBackpropFilterOpKernel.cpp index 9624c648c1f..06234b5bf05 100644 --- a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeBackpropFilterOpKernel.cpp +++ b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeBackpropFilterOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeBackpropFilterOpKernel.cu b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeBackpropFilterOpKernel.cu index 4484dd1be34..460f0793062 100644 --- a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeBackpropFilterOpKernel.cu +++ b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeBackpropFilterOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeBackpropFilterOpKernel.h b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeBackpropFilterOpKernel.h index cf1e9396eca..4f662300dc4 100644 --- a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeBackpropFilterOpKernel.h +++ b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeBackpropFilterOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeBackpropFilterOps.cpp b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeBackpropFilterOps.cpp index af9741ad39e..6538bf41cb7 100644 --- a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeBackpropFilterOps.cpp +++ b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeBackpropFilterOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeOpKernel.cpp b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeOpKernel.cpp index 90f835f147d..c86744b13dc 100644 --- a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeOpKernel.cpp +++ b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeOpKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeOpKernel.cu b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeOpKernel.cu index a5df79f9a44..3c4a4545364 100644 --- a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeOpKernel.cu +++ b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeOpKernel.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeOpKernel.h b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeOpKernel.h index ff7fe31e448..8640764c03a 100644 --- a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeOpKernel.h +++ b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeOpKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeOps.cpp b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeOps.cpp index a1daf49a16c..2bbe3ac4b01 100644 --- a/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeOps.cpp +++ b/cpp/open3d/ml/tensorflow/sparse_conv/SparseConvTransposeOps.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/ml/tensorflow/tf_subsampling/tf_batch_subsampling.cpp b/cpp/open3d/ml/tensorflow/tf_subsampling/tf_batch_subsampling.cpp index 74472a667f4..4902806669c 100644 --- a/cpp/open3d/ml/tensorflow/tf_subsampling/tf_batch_subsampling.cpp +++ b/cpp/open3d/ml/tensorflow/tf_subsampling/tf_batch_subsampling.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // Source code from: https://github.com/HuguesTHOMAS/KPConv. diff --git a/cpp/open3d/ml/tensorflow/tf_subsampling/tf_subsampling.cpp b/cpp/open3d/ml/tensorflow/tf_subsampling/tf_subsampling.cpp index fd7162966f8..e67f2ab166c 100644 --- a/cpp/open3d/ml/tensorflow/tf_subsampling/tf_subsampling.cpp +++ b/cpp/open3d/ml/tensorflow/tf_subsampling/tf_subsampling.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // Source code from: https://github.com/HuguesTHOMAS/KPConv. diff --git a/cpp/open3d/pipelines/color_map/ColorMapUtils.cpp b/cpp/open3d/pipelines/color_map/ColorMapUtils.cpp index 8ab677d3a3a..e7155da65d6 100644 --- a/cpp/open3d/pipelines/color_map/ColorMapUtils.cpp +++ b/cpp/open3d/pipelines/color_map/ColorMapUtils.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/pipelines/color_map/ColorMapUtils.h b/cpp/open3d/pipelines/color_map/ColorMapUtils.h index fe1b1559c5c..d2cb1182eaa 100644 --- a/cpp/open3d/pipelines/color_map/ColorMapUtils.h +++ b/cpp/open3d/pipelines/color_map/ColorMapUtils.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/pipelines/color_map/ImageWarpingField.cpp b/cpp/open3d/pipelines/color_map/ImageWarpingField.cpp index c60c33ee35d..46a92223720 100644 --- a/cpp/open3d/pipelines/color_map/ImageWarpingField.cpp +++ b/cpp/open3d/pipelines/color_map/ImageWarpingField.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/pipelines/color_map/ImageWarpingField.h b/cpp/open3d/pipelines/color_map/ImageWarpingField.h index 013221fa9e4..e01cecc6323 100644 --- a/cpp/open3d/pipelines/color_map/ImageWarpingField.h +++ b/cpp/open3d/pipelines/color_map/ImageWarpingField.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/pipelines/color_map/NonRigidOptimizer.cpp b/cpp/open3d/pipelines/color_map/NonRigidOptimizer.cpp index 9dfc98fdfa8..72a68a085ea 100644 --- a/cpp/open3d/pipelines/color_map/NonRigidOptimizer.cpp +++ b/cpp/open3d/pipelines/color_map/NonRigidOptimizer.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/pipelines/color_map/NonRigidOptimizer.h b/cpp/open3d/pipelines/color_map/NonRigidOptimizer.h index a428dc3d479..5f93fb86d59 100644 --- a/cpp/open3d/pipelines/color_map/NonRigidOptimizer.h +++ b/cpp/open3d/pipelines/color_map/NonRigidOptimizer.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/pipelines/color_map/RigidOptimizer.cpp b/cpp/open3d/pipelines/color_map/RigidOptimizer.cpp index b506d401a6f..afc832b2c0d 100644 --- a/cpp/open3d/pipelines/color_map/RigidOptimizer.cpp +++ b/cpp/open3d/pipelines/color_map/RigidOptimizer.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/pipelines/color_map/RigidOptimizer.h b/cpp/open3d/pipelines/color_map/RigidOptimizer.h index 716c15cc78d..516b52a2528 100644 --- a/cpp/open3d/pipelines/color_map/RigidOptimizer.h +++ b/cpp/open3d/pipelines/color_map/RigidOptimizer.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/pipelines/integration/MarchingCubesConst.h b/cpp/open3d/pipelines/integration/MarchingCubesConst.h index cf60d82f2dd..ca50cdf367b 100644 --- a/cpp/open3d/pipelines/integration/MarchingCubesConst.h +++ b/cpp/open3d/pipelines/integration/MarchingCubesConst.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/pipelines/integration/ScalableTSDFVolume.cpp b/cpp/open3d/pipelines/integration/ScalableTSDFVolume.cpp index 5895dbe8f10..652c628c3ac 100644 --- a/cpp/open3d/pipelines/integration/ScalableTSDFVolume.cpp +++ b/cpp/open3d/pipelines/integration/ScalableTSDFVolume.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/pipelines/integration/ScalableTSDFVolume.h b/cpp/open3d/pipelines/integration/ScalableTSDFVolume.h index ba29950589c..425bb8b2137 100644 --- a/cpp/open3d/pipelines/integration/ScalableTSDFVolume.h +++ b/cpp/open3d/pipelines/integration/ScalableTSDFVolume.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/pipelines/integration/TSDFVolume.h b/cpp/open3d/pipelines/integration/TSDFVolume.h index 4865dd2e262..6ea4f7b7a86 100644 --- a/cpp/open3d/pipelines/integration/TSDFVolume.h +++ b/cpp/open3d/pipelines/integration/TSDFVolume.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/pipelines/integration/UniformTSDFVolume.cpp b/cpp/open3d/pipelines/integration/UniformTSDFVolume.cpp index 7cb4eba6f38..336572d9203 100644 --- a/cpp/open3d/pipelines/integration/UniformTSDFVolume.cpp +++ b/cpp/open3d/pipelines/integration/UniformTSDFVolume.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/pipelines/integration/UniformTSDFVolume.h b/cpp/open3d/pipelines/integration/UniformTSDFVolume.h index eec3fe7a32a..3d72b9dcce1 100644 --- a/cpp/open3d/pipelines/integration/UniformTSDFVolume.h +++ b/cpp/open3d/pipelines/integration/UniformTSDFVolume.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/pipelines/odometry/Odometry.cpp b/cpp/open3d/pipelines/odometry/Odometry.cpp index dd8b1569caa..c9cd12df095 100644 --- a/cpp/open3d/pipelines/odometry/Odometry.cpp +++ b/cpp/open3d/pipelines/odometry/Odometry.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/pipelines/odometry/Odometry.h b/cpp/open3d/pipelines/odometry/Odometry.h index aea065d3873..75953dd4d96 100644 --- a/cpp/open3d/pipelines/odometry/Odometry.h +++ b/cpp/open3d/pipelines/odometry/Odometry.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/pipelines/odometry/OdometryOption.h b/cpp/open3d/pipelines/odometry/OdometryOption.h index de410bcbbb2..1133a8a3e2f 100644 --- a/cpp/open3d/pipelines/odometry/OdometryOption.h +++ b/cpp/open3d/pipelines/odometry/OdometryOption.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/pipelines/odometry/RGBDOdometryJacobian.cpp b/cpp/open3d/pipelines/odometry/RGBDOdometryJacobian.cpp index 81fbd647934..2a546762ea1 100644 --- a/cpp/open3d/pipelines/odometry/RGBDOdometryJacobian.cpp +++ b/cpp/open3d/pipelines/odometry/RGBDOdometryJacobian.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/pipelines/odometry/RGBDOdometryJacobian.h b/cpp/open3d/pipelines/odometry/RGBDOdometryJacobian.h index 1d4ff242e5a..f9d01ee1dd4 100644 --- a/cpp/open3d/pipelines/odometry/RGBDOdometryJacobian.h +++ b/cpp/open3d/pipelines/odometry/RGBDOdometryJacobian.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/pipelines/registration/ColoredICP.cpp b/cpp/open3d/pipelines/registration/ColoredICP.cpp index 0365e3dc662..da7952c2a2a 100644 --- a/cpp/open3d/pipelines/registration/ColoredICP.cpp +++ b/cpp/open3d/pipelines/registration/ColoredICP.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -211,15 +211,12 @@ double TransformationEstimationForColoredICP::ComputeRMSE( return residual; }; -RegistrationResult RegistrationColoredICP( +std::tuple, + std::shared_ptr> +TransformationEstimationForColoredICP::InitializePointCloudsForTransformation( const geometry::PointCloud &source, const geometry::PointCloud &target, - double max_distance, - const Eigen::Matrix4d &init /* = Eigen::Matrix4d::Identity()*/, - const TransformationEstimationForColoredICP &estimation - /* = TransformationEstimationForColoredICP()*/, - const ICPConvergenceCriteria - &criteria /* = ICPConvergenceCriteria()*/) { + double max_correspondence_distance) const { if (!target.HasNormals()) { utility::LogError( "ColoredICP requires target pointcloud to have normals."); @@ -232,17 +229,34 @@ RegistrationResult RegistrationColoredICP( utility::LogError( "ColoredICP requires source pointcloud to have colors."); } - - if (auto target_c = InitializePointCloudForColoredICP( - target, - geometry::KDTreeSearchParamHybrid(max_distance * 2.0, 30))) { - return RegistrationICP(source, *target_c, max_distance, init, - estimation, criteria); - } else { + std::shared_ptr source_initialized_c( + &source, [](const geometry::PointCloud *) {}); + std::shared_ptr target_initialized_c( + InitializePointCloudForColoredICP( + target, geometry::KDTreeSearchParamHybrid( + max_correspondence_distance * 2.0, 30))); + if (!source_initialized_c || !target_initialized_c) { utility::LogError( - "Internal error: InitializePointCloudForColoredICP returns " + "Internal error: InitializePointCloudsForTransformation " + "returns " "nullptr."); - }; + } + return std::make_tuple(source_initialized_c, + std::const_pointer_cast( + target_initialized_c)); +} + +RegistrationResult RegistrationColoredICP( + const geometry::PointCloud &source, + const geometry::PointCloud &target, + double max_distance, + const Eigen::Matrix4d &init /* = Eigen::Matrix4d::Identity()*/, + const TransformationEstimationForColoredICP &estimation + /* = TransformationEstimationForColoredICP()*/, + const ICPConvergenceCriteria + &criteria /* = ICPConvergenceCriteria()*/) { + return RegistrationICP(source, target, max_distance, init, estimation, + criteria); } } // namespace registration diff --git a/cpp/open3d/pipelines/registration/ColoredICP.h b/cpp/open3d/pipelines/registration/ColoredICP.h index d7b61d57401..b401cdd02d9 100644 --- a/cpp/open3d/pipelines/registration/ColoredICP.h +++ b/cpp/open3d/pipelines/registration/ColoredICP.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -51,6 +51,13 @@ class TransformationEstimationForColoredICP : public TransformationEstimation { const geometry::PointCloud &target, const CorrespondenceSet &corres) const override; + std::tuple, + std::shared_ptr> + InitializePointCloudsForTransformation( + const geometry::PointCloud &source, + const geometry::PointCloud &target, + double max_correspondence_distance) const override; + public: double lambda_geometric_ = 0.968; /// shared_ptr to an Abstract RobustKernel that could mutate at runtime. diff --git a/cpp/open3d/pipelines/registration/CorrespondenceChecker.cpp b/cpp/open3d/pipelines/registration/CorrespondenceChecker.cpp index 82a35c004a0..57885a0eb09 100644 --- a/cpp/open3d/pipelines/registration/CorrespondenceChecker.cpp +++ b/cpp/open3d/pipelines/registration/CorrespondenceChecker.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/pipelines/registration/CorrespondenceChecker.h b/cpp/open3d/pipelines/registration/CorrespondenceChecker.h index 4d0fd89bee2..0ae92c3d9b2 100644 --- a/cpp/open3d/pipelines/registration/CorrespondenceChecker.h +++ b/cpp/open3d/pipelines/registration/CorrespondenceChecker.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/pipelines/registration/FastGlobalRegistration.cpp b/cpp/open3d/pipelines/registration/FastGlobalRegistration.cpp index f0e48b43afe..198a280c8e4 100644 --- a/cpp/open3d/pipelines/registration/FastGlobalRegistration.cpp +++ b/cpp/open3d/pipelines/registration/FastGlobalRegistration.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/pipelines/registration/FastGlobalRegistration.h b/cpp/open3d/pipelines/registration/FastGlobalRegistration.h index 2cec3bbfc25..23caff5ca03 100644 --- a/cpp/open3d/pipelines/registration/FastGlobalRegistration.h +++ b/cpp/open3d/pipelines/registration/FastGlobalRegistration.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/pipelines/registration/Feature.cpp b/cpp/open3d/pipelines/registration/Feature.cpp index 2815159dcc4..c43adbd585f 100644 --- a/cpp/open3d/pipelines/registration/Feature.cpp +++ b/cpp/open3d/pipelines/registration/Feature.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -18,6 +18,31 @@ namespace open3d { namespace pipelines { namespace registration { +std::shared_ptr Feature::SelectByIndex( + const std::vector &indices, bool invert /* = false */) const { + auto output = std::make_shared(); + output->Resize(data_.rows(), indices.size()); + + std::vector mask = std::vector(data_.cols(), invert); + for (size_t i : indices) { + mask[i] = !invert; + } + + size_t current_col_feature = 0; + for (size_t i = 0; i < static_cast(data_.cols()); i++) { + if (mask[i]) { + output->data_.col(current_col_feature) = data_.col(i); + current_col_feature++; + } + } + + utility::LogDebug( + "Feature group down sampled from {:d} features to {:d} features.", + (int)data_.cols(), (int)output->data_.cols()); + + return output; +} + static Eigen::Vector4d ComputePairFeatures(const Eigen::Vector3d &p1, const Eigen::Vector3d &n1, const Eigen::Vector3d &p2, diff --git a/cpp/open3d/pipelines/registration/Feature.h b/cpp/open3d/pipelines/registration/Feature.h index e102883b160..f4d9630688d 100644 --- a/cpp/open3d/pipelines/registration/Feature.h +++ b/cpp/open3d/pipelines/registration/Feature.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -42,6 +42,14 @@ class Feature { /// Returns number of points. size_t Num() const { return data_.cols(); } + /// \brief Selects features from \p input Feature group, with indices in \p + /// indices, and returns a new Feature group with selected features. + /// + /// \param indices Indices of features to be selected. + /// \param invert Set to `True` to invert the selection of indices. + std::shared_ptr SelectByIndex(const std::vector &indices, + bool invert = false) const; + public: /// Data buffer storing features. Eigen::MatrixXd data_; diff --git a/cpp/open3d/pipelines/registration/GeneralizedICP.cpp b/cpp/open3d/pipelines/registration/GeneralizedICP.cpp index c529fdcc639..ec2d94db37b 100644 --- a/cpp/open3d/pipelines/registration/GeneralizedICP.cpp +++ b/cpp/open3d/pipelines/registration/GeneralizedICP.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // Altered from: @@ -147,6 +147,29 @@ TransformationEstimationForGeneralizedICP::ComputeTransformation( return is_success ? extrinsic : Eigen::Matrix4d::Identity(); } +std::tuple, + std::shared_ptr> +TransformationEstimationForGeneralizedICP:: + InitializePointCloudsForTransformation( + const geometry::PointCloud &source, + const geometry::PointCloud &target, + double max_correspondence_distance) const { + std::shared_ptr source_initialized_c = + InitializePointCloudForGeneralizedICP(source, epsilon_); + std::shared_ptr target_initialized_c = + InitializePointCloudForGeneralizedICP(target, epsilon_); + if (!source_initialized_c || !target_initialized_c) { + utility::LogError( + "Internal error: InitializePointCloudsForTransformation " + "returns " + "nullptr."); + } + return std::make_pair(std::const_pointer_cast( + source_initialized_c), + std::const_pointer_cast( + target_initialized_c)); +} + RegistrationResult RegistrationGeneralizedICP( const geometry::PointCloud &source, const geometry::PointCloud &target, @@ -156,10 +179,8 @@ RegistrationResult RegistrationGeneralizedICP( &estimation /* = TransformationEstimationForGeneralizedICP()*/, const ICPConvergenceCriteria &criteria /* = ICPConvergenceCriteria()*/) { - return RegistrationICP( - *InitializePointCloudForGeneralizedICP(source, estimation.epsilon_), - *InitializePointCloudForGeneralizedICP(target, estimation.epsilon_), - max_correspondence_distance, init, estimation, criteria); + return RegistrationICP(source, target, max_correspondence_distance, init, + estimation, criteria); } } // namespace registration diff --git a/cpp/open3d/pipelines/registration/GeneralizedICP.h b/cpp/open3d/pipelines/registration/GeneralizedICP.h index 30629fdaaae..d5b665db37a 100644 --- a/cpp/open3d/pipelines/registration/GeneralizedICP.h +++ b/cpp/open3d/pipelines/registration/GeneralizedICP.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // @author Ignacio Vizzo [ivizzo@uni-bonn.de] @@ -51,6 +51,13 @@ class TransformationEstimationForGeneralizedICP const geometry::PointCloud &target, const CorrespondenceSet &corres) const override; + std::tuple, + std::shared_ptr> + InitializePointCloudsForTransformation( + const geometry::PointCloud &source, + const geometry::PointCloud &target, + double max_correspondence_distance) const override; + public: /// Small constant representing covariance along the normal. double epsilon_ = 1e-3; diff --git a/cpp/open3d/pipelines/registration/GlobalOptimization.cpp b/cpp/open3d/pipelines/registration/GlobalOptimization.cpp index d70e160642e..3cd0387cef6 100644 --- a/cpp/open3d/pipelines/registration/GlobalOptimization.cpp +++ b/cpp/open3d/pipelines/registration/GlobalOptimization.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/pipelines/registration/GlobalOptimization.h b/cpp/open3d/pipelines/registration/GlobalOptimization.h index 7e878a2f184..426ff4b05e6 100644 --- a/cpp/open3d/pipelines/registration/GlobalOptimization.h +++ b/cpp/open3d/pipelines/registration/GlobalOptimization.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/pipelines/registration/GlobalOptimizationConvergenceCriteria.h b/cpp/open3d/pipelines/registration/GlobalOptimizationConvergenceCriteria.h index db13971ee7f..3d896dd0457 100644 --- a/cpp/open3d/pipelines/registration/GlobalOptimizationConvergenceCriteria.h +++ b/cpp/open3d/pipelines/registration/GlobalOptimizationConvergenceCriteria.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/pipelines/registration/GlobalOptimizationMethod.h b/cpp/open3d/pipelines/registration/GlobalOptimizationMethod.h index be40fcd755c..db399521e47 100644 --- a/cpp/open3d/pipelines/registration/GlobalOptimizationMethod.h +++ b/cpp/open3d/pipelines/registration/GlobalOptimizationMethod.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/pipelines/registration/PoseGraph.cpp b/cpp/open3d/pipelines/registration/PoseGraph.cpp index 62076bdfe7c..7bd92e2f777 100644 --- a/cpp/open3d/pipelines/registration/PoseGraph.cpp +++ b/cpp/open3d/pipelines/registration/PoseGraph.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/pipelines/registration/PoseGraph.h b/cpp/open3d/pipelines/registration/PoseGraph.h index f6c5a4dad1b..e10be77e675 100644 --- a/cpp/open3d/pipelines/registration/PoseGraph.h +++ b/cpp/open3d/pipelines/registration/PoseGraph.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/pipelines/registration/Registration.cpp b/cpp/open3d/pipelines/registration/Registration.cpp index 6820d2f7c33..5611450a798 100644 --- a/cpp/open3d/pipelines/registration/Registration.cpp +++ b/cpp/open3d/pipelines/registration/Registration.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -117,45 +117,34 @@ RegistrationResult RegistrationICP( if (max_correspondence_distance <= 0.0) { utility::LogError("Invalid max_correspondence_distance."); } - if ((estimation.GetTransformationEstimationType() == - TransformationEstimationType::PointToPlane || - estimation.GetTransformationEstimationType() == - TransformationEstimationType::ColoredICP) && - (!target.HasNormals())) { - utility::LogError( - "TransformationEstimationPointToPlane and " - "TransformationEstimationColoredICP " - "require pre-computed normal vectors for target PointCloud."); - } - if ((estimation.GetTransformationEstimationType() == - TransformationEstimationType::GeneralizedICP) && - (!target.HasCovariances() || !source.HasCovariances())) { - utility::LogError( - "TransformationEstimationForGeneralizedICP require " - "pre-computed per point covariances matrices for source and " - "target PointCloud."); - } + + auto [source_initialized_c, target_initialized_c] = + estimation.InitializePointCloudsForTransformation( + source, target, max_correspondence_distance); Eigen::Matrix4d transformation = init; geometry::KDTreeFlann kdtree; - kdtree.SetGeometry(target); - geometry::PointCloud pcd = source; + const geometry::PointCloud &target_initialized = *target_initialized_c; + kdtree.SetGeometry(target_initialized); + geometry::PointCloud pcd(*source_initialized_c); + if (!init.isIdentity()) { pcd.Transform(init); } RegistrationResult result; result = GetRegistrationResultAndCorrespondences( - pcd, target, kdtree, max_correspondence_distance, transformation); + pcd, target_initialized, kdtree, max_correspondence_distance, + transformation); for (int i = 0; i < criteria.max_iteration_; i++) { utility::LogDebug("ICP Iteration #{:d}: Fitness {:.4f}, RMSE {:.4f}", i, result.fitness_, result.inlier_rmse_); Eigen::Matrix4d update = estimation.ComputeTransformation( - pcd, target, result.correspondence_set_); + pcd, target_initialized, result.correspondence_set_); transformation = update * transformation; pcd.Transform(update); RegistrationResult backup = result; result = GetRegistrationResultAndCorrespondences( - pcd, target, kdtree, max_correspondence_distance, + pcd, target_initialized, kdtree, max_correspondence_distance, transformation); if (std::abs(backup.fitness_ - result.fitness_) < criteria.relative_fitness_ && diff --git a/cpp/open3d/pipelines/registration/Registration.h b/cpp/open3d/pipelines/registration/Registration.h index 276ef6b64e2..55623832278 100644 --- a/cpp/open3d/pipelines/registration/Registration.h +++ b/cpp/open3d/pipelines/registration/Registration.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/pipelines/registration/RobustKernel.cpp b/cpp/open3d/pipelines/registration/RobustKernel.cpp index 68e4bcd6c22..35aaec62481 100644 --- a/cpp/open3d/pipelines/registration/RobustKernel.cpp +++ b/cpp/open3d/pipelines/registration/RobustKernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // @author Ignacio Vizzo [ivizzo@uni-bonn.de] diff --git a/cpp/open3d/pipelines/registration/RobustKernel.h b/cpp/open3d/pipelines/registration/RobustKernel.h index d3d111e8865..a1dca36ab26 100644 --- a/cpp/open3d/pipelines/registration/RobustKernel.h +++ b/cpp/open3d/pipelines/registration/RobustKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // @author Ignacio Vizzo [ivizzo@uni-bonn.de] diff --git a/cpp/open3d/pipelines/registration/TransformationEstimation.cpp b/cpp/open3d/pipelines/registration/TransformationEstimation.cpp index ff14dce0950..3ac438fa859 100644 --- a/cpp/open3d/pipelines/registration/TransformationEstimation.cpp +++ b/cpp/open3d/pipelines/registration/TransformationEstimation.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -11,6 +11,7 @@ #include "open3d/geometry/PointCloud.h" #include "open3d/utility/Eigen.h" +#include "open3d/utility/Logging.h" namespace open3d { namespace pipelines { @@ -42,6 +43,25 @@ Eigen::Matrix4d TransformationEstimationPointToPoint::ComputeTransformation( return Eigen::umeyama(source_mat, target_mat, with_scaling_); } +std::tuple, + std::shared_ptr> +TransformationEstimationPointToPoint::InitializePointCloudsForTransformation( + const geometry::PointCloud &source, + const geometry::PointCloud &target, + double max_correspondence_distance) const { + std::shared_ptr source_initialized_c( + &source, [](const geometry::PointCloud *) {}); + std::shared_ptr target_initialized_c( + &target, [](const geometry::PointCloud *) {}); + if (!source_initialized_c || !target_initialized_c) { + utility::LogError( + "Internal error: InitializePointCloudsForTransformation " + "returns " + "nullptr."); + } + return std::make_tuple(source_initialized_c, target_initialized_c); +} + double TransformationEstimationPointToPlane::ComputeRMSE( const geometry::PointCloud &source, const geometry::PointCloud &target, @@ -89,6 +109,29 @@ Eigen::Matrix4d TransformationEstimationPointToPlane::ComputeTransformation( return is_success ? extrinsic : Eigen::Matrix4d::Identity(); } +std::tuple, + std::shared_ptr> +TransformationEstimationPointToPlane::InitializePointCloudsForTransformation( + const geometry::PointCloud &source, + const geometry::PointCloud &target, + double max_correspondence_distance) const { + if (!target.HasNormals()) { + utility::LogError( + "PointToPlaneICP requires target pointcloud to have normals."); + } + std::shared_ptr source_initialized_c( + &source, [](const geometry::PointCloud *) {}); + std::shared_ptr target_initialized_c( + &target, [](const geometry::PointCloud *) {}); + if (!source_initialized_c || !target_initialized_c) { + utility::LogError( + "Internal error: InitializePointCloudsForTransformation " + "returns " + "nullptr."); + } + return std::make_tuple(source_initialized_c, target_initialized_c); +} + } // namespace registration } // namespace pipelines } // namespace open3d diff --git a/cpp/open3d/pipelines/registration/TransformationEstimation.h b/cpp/open3d/pipelines/registration/TransformationEstimation.h index 4e450746877..fc83b3669f6 100644 --- a/cpp/open3d/pipelines/registration/TransformationEstimation.h +++ b/cpp/open3d/pipelines/registration/TransformationEstimation.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -67,6 +67,19 @@ class TransformationEstimation { const geometry::PointCloud &source, const geometry::PointCloud &target, const CorrespondenceSet &corres) const = 0; + + /// Initialize the source and target point cloud for the transformation + /// estimation. + /// + /// \param source Source point cloud. + /// \param target Target point cloud. + /// \param max_correspondence_distance Maximum correspondence distance. + virtual std::tuple, + std::shared_ptr> + InitializePointCloudsForTransformation( + const geometry::PointCloud &source, + const geometry::PointCloud &target, + double max_correspondence_distance) const = 0; }; /// \class TransformationEstimationPointToPoint @@ -95,6 +108,13 @@ class TransformationEstimationPointToPoint : public TransformationEstimation { const geometry::PointCloud &target, const CorrespondenceSet &corres) const override; + std::tuple, + std::shared_ptr> + InitializePointCloudsForTransformation( + const geometry::PointCloud &source, + const geometry::PointCloud &target, + double max_correspondence_distance) const override; + public: /// \brief Set to True to estimate scaling, False to force scaling to be 1. /// @@ -137,6 +157,13 @@ class TransformationEstimationPointToPlane : public TransformationEstimation { const geometry::PointCloud &target, const CorrespondenceSet &corres) const override; + std::tuple, + std::shared_ptr> + InitializePointCloudsForTransformation( + const geometry::PointCloud &source, + const geometry::PointCloud &target, + double max_correspondence_distance) const override; + public: /// shared_ptr to an Abstract RobustKernel that could mutate at runtime. std::shared_ptr kernel_ = std::make_shared(); diff --git a/cpp/open3d/t/geometry/BoundingVolume.cpp b/cpp/open3d/t/geometry/BoundingVolume.cpp index 6a221502efe..ad357608442 100644 --- a/cpp/open3d/t/geometry/BoundingVolume.cpp +++ b/cpp/open3d/t/geometry/BoundingVolume.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/BoundingVolume.h b/cpp/open3d/t/geometry/BoundingVolume.h index b11cae01777..0f3a3afa16b 100644 --- a/cpp/open3d/t/geometry/BoundingVolume.h +++ b/cpp/open3d/t/geometry/BoundingVolume.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/CMakeLists.txt b/cpp/open3d/t/geometry/CMakeLists.txt index 1b1ba5760cf..e345c819b6f 100644 --- a/cpp/open3d/t/geometry/CMakeLists.txt +++ b/cpp/open3d/t/geometry/CMakeLists.txt @@ -7,7 +7,6 @@ target_sources(tgeometry PRIVATE LineSet.cpp BoundingVolume.cpp PointCloud.cpp - RaycastingScene.cpp RGBDImage.cpp TensorMap.cpp TriangleMesh.cpp @@ -16,6 +15,16 @@ target_sources(tgeometry PRIVATE VtkUtils.cpp ) +if (BUILD_SYCL_MODULE) + open3d_sycl_target_sources(tgeometry PRIVATE + RaycastingScene.cpp + ) +else() + target_sources(tgeometry PRIVATE + RaycastingScene.cpp + ) +endif() + open3d_show_and_abort_on_warning(tgeometry) open3d_set_global_properties(tgeometry) open3d_set_open3d_lib_properties(tgeometry) diff --git a/cpp/open3d/t/geometry/DrawableGeometry.h b/cpp/open3d/t/geometry/DrawableGeometry.h index 05ef4e41969..0b1af889746 100644 --- a/cpp/open3d/t/geometry/DrawableGeometry.h +++ b/cpp/open3d/t/geometry/DrawableGeometry.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/Geometry.h b/cpp/open3d/t/geometry/Geometry.h index df5681c0b2c..83e566ea2fb 100644 --- a/cpp/open3d/t/geometry/Geometry.h +++ b/cpp/open3d/t/geometry/Geometry.h @@ -1,12 +1,14 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- #pragma once +#include + #include #include "open3d/core/Device.h" @@ -90,6 +92,28 @@ class Geometry : public core::IsDevice { int dimension_; std::string name_; }; +/// Metrics for comparing point clouds and triangle meshes. +enum class Metric { + ChamferDistance, ///< Chamfer Distance + HausdorffDistance, ///< Hausdorff Distance + FScore ///< F-Score +}; + +/// Holder for various parameters required by metrics +struct MetricParameters { + /// Radius for computing the F Score. A match between a point and its + /// nearest neighbor is sucessful if it is within this radius. + std::vector fscore_radius = {0.01}; + /// Points are sampled uniformly from the surface of triangle meshes before + /// distance computation. This specifies the number of points sampled. No + /// sampling is done for point clouds. + size_t n_sampled_points = 1000; + std::string ToString() const { + return fmt::format( + "MetricParameters: fscore_radius={}, n_sampled_points={}", + fscore_radius, n_sampled_points); + } +}; } // namespace geometry } // namespace t diff --git a/cpp/open3d/t/geometry/Image.cpp b/cpp/open3d/t/geometry/Image.cpp index 3af4fc20b42..25bd1d1951c 100644 --- a/cpp/open3d/t/geometry/Image.cpp +++ b/cpp/open3d/t/geometry/Image.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -104,7 +104,7 @@ Image Image::To(core::Dtype dtype, dst_im.data_ = core::Tensor::Empty( {GetRows(), GetCols(), GetChannels()}, dtype, GetDevice()); } - if (HAVE_IPPICV && // Check for IPP fast implementation. + if (HAVE_IPP && // Check for IPP fast implementation. data_.IsCPU() && std::count(ipp_supported.begin(), ipp_supported.end(), GetDtype()) > 0 && @@ -140,7 +140,7 @@ Image Image::RGBToGray() const { std::count(npp_supported.begin(), npp_supported.end(), std::make_pair(GetDtype(), GetChannels())) > 0) { CUDA_CALL(npp::RGBToGray, data_, dst_im.data_); - } else if (HAVE_IPPICV && data_.IsCPU() && + } else if (HAVE_IPP && data_.IsCPU() && std::count(ipp_supported.begin(), ipp_supported.end(), std::make_pair(GetDtype(), GetChannels())) > 0) { IPP_CALL(ipp::RGBToGray, data_, dst_im.data_); @@ -180,7 +180,7 @@ Image Image::Resize(float sampling_rate, InterpType interp_type) const { std::count(npp_supported.begin(), npp_supported.end(), std::make_pair(GetDtype(), GetChannels())) > 0) { CUDA_CALL(npp::Resize, data_, dst_im.data_, interp_type); - } else if (HAVE_IPPICV && data_.IsCPU() && + } else if (HAVE_IPP && data_.IsCPU() && std::count(ipp_supported.begin(), ipp_supported.end(), std::make_pair(GetDtype(), GetChannels())) > 0) { IPP_CALL(ipp::Resize, data_, dst_im.data_, interp_type); @@ -217,7 +217,7 @@ Image Image::Dilate(int kernel_size) const { std::count(npp_supported.begin(), npp_supported.end(), std::make_pair(GetDtype(), GetChannels())) > 0) { CUDA_CALL(npp::Dilate, data_, dst_im.data_, kernel_size); - } else if (HAVE_IPPICV && data_.IsCPU() && + } else if (HAVE_IPP && data_.IsCPU() && std::count(ipp_supported.begin(), ipp_supported.end(), std::make_pair(GetDtype(), GetChannels())) > 0) { IPP_CALL(ipp::Dilate, data_, dst_im.data_, kernel_size); @@ -254,7 +254,7 @@ Image Image::FilterBilateral(int kernel_size, std::make_pair(GetDtype(), GetChannels())) > 0) { CUDA_CALL(npp::FilterBilateral, data_, dst_im.data_, kernel_size, value_sigma, dist_sigma); - } else if (HAVE_IPPICV && data_.IsCPU() && + } else if (HAVE_IPP && data_.IsCPU() && std::count(ipp_supported.begin(), ipp_supported.end(), std::make_pair(GetDtype(), GetChannels())) > 0) { IPP_CALL(ipp::FilterBilateral, data_, dst_im.data_, kernel_size, @@ -286,7 +286,7 @@ Image Image::Filter(const core::Tensor &kernel) const { std::count(npp_supported.begin(), npp_supported.end(), std::make_pair(GetDtype(), GetChannels())) > 0) { CUDA_CALL(npp::Filter, data_, dst_im.data_, kernel); - } else if (HAVE_IPPICV && data_.IsCPU() && + } else if (HAVE_IPP && data_.IsCPU() && std::count(ipp_supported.begin(), ipp_supported.end(), std::make_pair(GetDtype(), GetChannels())) > 0) { IPP_CALL(ipp::Filter, data_, dst_im.data_, kernel); @@ -322,7 +322,7 @@ Image Image::FilterGaussian(int kernel_size, float sigma) const { std::count(npp_supported.begin(), npp_supported.end(), std::make_pair(GetDtype(), GetChannels())) > 0) { CUDA_CALL(npp::FilterGaussian, data_, dst_im.data_, kernel_size, sigma); - } else if (HAVE_IPPICV && data_.IsCPU() && + } else if (HAVE_IPP && data_.IsCPU() && std::count(ipp_supported.begin(), ipp_supported.end(), std::make_pair(GetDtype(), GetChannels())) > 0) { IPP_CALL(ipp::FilterGaussian, data_, dst_im.data_, kernel_size, sigma); @@ -371,7 +371,7 @@ std::pair Image::FilterSobel(int kernel_size) const { std::make_pair(GetDtype(), GetChannels())) > 0) { CUDA_CALL(npp::FilterSobel, data_, dst_im_dx.data_, dst_im_dy.data_, kernel_size); - } else if (HAVE_IPPICV && data_.IsCPU() && + } else if (HAVE_IPP && data_.IsCPU() && std::count(ipp_supported.begin(), ipp_supported.end(), std::make_pair(GetDtype(), GetChannels())) > 0) { IPP_CALL(ipp::FilterSobel, data_, dst_im_dx.data_, dst_im_dy.data_, diff --git a/cpp/open3d/t/geometry/Image.h b/cpp/open3d/t/geometry/Image.h index 105bff8db82..78229c03996 100644 --- a/cpp/open3d/t/geometry/Image.h +++ b/cpp/open3d/t/geometry/Image.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -326,11 +326,11 @@ class Image : public Geometry { /// \brief Text description. std::string ToString() const; - /// Do we use IPP ICV for accelerating image processing operations? -#ifdef WITH_IPPICV - static constexpr bool HAVE_IPPICV = true; + /// Do we use IPP for accelerating image processing operations? +#ifdef WITH_IPP + static constexpr bool HAVE_IPP = true; #else - static constexpr bool HAVE_IPPICV = false; + static constexpr bool HAVE_IPP = false; #endif protected: diff --git a/cpp/open3d/t/geometry/LineSet.cpp b/cpp/open3d/t/geometry/LineSet.cpp index f525694ca45..95d26c27275 100644 --- a/cpp/open3d/t/geometry/LineSet.cpp +++ b/cpp/open3d/t/geometry/LineSet.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/LineSet.h b/cpp/open3d/t/geometry/LineSet.h index 38fb7c61be2..836eeb5eccd 100644 --- a/cpp/open3d/t/geometry/LineSet.h +++ b/cpp/open3d/t/geometry/LineSet.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/PointCloud.cpp b/cpp/open3d/t/geometry/PointCloud.cpp index f4c5b47f068..9b48eea0170 100644 --- a/cpp/open3d/t/geometry/PointCloud.cpp +++ b/cpp/open3d/t/geometry/PointCloud.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -34,6 +34,7 @@ #include "open3d/t/geometry/TriangleMesh.h" #include "open3d/t/geometry/VtkUtils.h" #include "open3d/t/geometry/kernel/GeometryMacros.h" +#include "open3d/t/geometry/kernel/Metrics.h" #include "open3d/t/geometry/kernel/PCAPartition.h" #include "open3d/t/geometry/kernel/PointCloud.h" #include "open3d/t/geometry/kernel/Transform.h" @@ -383,12 +384,42 @@ PointCloud PointCloud::RandomDownSample(double sampling_ratio) const { false, false); } -PointCloud PointCloud::FarthestPointDownSample(size_t num_samples) const { - // We want the sampled points has the attributes of the original point - // cloud, so full copy is needed. - const open3d::geometry::PointCloud lpcd = ToLegacy(); - return FromLegacy(*lpcd.FarthestPointDownSample(num_samples), - GetPointPositions().GetDtype(), GetDevice()); +PointCloud PointCloud::FarthestPointDownSample(const size_t num_samples, + const size_t start_index) const { + const core::Dtype dtype = GetPointPositions().GetDtype(); + const int64_t num_points = GetPointPositions().GetLength(); + if (num_samples == 0) { + return PointCloud(GetDevice()); + } else if (num_samples == size_t(num_points)) { + return Clone(); + } else if (num_samples > size_t(num_points)) { + utility::LogError( + "Illegal number of samples: {}, must <= point size: {}", + num_samples, num_points); + } else if (start_index >= size_t(num_points)) { + utility::LogError("Illegal start index: {}, must <= point size: {}", + start_index, num_points); + } + core::Tensor selection_mask = + core::Tensor::Zeros({num_points}, core::Bool, GetDevice()); + core::Tensor smallest_distances = core::Tensor::Full( + {num_points}, std::numeric_limits::infinity(), dtype, + GetDevice()); + + int64_t farthest_index = static_cast(start_index); + + for (size_t i = 0; i < num_samples; i++) { + selection_mask[farthest_index] = true; + core::Tensor selected = GetPointPositions()[farthest_index]; + + core::Tensor diff = GetPointPositions() - selected; + core::Tensor distances_to_selected = (diff * diff).Sum({1}); + smallest_distances = open3d::core::Minimum(distances_to_selected, + smallest_distances); + + farthest_index = smallest_distances.ArgMax({0}).Item(); + } + return SelectByMask(selection_mask); } std::tuple PointCloud::RemoveRadiusOutliers( @@ -983,6 +1014,12 @@ geometry::Image PointCloud::ProjectToDepthImage(int width, const core::Tensor &extrinsics, float depth_scale, float depth_max) { + if (!HasPointPositions()) { + utility::LogWarning( + "Called ProjectToDepthImage on a point cloud with no Positions " + "attribute. Returning empty image."); + return geometry::Image(); + } core::AssertTensorShape(intrinsics, {3, 3}); core::AssertTensorShape(extrinsics, {4, 4}); @@ -1001,6 +1038,12 @@ geometry::RGBDImage PointCloud::ProjectToRGBDImage( const core::Tensor &extrinsics, float depth_scale, float depth_max) { + if (!HasPointPositions()) { + utility::LogWarning( + "Called ProjectToRGBDImage on a point cloud with no Positions " + "attribute. Returning empty image."); + return geometry::RGBDImage(); + } if (!HasPointColors()) { utility::LogError( "Unable to project to RGBD without the Color attribute in the " @@ -1293,6 +1336,39 @@ int PointCloud::PCAPartition(int max_points) { return num_partitions; } +core::Tensor PointCloud::ComputeMetrics(const PointCloud &pcd2, + std::vector metrics, + MetricParameters params) const { + if (IsEmpty() || pcd2.IsEmpty()) { + utility::LogError("One or both input point clouds are empty!"); + } + if (!IsCPU() || !pcd2.IsCPU()) { + utility::LogWarning( + "ComputeDistance is implemented only on CPU. Computing on " + "CPU."); + } + core::Tensor points1 = GetPointPositions().To(core::Device("CPU:0")), + points2 = pcd2.GetPointPositions().To(core::Device("CPU:0")); + [[maybe_unused]] core::Tensor indices12, indices21; + core::Tensor sqr_distance12, sqr_distance21; + + core::nns::NearestNeighborSearch tree1(points1); + core::nns::NearestNeighborSearch tree2(points2); + + if (!tree2.KnnIndex()) { + utility::LogError("[ComputeDistance] Building KNN-Index failed!"); + } + if (!tree1.KnnIndex()) { + utility::LogError("[ComputeDistance] Building KNN-Index failed!"); + } + + std::tie(indices12, sqr_distance12) = tree2.KnnSearch(points1, 1); + std::tie(indices21, sqr_distance21) = tree1.KnnSearch(points2, 1); + + return ComputeMetricsCommon(sqr_distance12.Sqrt_(), sqr_distance21.Sqrt_(), + metrics, params); +} + } // namespace geometry } // namespace t } // namespace open3d diff --git a/cpp/open3d/t/geometry/PointCloud.h b/cpp/open3d/t/geometry/PointCloud.h index 995e1b5ba50..2dff4e6aa9f 100644 --- a/cpp/open3d/t/geometry/PointCloud.h +++ b/cpp/open3d/t/geometry/PointCloud.h @@ -1,12 +1,13 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- #pragma once +#include #include #include #include @@ -351,10 +352,12 @@ class PointCloud : public Geometry, public DrawableGeometry { /// points has farthest distance. /// /// The sampling is performed by selecting the farthest point from previous - /// selected points iteratively. + /// selected points iteratively, starting from `start_index`. /// /// \param num_samples Number of points to be sampled. - PointCloud FarthestPointDownSample(size_t num_samples) const; + /// \param start_index Index to start downsampling from. + PointCloud FarthestPointDownSample(const size_t num_samples, + const size_t start_index = 0) const; /// \brief Remove points that have less than \p nb_points neighbors in a /// sphere of a given radius. @@ -697,6 +700,44 @@ class PointCloud : public Geometry, public DrawableGeometry { /// \return The number of partitions. int PCAPartition(int max_points); + /// Compute various metrics between two point clouds. Currently, Chamfer + /// distance, Hausdorff distance and F-Score + /// [[Knapitsch2017]] + /// are supported. The Chamfer distance is the sum of the mean distance to + /// the nearest neighbor from the points of the first point cloud to the + /// second point cloud. The F-Score at a fixed threshold radius is the + /// harmonic mean of the Precision and Recall. Recall is the percentage of + /// surface points from the first point cloud that have the second point + /// cloud points within the threshold radius, while Precision is the + /// percentage of points from the second point cloud that have the first + /// point cloud points within the threhold radius. + + /// \f{eqnarray*}{ + /// \text{Chamfer Distance: } d_{CD}(X,Y) &=& \frac{1}{|X|}\sum_{i \in X} + /// || x_i - n(x_i, Y) || + \frac{1}{|Y|}\sum_{i \in Y} || y_i - n(y_i, X) + /// || \\{} + /// \text{Hausdorff distance: } d_H(X,Y) &=& \max \left\{ \max_{i \in X} + /// || x_i - n(x_i, Y) ||, \max_{i \in Y} || y_i - n(y_i, X) || \right\} + /// \\{} + /// \text{Precision: } P(X,Y|d) &=& \frac{100}{|X|} \sum_{i \in X} || x_i + /// - n(x_i, Y) || < d \\{} + /// \text{Recall: } R(X,Y|d) &=& \frac{100}{|Y|} \sum_{i \in Y} || y_i - + /// n(y_i, X) || < d \\{} + /// \text{F-Score: } F(X,Y|d) &=& \frac{2 P(X,Y|d) R(X,Y|d)}{P(X,Y|d) + + /// R(X,Y|d)} + /// \f} + + /// \param pcd2 Other point cloud to compare with. + /// \param metrics List of Metric s to compute. Multiple metrics can be + /// computed at once for efficiency. + /// \param params MetricParameters struct holds parameters required by + /// different metrics. + /// \returns Tensor containing the requested metrics. + core::Tensor ComputeMetrics( + const PointCloud &pcd2, + std::vector metrics = {Metric::ChamferDistance}, + MetricParameters params = MetricParameters()) const; + protected: core::Device device_ = core::Device("CPU:0"); TensorMap point_attr_; diff --git a/cpp/open3d/t/geometry/RGBDImage.cpp b/cpp/open3d/t/geometry/RGBDImage.cpp index 631fa3ef0fd..b77019d5c90 100644 --- a/cpp/open3d/t/geometry/RGBDImage.cpp +++ b/cpp/open3d/t/geometry/RGBDImage.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/RGBDImage.h b/cpp/open3d/t/geometry/RGBDImage.h index aa0d6ac3538..d0db11824ee 100644 --- a/cpp/open3d/t/geometry/RGBDImage.h +++ b/cpp/open3d/t/geometry/RGBDImage.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/RaycastingScene.cpp b/cpp/open3d/t/geometry/RaycastingScene.cpp index 8906f6373e5..436c549bd08 100644 --- a/cpp/open3d/t/geometry/RaycastingScene.cpp +++ b/cpp/open3d/t/geometry/RaycastingScene.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -11,11 +11,15 @@ #endif #include "open3d/t/geometry/RaycastingScene.h" +#ifdef BUILD_SYCL_MODULE +#include +#endif // This header is in the embree src dir (embree/src/ext_embree/..). #include #include #include +#include #include #include #include @@ -24,50 +28,26 @@ #include "open3d/utility/Helper.h" #include "open3d/utility/Logging.h" -namespace { - -typedef Eigen::AlignedVector3 Vec3fa; -// Dont force alignment for Vec2f because we use it just for storing -typedef Eigen::Matrix Vec2f; -typedef Eigen::Vector3f Vec3f; - -// Error function called by embree. -void ErrorFunction(void* userPtr, enum RTCError error, const char* str) { - open3d::utility::LogError("embree error: {} {}", error, str); -} +namespace callbacks { -// Checks the last dim, ensures that the number of dims is >= min_ndim, checks -// the device, and dtype. -template -void AssertTensorDtypeLastDimDeviceMinNDim(const open3d::core::Tensor& tensor, - const std::string& tensor_name, - int64_t last_dim, - const open3d::core::Device& device, - int64_t min_ndim = 2) { - open3d::core::AssertTensorDevice(tensor, device); - if (tensor.NumDims() < min_ndim) { - open3d::utility::LogError( - "{} Tensor ndim is {} but expected ndim >= {}", tensor_name, - tensor.NumDims(), min_ndim); - } - if (tensor.GetShape().back() != last_dim) { - open3d::utility::LogError( - "The last dimension of the {} Tensor must be {} but got " - "Tensor with shape {}", - tensor_name, last_dim, tensor.GetShape().ToString()); - } - open3d::core::AssertTensorDtype(tensor, - open3d::core::Dtype::FromType()); -} +struct GeomPrimID { + uint32_t geomID; + uint32_t primID; + float ray_tfar; +}; struct CountIntersectionsContext { RTCRayQueryContext context; - std::vector>* - previous_geom_prim_ID_tfar; + GeomPrimID* previous_geom_prim_ID_tfar; int* intersections; }; +#ifdef BUILD_SYCL_MODULE +RTC_SYCL_INDIRECTLY_CALLABLE void CountIntersectionsFunc( + const RTCFilterFunctionNArguments* args) { +#else void CountIntersectionsFunc(const RTCFilterFunctionNArguments* args) { +#endif int* valid = args->valid; const CountIntersectionsContext* context = reinterpret_cast(args->context); @@ -78,8 +58,8 @@ void CountIntersectionsFunc(const RTCFilterFunctionNArguments* args) { // Avoid crashing when debug visualizations are used. if (context == nullptr) return; - std::vector>* - previous_geom_prim_ID_tfar = context->previous_geom_prim_ID_tfar; + GeomPrimID* previous_geom_prim_ID_tfar = + context->previous_geom_prim_ID_tfar; int* intersections = context->intersections; // Iterate over all rays in ray packet. @@ -96,14 +76,13 @@ void CountIntersectionsFunc(const RTCFilterFunctionNArguments* args) { RTCHit hit = rtcGetHitFromHitN(hitN, N, ui); unsigned int ray_id = ray.id; - std::tuple gpID(hit.geomID, hit.primID, - ray.tfar); - auto& prev_gpIDtfar = previous_geom_prim_ID_tfar->operator[](ray_id); - if (std::get<0>(prev_gpIDtfar) != hit.geomID || - (std::get<1>(prev_gpIDtfar) != hit.primID && - std::get<2>(prev_gpIDtfar) != ray.tfar)) { + GeomPrimID gpID = {hit.geomID, hit.primID, ray.tfar}; + auto& prev_gpIDtfar = previous_geom_prim_ID_tfar[ray_id]; + if (prev_gpIDtfar.geomID != hit.geomID || + (prev_gpIDtfar.primID != hit.primID && + prev_gpIDtfar.ray_tfar != ray.tfar)) { ++(intersections[ray_id]); - previous_geom_prim_ID_tfar->operator[](ray_id) = gpID; + previous_geom_prim_ID_tfar[ray_id] = gpID; } // Always ignore hit valid[ui] = 0; @@ -112,18 +91,22 @@ void CountIntersectionsFunc(const RTCFilterFunctionNArguments* args) { struct ListIntersectionsContext { RTCRayQueryContext context; - std::vector>* - previous_geom_prim_ID_tfar; + GeomPrimID* previous_geom_prim_ID_tfar; unsigned int* ray_ids; unsigned int* geometry_ids; unsigned int* primitive_ids; float* primitive_uvs; float* t_hit; - Eigen::VectorXi cumsum; + int* cumsum; unsigned int* track_intersections; }; +#ifdef BUILD_SYCL_MODULE +RTC_SYCL_INDIRECTLY_CALLABLE void ListIntersectionsFunc( + const RTCFilterFunctionNArguments* args) { +#else void ListIntersectionsFunc(const RTCFilterFunctionNArguments* args) { +#endif int* valid = args->valid; const ListIntersectionsContext* context = reinterpret_cast(args->context); @@ -134,14 +117,14 @@ void ListIntersectionsFunc(const RTCFilterFunctionNArguments* args) { // Avoid crashing when debug visualizations are used. if (context == nullptr) return; - std::vector>* - previous_geom_prim_ID_tfar = context->previous_geom_prim_ID_tfar; + GeomPrimID* previous_geom_prim_ID_tfar = + context->previous_geom_prim_ID_tfar; unsigned int* ray_ids = context->ray_ids; unsigned int* geometry_ids = context->geometry_ids; unsigned int* primitive_ids = context->primitive_ids; float* primitive_uvs = context->primitive_uvs; float* t_hit = context->t_hit; - Eigen::VectorXi cumsum = context->cumsum; + int* cumsum = context->cumsum; unsigned int* track_intersections = context->track_intersections; // Iterate over all rays in ray packet. @@ -158,12 +141,11 @@ void ListIntersectionsFunc(const RTCFilterFunctionNArguments* args) { RTCHit hit = rtcGetHitFromHitN(hitN, N, ui); unsigned int ray_id = ray.id; - std::tuple gpID(hit.geomID, hit.primID, - ray.tfar); - auto& prev_gpIDtfar = previous_geom_prim_ID_tfar->operator[](ray_id); - if (std::get<0>(prev_gpIDtfar) != hit.geomID || - (std::get<1>(prev_gpIDtfar) != hit.primID && - std::get<2>(prev_gpIDtfar) != ray.tfar)) { + GeomPrimID gpID = {hit.geomID, hit.primID, ray.tfar}; + auto& prev_gpIDtfar = previous_geom_prim_ID_tfar[ray_id]; + if (prev_gpIDtfar.geomID != hit.geomID || + (prev_gpIDtfar.primID != hit.primID && + prev_gpIDtfar.ray_tfar != ray.tfar)) { size_t idx = cumsum[ray_id] + track_intersections[ray_id]; ray_ids[idx] = ray_id; geometry_ids[idx] = hit.geomID; @@ -171,7 +153,7 @@ void ListIntersectionsFunc(const RTCFilterFunctionNArguments* args) { primitive_uvs[idx * 2 + 0] = hit.u; primitive_uvs[idx * 2 + 1] = hit.v; t_hit[idx] = ray.tfar; - previous_geom_prim_ID_tfar->operator[](ray_id) = gpID; + previous_geom_prim_ID_tfar[ray_id] = gpID; ++(track_intersections[ray_id]); } // Always ignore hit @@ -179,16 +161,56 @@ void ListIntersectionsFunc(const RTCFilterFunctionNArguments* args) { } } +} // namespace callbacks + +namespace { + +typedef Eigen::AlignedVector3 Vec3fa; +// Dont force alignment for Vec2f because we use it just for storing +typedef Eigen::Matrix Vec2f; +typedef Eigen::Vector3f Vec3f; + +// Error function called by embree. +void ErrorFunction(void* userPtr, enum RTCError error, const char* str) { + open3d::utility::LogError("Embree error: {} {}", rtcGetErrorString(error), + str); +} + +// Checks the last dim, ensures that the number of dims is >= min_ndim, checks +// the device, and dtype. +template +void AssertTensorDtypeLastDimDeviceMinNDim(const open3d::core::Tensor& tensor, + const std::string& tensor_name, + int64_t last_dim, + const open3d::core::Device& device, + int64_t min_ndim = 2) { + open3d::core::AssertTensorDevice(tensor, device); + if (tensor.NumDims() < min_ndim) { + open3d::utility::LogError( + "{} Tensor ndim is {} but expected ndim >= {}", tensor_name, + tensor.NumDims(), min_ndim); + } + if (tensor.GetShape().back() != last_dim) { + open3d::utility::LogError( + "The last dimension of the {} Tensor must be {} but got " + "Tensor with shape {}", + tensor_name, last_dim, tensor.GetShape().ToString()); + } + open3d::core::AssertTensorDtype(tensor, + open3d::core::Dtype::FromType()); +} + // Adapted from common/math/closest_point.h -inline Vec3fa closestPointTriangle(Vec3fa const& p, - Vec3fa const& a, - Vec3fa const& b, - Vec3fa const& c, - float& tex_u, - float& tex_v) { - const Vec3fa ab = b - a; - const Vec3fa ac = c - a; - const Vec3fa ap = p - a; +template +inline Vec3faType closestPointTriangle(Vec3faType const& p, + Vec3faType const& a, + Vec3faType const& b, + Vec3faType const& c, + float& tex_u, + float& tex_v) { + const Vec3faType ab = b - a; + const Vec3faType ac = c - a; + const Vec3faType ap = p - a; const float d1 = ab.dot(ap); const float d2 = ac.dot(ap); @@ -198,7 +220,7 @@ inline Vec3fa closestPointTriangle(Vec3fa const& p, return a; } - const Vec3fa bp = p - b; + const Vec3faType bp = p - b; const float d3 = ab.dot(bp); const float d4 = ac.dot(bp); if (d3 >= 0.f && d4 <= d3) { @@ -207,7 +229,7 @@ inline Vec3fa closestPointTriangle(Vec3fa const& p, return b; } - const Vec3fa cp = p - c; + const Vec3faType cp = p - c; const float d5 = ab.dot(cp); const float d6 = ac.dot(cp); if (d6 >= 0.f && d5 <= d6) { @@ -248,56 +270,64 @@ inline Vec3fa closestPointTriangle(Vec3fa const& p, return a + v * ab + w * ac; } +struct GeometryPtr { + RTCGeometryType geom_type; + const void* ptr1; + const void* ptr2; +}; + +template struct ClosestPointResult { ClosestPointResult() - : primID(RTC_INVALID_GEOMETRY_ID), - geomID(RTC_INVALID_GEOMETRY_ID), - geometry_ptrs_ptr() {} + : primID(RTC_INVALID_GEOMETRY_ID), geomID(RTC_INVALID_GEOMETRY_ID) {} - Vec3f p; + Vec3fType p; unsigned int primID; unsigned int geomID; - Vec2f uv; - Vec3f n; - std::vector>* - geometry_ptrs_ptr; + Vec2fType uv; + Vec3fType n; + GeometryPtr* geometry_ptrs_ptr; }; // Code adapted from the embree closest_point tutorial. +template bool ClosestPointFunc(RTCPointQueryFunctionArguments* args) { assert(args->userPtr); const unsigned int geomID = args->geomID; const unsigned int primID = args->primID; // query position in world space - Vec3fa q(args->query->x, args->query->y, args->query->z); + Vec3faType q(args->query->x, args->query->y, args->query->z); - ClosestPointResult* result = - static_cast(args->userPtr); + ClosestPointResult* result = + static_cast*>( + args->userPtr); const RTCGeometryType geom_type = - std::get<0>(result->geometry_ptrs_ptr->operator[](geomID)); - const void* ptr1 = - std::get<1>(result->geometry_ptrs_ptr->operator[](geomID)); - const void* ptr2 = - std::get<2>(result->geometry_ptrs_ptr->operator[](geomID)); + result->geometry_ptrs_ptr[geomID].geom_type; + const void* ptr1 = result->geometry_ptrs_ptr[geomID].ptr1; + const void* ptr2 = result->geometry_ptrs_ptr[geomID].ptr2; if (RTC_GEOMETRY_TYPE_TRIANGLE == geom_type) { const float* vertex_positions = (const float*)ptr1; const uint32_t* triangle_indices = (const uint32_t*)ptr2; - Vec3fa v0(vertex_positions[3 * triangle_indices[3 * primID + 0] + 0], - vertex_positions[3 * triangle_indices[3 * primID + 0] + 1], - vertex_positions[3 * triangle_indices[3 * primID + 0] + 2]); - Vec3fa v1(vertex_positions[3 * triangle_indices[3 * primID + 1] + 0], - vertex_positions[3 * triangle_indices[3 * primID + 1] + 1], - vertex_positions[3 * triangle_indices[3 * primID + 1] + 2]); - Vec3fa v2(vertex_positions[3 * triangle_indices[3 * primID + 2] + 0], - vertex_positions[3 * triangle_indices[3 * primID + 2] + 1], - vertex_positions[3 * triangle_indices[3 * primID + 2] + 2]); + Vec3faType v0( + vertex_positions[3 * triangle_indices[3 * primID + 0] + 0], + vertex_positions[3 * triangle_indices[3 * primID + 0] + 1], + vertex_positions[3 * triangle_indices[3 * primID + 0] + 2]); + Vec3faType v1( + vertex_positions[3 * triangle_indices[3 * primID + 1] + 0], + vertex_positions[3 * triangle_indices[3 * primID + 1] + 1], + vertex_positions[3 * triangle_indices[3 * primID + 1] + 2]); + Vec3faType v2( + vertex_positions[3 * triangle_indices[3 * primID + 2] + 0], + vertex_positions[3 * triangle_indices[3 * primID + 2] + 1], + vertex_positions[3 * triangle_indices[3 * primID + 2] + 2]); // Determine distance to closest point on triangle float u, v; - const Vec3fa p = closestPointTriangle(q, v0, v1, v2, u, v); + const Vec3faType p = + closestPointTriangle(q, v0, v1, v2, u, v); float d = (q - p).norm(); // Store result in userPtr and update the query radius if we found a @@ -308,9 +338,9 @@ bool ClosestPointFunc(RTCPointQueryFunctionArguments* args) { result->p = p; result->primID = primID; result->geomID = geomID; - Vec3fa e1 = v1 - v0; - Vec3fa e2 = v2 - v0; - result->uv = Vec2f(u, v); + Vec3faType e1 = v1 - v0; + Vec3faType e2 = v2 - v0; + result->uv = Vec2fType(u, v); result->n = (e1.cross(e2)).normalized(); return true; // Return true to indicate that the query radius // changed. @@ -326,18 +356,17 @@ namespace t { namespace geometry { struct RaycastingScene::Impl { - // The maximum number of rays used in calls to embree. - const size_t BATCH_SIZE = 1024; - RTCDevice device_; RTCScene scene_; bool scene_committed_; // true if the scene has been committed. + RTCDevice device_; // Vector for storing some information about the added geometry. - std::vector> - geometry_ptrs_; - core::Device tensor_device_; // cpu + std::vector geometry_ptrs_; + core::Device tensor_device_; // cpu or sycl bool devprop_join_commit; + virtual ~Impl() = default; + void CommitScene() { if (!scene_committed_) { if (devprop_join_commit) { @@ -349,7 +378,453 @@ struct RaycastingScene::Impl { } } - template + virtual void CastRays(const float* const rays, + const size_t num_rays, + float* t_hit, + unsigned int* geometry_ids, + unsigned int* primitive_ids, + float* primitive_uvs, + float* primitive_normals, + const int nthreads, + const bool line_intersection) = 0; + + virtual void TestOcclusions(const float* const rays, + const size_t num_rays, + const float tnear, + const float tfar, + int8_t* occluded, + const int nthreads) = 0; + + virtual void CountIntersections(const float* const rays, + const size_t num_rays, + int* intersections, + const int nthreads) = 0; + + virtual void ListIntersections(const float* const rays, + const size_t num_rays, + const size_t num_intersections, + int* cumsum, + unsigned int* track_intersections, + unsigned int* ray_ids, + unsigned int* geometry_ids, + unsigned int* primitive_ids, + float* primitive_uvs, + float* t_hit, + const int nthreads) = 0; + + virtual void ComputeClosestPoints(const float* const query_points, + const size_t num_query_points, + float* closest_points, + unsigned int* geometry_ids, + unsigned int* primitive_ids, + float* primitive_uvs, + float* primitive_normals, + const int nthreads) = 0; + + virtual void ArraySum(int* data_ptr, + size_t num_elements, + size_t& result) = 0; + + virtual void ArrayPartialSum(int* input, + int* output, + size_t num_elements) = 0; + + virtual void CopyArray(int* src, uint32_t* dst, size_t num_elements) = 0; +}; + +#ifdef BUILD_SYCL_MODULE +struct RaycastingScene::SYCLImpl : public RaycastingScene::Impl { + // SYCL variables + sycl::queue queue_; + sycl::context context_; + sycl::device sycl_device_; + + callbacks::GeomPrimID* li_previous_geom_prim_ID_tfar = nullptr; + callbacks::GeomPrimID* ci_previous_geom_prim_ID_tfar = nullptr; + + ~SYCLImpl() { + if (li_previous_geom_prim_ID_tfar) { + sycl::free(li_previous_geom_prim_ID_tfar, queue_); + } + if (ci_previous_geom_prim_ID_tfar) { + sycl::free(ci_previous_geom_prim_ID_tfar, queue_); + } + } + + void InitializeDevice() { + try { + sycl_device_ = sycl::device(rtcSYCLDeviceSelector); + } catch (std::exception& e) { + utility::LogError("Caught exception creating sycl::device: {}", + e.what()); + return; + } + + queue_ = sycl::queue(sycl_device_); + context_ = sycl::context(sycl_device_); + + device_ = rtcNewSYCLDevice(context_, ""); + rtcSetDeviceSYCLDevice(device_, sycl_device_); + + if (!device_) { + utility::LogError("Error %d: cannot create device\n", + rtcGetDeviceError(NULL)); + } + } + + void CastRays(const float* const rays, + const size_t num_rays, + float* t_hit, + unsigned int* geometry_ids, + unsigned int* primitive_ids, + float* primitive_uvs, + float* primitive_normals, + const int nthreads, + const bool line_intersection) override { + CommitScene(); + + auto scene = this->scene_; + queue_.submit([=](sycl::handler& cgh) { + cgh.parallel_for( + sycl::range<1>(num_rays), + [=](sycl::item<1> item, sycl::kernel_handler kh) { + const size_t i = item.get_id(0); + + struct RTCRayHit rh; + const float* r = &rays[i * 6]; + rh.ray.org_x = r[0]; + rh.ray.org_y = r[1]; + rh.ray.org_z = r[2]; + if (line_intersection) { + rh.ray.dir_x = r[3] - r[0]; + rh.ray.dir_y = r[4] - r[1]; + rh.ray.dir_z = r[5] - r[2]; + } else { + rh.ray.dir_x = r[3]; + rh.ray.dir_y = r[4]; + rh.ray.dir_z = r[5]; + } + rh.ray.tnear = 0; + if (line_intersection) { + rh.ray.tfar = 1.f; + } else { + rh.ray.tfar = + std::numeric_limits::infinity(); + } + rh.ray.mask = -1; + rh.ray.id = i; + rh.ray.flags = 0; + rh.hit.geomID = RTC_INVALID_GEOMETRY_ID; + rh.hit.instID[0] = RTC_INVALID_GEOMETRY_ID; + + rtcIntersect1(scene, &rh); + + t_hit[i] = rh.ray.tfar; + if (rh.hit.geomID != RTC_INVALID_GEOMETRY_ID) { + geometry_ids[i] = rh.hit.geomID; + primitive_ids[i] = rh.hit.primID; + primitive_uvs[i * 2 + 0] = rh.hit.u; + primitive_uvs[i * 2 + 1] = rh.hit.v; + float inv_norm = + 1.f / std::sqrt(rh.hit.Ng_x * rh.hit.Ng_x + + rh.hit.Ng_y * rh.hit.Ng_y + + rh.hit.Ng_z * rh.hit.Ng_z); + primitive_normals[i * 3 + 0] = + rh.hit.Ng_x * inv_norm; + primitive_normals[i * 3 + 1] = + rh.hit.Ng_y * inv_norm; + primitive_normals[i * 3 + 2] = + rh.hit.Ng_z * inv_norm; + } else { + geometry_ids[i] = RTC_INVALID_GEOMETRY_ID; + primitive_ids[i] = RTC_INVALID_GEOMETRY_ID; + primitive_uvs[i * 2 + 0] = 0; + primitive_uvs[i * 2 + 1] = 0; + primitive_normals[i * 3 + 0] = 0; + primitive_normals[i * 3 + 1] = 0; + primitive_normals[i * 3 + 2] = 0; + } + }); + }); + queue_.wait_and_throw(); + } + + void TestOcclusions(const float* const rays, + const size_t num_rays, + const float tnear, + const float tfar, + int8_t* occluded, + const int nthreads) override { + CommitScene(); + + auto scene = this->scene_; + queue_.submit([=](sycl::handler& cgh) { + cgh.parallel_for( + sycl::range<1>(num_rays), + [=](sycl::item<1> item, sycl::kernel_handler kh) { + struct RTCRayQueryContext context; + rtcInitRayQueryContext(&context); + + RTCOccludedArguments args; + rtcInitOccludedArguments(&args); + args.context = &context; + + const size_t i = item.get_id(0); + + struct RTCRay ray; + const float* r = &rays[i * 6]; + ray.org_x = r[0]; + ray.org_y = r[1]; + ray.org_z = r[2]; + ray.dir_x = r[3]; + ray.dir_y = r[4]; + ray.dir_z = r[5]; + ray.tnear = tnear; + ray.tfar = tfar; + ray.mask = -1; + ray.id = i; + ray.flags = 0; + + rtcOccluded1(scene, &ray, &args); + + occluded[i] = int8_t( + -std::numeric_limits::infinity() == + ray.tfar); + }); + }); + queue_.wait_and_throw(); + } + + void CountIntersections(const float* const rays, + const size_t num_rays, + int* intersections, + const int nthreads) override { + CommitScene(); + + queue_.memset(intersections, 0, sizeof(int) * num_rays).wait(); + + ci_previous_geom_prim_ID_tfar = + sycl::malloc_device(num_rays, queue_); + + // Check if allocation was successful + if (!ci_previous_geom_prim_ID_tfar) { + throw std::runtime_error("Failed to allocate device memory"); + } + + auto host_previous_geom_prim_ID_tfar = + std::unique_ptr>( + new callbacks::GeomPrimID[num_rays]); + for (size_t i = 0; i < num_rays; ++i) { + host_previous_geom_prim_ID_tfar[i] = { + uint32_t(RTC_INVALID_GEOMETRY_ID), + uint32_t(RTC_INVALID_GEOMETRY_ID), 0.f}; + } + + // Copy the initialized data to the device + queue_.memcpy(ci_previous_geom_prim_ID_tfar, + host_previous_geom_prim_ID_tfar.get(), + num_rays * sizeof(callbacks::GeomPrimID)) + .wait(); + + auto scene = this->scene_; + auto ci_previous_geom_prim_ID_tfar_ = ci_previous_geom_prim_ID_tfar; + queue_.submit([=](sycl::handler& cgh) { + cgh.parallel_for( + sycl::range<1>(num_rays), + [=](sycl::item<1> item, sycl::kernel_handler kh) { + callbacks::CountIntersectionsContext context; + rtcInitRayQueryContext(&context.context); + context.previous_geom_prim_ID_tfar = + ci_previous_geom_prim_ID_tfar_; + context.intersections = intersections; + + RTCIntersectArguments args; + rtcInitIntersectArguments(&args); + args.filter = callbacks::CountIntersectionsFunc; + args.context = &context.context; + + const size_t i = item.get_id(0); + + struct RTCRayHit rh; + const float* r = &rays[i * 6]; + rh.ray.org_x = r[0]; + rh.ray.org_y = r[1]; + rh.ray.org_z = r[2]; + rh.ray.dir_x = r[3]; + rh.ray.dir_y = r[4]; + rh.ray.dir_z = r[5]; + rh.ray.tnear = 0; + rh.ray.tfar = std::numeric_limits::infinity(); + rh.ray.mask = -1; + rh.ray.flags = 0; + rh.ray.id = i; + rh.hit.geomID = RTC_INVALID_GEOMETRY_ID; + rh.hit.instID[0] = RTC_INVALID_GEOMETRY_ID; + + rtcIntersect1(scene, &rh, &args); + }); + }); + queue_.wait_and_throw(); + + // Free the allocated memory + sycl::free(ci_previous_geom_prim_ID_tfar, queue_); + ci_previous_geom_prim_ID_tfar = nullptr; + } + + void ListIntersections(const float* const rays, + const size_t num_rays, + const size_t num_intersections, + int* cumsum, + unsigned int* track_intersections, + unsigned int* ray_ids, + unsigned int* geometry_ids, + unsigned int* primitive_ids, + float* primitive_uvs, + float* t_hit, + const int nthreads) override { + CommitScene(); + + queue_.memset(track_intersections, 0, sizeof(uint32_t) * num_rays) + .wait(); + queue_.memset(ray_ids, 0, sizeof(uint32_t) * num_intersections).wait(); + queue_.memset(geometry_ids, 0, sizeof(uint32_t) * num_intersections) + .wait(); + queue_.memset(primitive_ids, 0, sizeof(uint32_t) * num_intersections) + .wait(); + queue_.memset(primitive_uvs, 0, sizeof(float) * num_intersections * 2) + .wait(); + queue_.memset(t_hit, 0, sizeof(float) * num_intersections).wait(); + + li_previous_geom_prim_ID_tfar = + sycl::malloc_device(num_rays, queue_); + + // Check if allocation was successful + if (!li_previous_geom_prim_ID_tfar) { + throw std::runtime_error("Failed to allocate device memory"); + } + + auto host_previous_geom_prim_ID_tfar = + std::unique_ptr>( + new callbacks::GeomPrimID[num_rays]); + for (size_t i = 0; i < num_rays; ++i) { + host_previous_geom_prim_ID_tfar[i] = { + uint32_t(RTC_INVALID_GEOMETRY_ID), + uint32_t(RTC_INVALID_GEOMETRY_ID), 0.f}; + } + + // Copy the initialized data to the device + queue_.memcpy(li_previous_geom_prim_ID_tfar, + host_previous_geom_prim_ID_tfar.get(), + num_rays * sizeof(callbacks::GeomPrimID)) + .wait(); + + auto scene = this->scene_; + auto li_previous_geom_prim_ID_tfar_ = li_previous_geom_prim_ID_tfar; + queue_.submit([=](sycl::handler& cgh) { + cgh.parallel_for( + sycl::range<1>(num_rays), + [=](sycl::item<1> item, sycl::kernel_handler kh) { + callbacks::ListIntersectionsContext context; + rtcInitRayQueryContext(&context.context); + context.previous_geom_prim_ID_tfar = + li_previous_geom_prim_ID_tfar_; + context.ray_ids = ray_ids; + context.geometry_ids = geometry_ids; + context.primitive_ids = primitive_ids; + context.primitive_uvs = primitive_uvs; + context.t_hit = t_hit; + context.cumsum = cumsum; + context.track_intersections = track_intersections; + + RTCIntersectArguments args; + rtcInitIntersectArguments(&args); + args.filter = callbacks::ListIntersectionsFunc; + args.context = &context.context; + + const size_t i = item.get_id(0); + + struct RTCRayHit rh; + const float* r = &rays[i * 6]; + rh.ray.org_x = r[0]; + rh.ray.org_y = r[1]; + rh.ray.org_z = r[2]; + rh.ray.dir_x = r[3]; + rh.ray.dir_y = r[4]; + rh.ray.dir_z = r[5]; + rh.ray.tnear = 0; + rh.ray.tfar = std::numeric_limits::infinity(); + rh.ray.mask = -1; + rh.ray.flags = 0; + rh.ray.id = i; + rh.hit.geomID = RTC_INVALID_GEOMETRY_ID; + rh.hit.instID[0] = RTC_INVALID_GEOMETRY_ID; + + rtcIntersect1(scene, &rh, &args); + }); + }); + queue_.wait_and_throw(); + + // Free the allocated memory + sycl::free(li_previous_geom_prim_ID_tfar, queue_); + li_previous_geom_prim_ID_tfar = nullptr; + } + + void ComputeClosestPoints(const float* const query_points, + const size_t num_query_points, + float* closest_points, + unsigned int* geometry_ids, + unsigned int* primitive_ids, + float* primitive_uvs, + float* primitive_normals, + const int nthreads) override { + throw std::logic_error("Function not yet implemented"); + } + + void ArraySum(int* data_ptr, size_t num_elements, size_t& result) override { + sycl::buffer result_buf(&result, sycl::range<1>(1)); + + queue_.submit([&](sycl::handler& cgh) { + auto result_acc = + result_buf.get_access(cgh); + cgh.parallel_for( + sycl::range<1>(num_elements), + [=](sycl::item<1> item, sycl::kernel_handler kh) { + const size_t i = item.get_id(0); + sycl::atomic_ref + atomic_result_data(result_acc[0]); + atomic_result_data.fetch_add(data_ptr[i]); + }); + }); + queue_.wait_and_throw(); + } + + void ArrayPartialSum(int* input, + int* output, + size_t num_elements) override { + queue_.submit([&](sycl::handler& cgh) { + cgh.single_task([=]() { + for (size_t idx = 1; idx < num_elements; ++idx) { + output[idx] = output[idx - 1] + input[idx - 1]; + } + }); + }); + + queue_.wait_and_throw(); + } + + void CopyArray(int* src, uint32_t* dst, size_t num_elements) override { + queue_.memcpy(dst, src, num_elements * sizeof(uint32_t)).wait(); + } +}; +#endif + +struct RaycastingScene::CPUImpl : public RaycastingScene::Impl { + // The maximum number of rays used in calls to embree. + const size_t BATCH_SIZE = 1024; + void CastRays(const float* const rays, const size_t num_rays, float* t_hit, @@ -357,7 +832,8 @@ struct RaycastingScene::Impl { unsigned int* primitive_ids, float* primitive_uvs, float* primitive_normals, - const int nthreads) { + const int nthreads, + const bool line_intersection) override { CommitScene(); auto LoopFn = [&](const tbb::blocked_range& range) { @@ -369,7 +845,7 @@ struct RaycastingScene::Impl { rh.ray.org_x = r[0]; rh.ray.org_y = r[1]; rh.ray.org_z = r[2]; - if (LINE_INTERSECTION) { + if (line_intersection) { rh.ray.dir_x = r[3] - r[0]; rh.ray.dir_y = r[4] - r[1]; rh.ray.dir_z = r[5] - r[2]; @@ -379,7 +855,7 @@ struct RaycastingScene::Impl { rh.ray.dir_z = r[5]; } rh.ray.tnear = 0; - if (LINE_INTERSECTION) { + if (line_intersection) { rh.ray.tfar = 1.f; } else { rh.ray.tfar = std::numeric_limits::infinity(); @@ -439,7 +915,7 @@ struct RaycastingScene::Impl { const float tnear, const float tfar, int8_t* occluded, - const int nthreads) { + const int nthreads) override { CommitScene(); struct RTCRayQueryContext context; @@ -494,26 +970,29 @@ struct RaycastingScene::Impl { void CountIntersections(const float* const rays, const size_t num_rays, int* intersections, - const int nthreads) { + const int nthreads) override { CommitScene(); - memset(intersections, 0, sizeof(int) * num_rays); + std::memset(intersections, 0, sizeof(int) * num_rays); - std::vector> - previous_geom_prim_ID_tfar( - num_rays, - std::make_tuple(uint32_t(RTC_INVALID_GEOMETRY_ID), - uint32_t(RTC_INVALID_GEOMETRY_ID), - 0.f)); + auto previous_geom_prim_ID_tfar = + std::unique_ptr>( + new callbacks::GeomPrimID[num_rays]); + for (size_t i = 0; i < num_rays; ++i) { + previous_geom_prim_ID_tfar[i] = {uint32_t(RTC_INVALID_GEOMETRY_ID), + uint32_t(RTC_INVALID_GEOMETRY_ID), + 0.f}; + } - CountIntersectionsContext context; + callbacks::CountIntersectionsContext context; rtcInitRayQueryContext(&context.context); - context.previous_geom_prim_ID_tfar = &previous_geom_prim_ID_tfar; + context.previous_geom_prim_ID_tfar = previous_geom_prim_ID_tfar.get(); context.intersections = intersections; RTCIntersectArguments args; rtcInitIntersectArguments(&args); - args.filter = CountIntersectionsFunc; + args.filter = callbacks::CountIntersectionsFunc; args.context = &context.context; auto LoopFn = [&](const tbb::blocked_range& range) { @@ -557,33 +1036,36 @@ struct RaycastingScene::Impl { void ListIntersections(const float* const rays, const size_t num_rays, const size_t num_intersections, - const Eigen::VectorXi& cumsum, + int* cumsum, unsigned int* track_intersections, unsigned int* ray_ids, unsigned int* geometry_ids, unsigned int* primitive_ids, float* primitive_uvs, float* t_hit, - const int nthreads) { + const int nthreads) override { CommitScene(); - memset(track_intersections, 0, sizeof(uint32_t) * num_rays); - memset(ray_ids, 0, sizeof(uint32_t) * num_intersections); - memset(geometry_ids, 0, sizeof(uint32_t) * num_intersections); - memset(primitive_ids, 0, sizeof(uint32_t) * num_intersections); - memset(primitive_uvs, 0, sizeof(float) * num_intersections * 2); - memset(t_hit, 0, sizeof(float) * num_intersections); - - std::vector> - previous_geom_prim_ID_tfar( - num_rays, - std::make_tuple(uint32_t(RTC_INVALID_GEOMETRY_ID), - uint32_t(RTC_INVALID_GEOMETRY_ID), - 0.f)); - - ListIntersectionsContext context; + std::memset(track_intersections, 0, sizeof(uint32_t) * num_rays); + std::memset(ray_ids, 0, sizeof(uint32_t) * num_intersections); + std::memset(geometry_ids, 0, sizeof(uint32_t) * num_intersections); + std::memset(primitive_ids, 0, sizeof(uint32_t) * num_intersections); + std::memset(primitive_uvs, 0, sizeof(float) * num_intersections * 2); + std::memset(t_hit, 0, sizeof(float) * num_intersections); + + auto previous_geom_prim_ID_tfar = + std::unique_ptr>( + new callbacks::GeomPrimID[num_rays]); + for (size_t i = 0; i < num_rays; ++i) { + previous_geom_prim_ID_tfar[i] = {uint32_t(RTC_INVALID_GEOMETRY_ID), + uint32_t(RTC_INVALID_GEOMETRY_ID), + 0.f}; + } + + callbacks::ListIntersectionsContext context; rtcInitRayQueryContext(&context.context); - context.previous_geom_prim_ID_tfar = &previous_geom_prim_ID_tfar; + context.previous_geom_prim_ID_tfar = previous_geom_prim_ID_tfar.get(); context.ray_ids = ray_ids; context.geometry_ids = geometry_ids; context.primitive_ids = primitive_ids; @@ -594,7 +1076,7 @@ struct RaycastingScene::Impl { RTCIntersectArguments args; rtcInitIntersectArguments(&args); - args.filter = ListIntersectionsFunc; + args.filter = callbacks::ListIntersectionsFunc; args.context = &context.context; auto LoopFn = [&](const tbb::blocked_range& range) { @@ -642,7 +1124,7 @@ struct RaycastingScene::Impl { unsigned int* primitive_ids, float* primitive_uvs, float* primitive_normals, - const int nthreads) { + const int nthreads) override { CommitScene(); auto LoopFn = [&](const tbb::blocked_range& range) { @@ -654,12 +1136,13 @@ struct RaycastingScene::Impl { query.radius = std::numeric_limits::infinity(); query.time = 0.f; - ClosestPointResult result; - result.geometry_ptrs_ptr = &geometry_ptrs_; + ClosestPointResult result; + result.geometry_ptrs_ptr = geometry_ptrs_.data(); RTCPointQueryContext instStack; rtcInitPointQueryContext(&instStack); - rtcPointQuery(scene_, &query, &instStack, &ClosestPointFunc, + rtcPointQuery(scene_, &query, &instStack, + &ClosestPointFunc, (void*)&result); closest_points[3 * i + 0] = result.p.x(); @@ -688,16 +1171,44 @@ struct RaycastingScene::Impl { LoopFn); } } + + void ArraySum(int* data_ptr, size_t num_elements, size_t& result) override { + result = std::accumulate(data_ptr, data_ptr + num_elements, result); + } + + void ArrayPartialSum(int* input, + int* output, + size_t num_elements) override { + output[0] = 0; + std::partial_sum(input, input + num_elements - 1, output + 1); + } + + void CopyArray(int* src, uint32_t* dst, size_t num_elements) override { + std::copy(src, src + num_elements, dst); + } }; -RaycastingScene::RaycastingScene(int64_t nthreads) - : impl_(new RaycastingScene::Impl()) { - if (nthreads > 0) { - std::string config("threads=" + std::to_string(nthreads)); - impl_->device_ = rtcNewDevice(config.c_str()); +RaycastingScene::RaycastingScene(int64_t nthreads, const core::Device& device) { +#ifdef BUILD_SYCL_MODULE + if (device.IsSYCL()) { + impl_ = std::make_unique(); + dynamic_cast(impl_.get()) + ->InitializeDevice(); + impl_->tensor_device_ = device; } else { - impl_->device_ = rtcNewDevice(NULL); +#endif + impl_ = std::make_unique(); + + if (nthreads > 0) { + std::string config("threads=" + std::to_string(nthreads)); + impl_->device_ = rtcNewDevice(config.c_str()); + } else { + impl_->device_ = rtcNewDevice(NULL); + } +#ifdef BUILD_SYCL_MODULE } +#endif + rtcSetDeviceErrorFunction(impl_->device_, ErrorFunction, NULL); impl_->scene_ = rtcNewScene(impl_->device_); @@ -745,13 +1256,37 @@ uint32_t RaycastingScene::AddTriangles(const core::Tensor& vertex_positions, { auto data = vertex_positions.Contiguous(); - memcpy(vertex_buffer, data.GetDataPtr(), - sizeof(float) * 3 * num_vertices); +#ifdef BUILD_SYCL_MODULE + if (impl_->tensor_device_.IsSYCL()) { + dynamic_cast(impl_.get()) + ->queue_ + .memcpy(vertex_buffer, data.GetDataPtr(), + sizeof(float) * 3 * num_vertices) + .wait(); + } else { +#endif + std::memcpy(vertex_buffer, data.GetDataPtr(), + sizeof(float) * 3 * num_vertices); +#ifdef BUILD_SYCL_MODULE + } +#endif } { auto data = triangle_indices.Contiguous(); - memcpy(index_buffer, data.GetDataPtr(), - sizeof(uint32_t) * 3 * num_triangles); +#ifdef BUILD_SYCL_MODULE + if (impl_->tensor_device_.IsSYCL()) { + dynamic_cast(impl_.get()) + ->queue_ + .memcpy(index_buffer, data.GetDataPtr(), + sizeof(uint32_t) * 3 * num_triangles) + .wait(); + } else { +#endif + std::memcpy(index_buffer, data.GetDataPtr(), + sizeof(uint32_t) * 3 * num_triangles); +#ifdef BUILD_SYCL_MODULE + } +#endif } rtcSetGeometryEnableFilterFunctionFromArguments(geom, true); rtcCommitGeometry(geom); @@ -759,9 +1294,10 @@ uint32_t RaycastingScene::AddTriangles(const core::Tensor& vertex_positions, uint32_t geom_id = rtcAttachGeometry(impl_->scene_, geom); rtcReleaseGeometry(geom); - impl_->geometry_ptrs_.push_back(std::make_tuple(RTC_GEOMETRY_TYPE_TRIANGLE, - (const void*)vertex_buffer, - (const void*)index_buffer)); + GeometryPtr geometry_ptr = {RTC_GEOMETRY_TYPE_TRIANGLE, + (const void*)vertex_buffer, + (const void*)index_buffer}; + impl_->geometry_ptrs_.push_back(geometry_ptr); return geom_id; } @@ -786,22 +1322,26 @@ std::unordered_map RaycastingScene::CastRays( size_t num_rays = shape.NumElements(); std::unordered_map result; - result["t_hit"] = core::Tensor(shape, core::Float32); - result["geometry_ids"] = core::Tensor(shape, core::UInt32); - result["primitive_ids"] = core::Tensor(shape, core::UInt32); + result["t_hit"] = core::Tensor(shape, core::Float32, rays.GetDevice()); + result["geometry_ids"] = + core::Tensor(shape, core::UInt32, rays.GetDevice()); + result["primitive_ids"] = + core::Tensor(shape, core::UInt32, rays.GetDevice()); shape.push_back(2); - result["primitive_uvs"] = core::Tensor(shape, core::Float32); + result["primitive_uvs"] = + core::Tensor(shape, core::Float32, rays.GetDevice()); shape.back() = 3; - result["primitive_normals"] = core::Tensor(shape, core::Float32); + result["primitive_normals"] = + core::Tensor(shape, core::Float32, rays.GetDevice()); auto data = rays.Contiguous(); - impl_->CastRays(data.GetDataPtr(), num_rays, - result["t_hit"].GetDataPtr(), - result["geometry_ids"].GetDataPtr(), - result["primitive_ids"].GetDataPtr(), - result["primitive_uvs"].GetDataPtr(), - result["primitive_normals"].GetDataPtr(), - nthreads); + impl_->CastRays(data.GetDataPtr(), num_rays, + result["t_hit"].GetDataPtr(), + result["geometry_ids"].GetDataPtr(), + result["primitive_ids"].GetDataPtr(), + result["primitive_uvs"].GetDataPtr(), + result["primitive_normals"].GetDataPtr(), nthreads, + false); return result; } @@ -817,7 +1357,7 @@ core::Tensor RaycastingScene::TestOcclusions(const core::Tensor& rays, // results. size_t num_rays = shape.NumElements(); - core::Tensor result(shape, core::Bool); + core::Tensor result(shape, core::Bool, rays.GetDevice()); auto data = rays.Contiguous(); impl_->TestOcclusions(data.GetDataPtr(), num_rays, tnear, tfar, @@ -836,7 +1376,8 @@ core::Tensor RaycastingScene::CountIntersections(const core::Tensor& rays, // results. size_t num_rays = shape.NumElements(); - core::Tensor intersections(shape, core::Dtype::FromType()); + core::Tensor intersections(shape, core::Dtype::FromType(), + impl_->tensor_device_); auto data = rays.Contiguous(); @@ -857,49 +1398,57 @@ RaycastingScene::ListIntersections(const core::Tensor& rays, size_t num_rays = shape.NumElements(); // determine total number of intersections - core::Tensor intersections(shape, core::Dtype::FromType()); - core::Tensor track_intersections(shape, core::Dtype::FromType()); + core::Tensor intersections(shape, core::Dtype::FromType(), + impl_->tensor_device_); + core::Tensor track_intersections(shape, core::Dtype::FromType(), + impl_->tensor_device_); auto data = rays.Contiguous(); impl_->CountIntersections(data.GetDataPtr(), num_rays, intersections.GetDataPtr(), nthreads); // prepare shape with that number of elements - Eigen::Map intersections_vector( - intersections.GetDataPtr(), num_rays); - size_t num_intersections = intersections_vector.sum(); + int* data_ptr = intersections.GetDataPtr(); + size_t num_intersections = 0; + impl_->ArraySum(data_ptr, num_rays, num_intersections); // prepare ray allocations (cumsum) - Eigen::VectorXi cumsum = Eigen::MatrixXi::Zero(num_rays, 1); - std::partial_sum(intersections_vector.begin(), - intersections_vector.end() - 1, cumsum.begin() + 1, - std::plus()); + core::Tensor cumsum_tensor_cpu = + core::Tensor::Zeros(shape, core::Dtype::FromType()); + core::Tensor cumsum_tensor = cumsum_tensor_cpu.To(impl_->tensor_device_); + int* cumsum_ptr = cumsum_tensor.GetDataPtr(); + impl_->ArrayPartialSum(data_ptr, cumsum_ptr, num_rays); // generate results structure std::unordered_map result; shape.clear(); shape.push_back(num_rays + 1); result["ray_splits"] = core::Tensor(shape, core::UInt32); + uint32_t* ptr = result["ray_splits"].GetDataPtr(); - for (int i = 0; i < cumsum.size(); ++i) { - ptr[i] = cumsum[i]; - } + impl_->CopyArray(cumsum_ptr, ptr, num_rays); + ptr[num_rays] = num_intersections; - shape[0] = intersections_vector.sum(); - result["ray_ids"] = core::Tensor(shape, core::UInt32); - result["geometry_ids"] = core::Tensor(shape, core::UInt32); - result["primitive_ids"] = core::Tensor(shape, core::UInt32); - result["t_hit"] = core::Tensor(shape, core::Float32); + shape[0] = num_intersections; + result["ray_ids"] = + core::Tensor(shape, core::UInt32, impl_->tensor_device_); + result["geometry_ids"] = + core::Tensor(shape, core::UInt32, impl_->tensor_device_); + result["primitive_ids"] = + core::Tensor(shape, core::UInt32, impl_->tensor_device_); + result["t_hit"] = core::Tensor(shape, core::Float32, impl_->tensor_device_); shape.push_back(2); - result["primitive_uvs"] = core::Tensor(shape, core::Float32); + result["primitive_uvs"] = + core::Tensor(shape, core::Float32, impl_->tensor_device_); impl_->ListIntersections(data.GetDataPtr(), num_rays, - num_intersections, cumsum, + num_intersections, cumsum_ptr, track_intersections.GetDataPtr(), result["ray_ids"].GetDataPtr(), result["geometry_ids"].GetDataPtr(), result["primitive_ids"].GetDataPtr(), result["primitive_uvs"].GetDataPtr(), result["t_hit"].GetDataPtr(), nthreads); + return result; } @@ -1179,32 +1728,8 @@ namespace fmt { template <> struct formatter { template - auto format(const RTCError& c, FormatContext& ctx) { - const char* name = nullptr; - switch (c) { - case RTC_ERROR_NONE: - name = "RTC_ERROR_NONE"; - break; - case RTC_ERROR_UNKNOWN: - name = "RTC_ERROR_UNKNOWN"; - break; - case RTC_ERROR_INVALID_ARGUMENT: - name = "RTC_ERROR_INVALID_ARGUMENT"; - break; - case RTC_ERROR_INVALID_OPERATION: - name = "RTC_ERROR_INVALID_OPERATION"; - break; - case RTC_ERROR_OUT_OF_MEMORY: - name = "RTC_ERROR_OUT_OF_MEMORY"; - break; - case RTC_ERROR_UNSUPPORTED_CPU: - name = "RTC_ERROR_UNSUPPORTED_CPU"; - break; - case RTC_ERROR_CANCELLED: - name = "RTC_ERROR_CANCELLED"; - break; - } - // return formatter::format(name, ctx); + auto format(const RTCError& c, FormatContext& ctx) const { + const char* name = rtcGetErrorString(c); return format_to(ctx.out(), name); } diff --git a/cpp/open3d/t/geometry/RaycastingScene.h b/cpp/open3d/t/geometry/RaycastingScene.h index f25d994b0b5..bd565c4d18f 100644 --- a/cpp/open3d/t/geometry/RaycastingScene.h +++ b/cpp/open3d/t/geometry/RaycastingScene.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -30,14 +30,16 @@ namespace geometry { class RaycastingScene { public: /// \brief Default Constructor. - RaycastingScene(int64_t nthreads = 0); + RaycastingScene(int64_t nthreads = 0, + const core::Device &device = core::Device("CPU:0")); ~RaycastingScene(); /// \brief Add a triangle mesh to the scene. /// \param vertex_positions Vertices as Tensor of dim {N,3} and dtype float. /// \param triangle_indices Triangles as Tensor of dim {M,3} and dtype - /// uint32_t. \return The geometry ID of the added mesh. + /// uint32_t. + /// \return The geometry ID of the added mesh. uint32_t AddTriangles(const core::Tensor &vertex_positions, const core::Tensor &triangle_indices); @@ -250,6 +252,10 @@ class RaycastingScene { private: struct Impl; + struct CPUImpl; +#ifdef BUILD_SYCL_MODULE + struct SYCLImpl; +#endif std::unique_ptr impl_; }; diff --git a/cpp/open3d/t/geometry/TensorMap.cpp b/cpp/open3d/t/geometry/TensorMap.cpp index f47bcaf0955..aabec93b8fa 100644 --- a/cpp/open3d/t/geometry/TensorMap.cpp +++ b/cpp/open3d/t/geometry/TensorMap.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/TensorMap.h b/cpp/open3d/t/geometry/TensorMap.h index 699268cea37..9dc2d66c469 100644 --- a/cpp/open3d/t/geometry/TensorMap.h +++ b/cpp/open3d/t/geometry/TensorMap.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/TriangleMesh.cpp b/cpp/open3d/t/geometry/TriangleMesh.cpp index 40fbac9955d..fee48dde3e2 100644 --- a/cpp/open3d/t/geometry/TriangleMesh.cpp +++ b/cpp/open3d/t/geometry/TriangleMesh.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -20,6 +20,8 @@ #include #include "open3d/core/CUDAUtils.h" +#include "open3d/core/Device.h" +#include "open3d/core/Dtype.h" #include "open3d/core/EigenConverter.h" #include "open3d/core/ShapeUtil.h" #include "open3d/core/Tensor.h" @@ -28,6 +30,7 @@ #include "open3d/t/geometry/PointCloud.h" #include "open3d/t/geometry/RaycastingScene.h" #include "open3d/t/geometry/VtkUtils.h" +#include "open3d/t/geometry/kernel/Metrics.h" #include "open3d/t/geometry/kernel/PCAPartition.h" #include "open3d/t/geometry/kernel/PointCloud.h" #include "open3d/t/geometry/kernel/Transform.h" @@ -318,6 +321,12 @@ TriangleMesh &TriangleMesh::ComputeTriangleAreas() { utility::LogWarning("TriangleMesh has no triangle indices."); return *this; } + if (HasTriangleAttr("areas")) { + utility::LogWarning( + "TriangleMesh already has triangle areas: remove " + "'areas' triangle attribute if you'd like to update."); + return *this; + } core::Tensor triangle_areas = ComputeTriangleAreasHelper(*this); SetTriangleAttr("areas", triangle_areas); @@ -1410,7 +1419,9 @@ TriangleMesh TriangleMesh::RemoveNonManifoldEdges() { core::Tensor tris_cpu = GetTriangleIndices().To(core::Device()).Contiguous(); - ComputeTriangleAreas(); + if (!HasTriangleAttr("areas")) { + ComputeTriangleAreas(); + } core::Tensor tri_areas_cpu = GetTriangleAttr("areas").To(core::Device()).Contiguous(); @@ -1513,6 +1524,109 @@ core::Tensor TriangleMesh::GetNonManifoldEdges( return result; } +PointCloud TriangleMesh::SamplePointsUniformly( + size_t number_of_points, bool use_triangle_normal /*=false*/) { + if (number_of_points <= 0) { + utility::LogError("number_of_points <= 0"); + } + if (IsEmpty()) { + utility::LogError("Input mesh is empty. Cannot sample points."); + } + if (!HasTriangleIndices()) { + utility::LogError("Input mesh has no triangles. Cannot sample points."); + } + if (use_triangle_normal && !HasTriangleNormals()) { + ComputeTriangleNormals(true); + } + if (!HasTriangleAttr("areas")) { + ComputeTriangleAreas(); // Compute area of each triangle + } + if (!IsCPU()) { + utility::LogWarning( + "SamplePointsUniformly is implemented only on CPU. Computing " + "on CPU."); + } + bool use_vert_normals = HasVertexNormals() && !use_triangle_normal; + bool use_albedo = + HasTriangleAttr("texture_uvs") && GetMaterial().HasAlbedoMap(); + bool use_vert_colors = HasVertexColors() && !use_albedo; + + auto cpu = core::Device(); + core::Tensor null_tensor({0}, core::Float32); // zero size tensor + auto triangles = GetTriangleIndices().To(cpu).Contiguous(), + vertices = GetVertexPositions().To(cpu).Contiguous(); + auto float_dt = vertices.GetDtype(); + auto areas = GetTriangleAttr("areas").To(cpu, float_dt).Contiguous(), + vertex_normals = + use_vert_normals + ? GetVertexNormals().To(cpu, float_dt).Contiguous() + : null_tensor, + triangle_normals = + use_triangle_normal + ? GetTriangleNormals().To(cpu, float_dt).Contiguous() + : null_tensor, + vertex_colors = + use_vert_colors + ? GetVertexColors().To(cpu, core::Float32).Contiguous() + : null_tensor, + texture_uvs = use_albedo ? GetTriangleAttr("texture_uvs") + .To(cpu, float_dt) + .Contiguous() + : null_tensor, + // With correct range conversion [0,255] -> [0,1] + albedo = use_albedo ? GetMaterial() + .GetAlbedoMap() + .To(core::Float32) + .To(cpu) + .AsTensor() + : null_tensor; + if (use_vert_colors) { + if (GetVertexColors().GetDtype() == core::UInt8) vertex_colors /= 255; + if (GetVertexColors().GetDtype() == core::UInt16) + vertex_colors /= 65535; + } + + std::array result = + kernel::trianglemesh::SamplePointsUniformlyCPU( + triangles, vertices, areas, vertex_normals, vertex_colors, + triangle_normals, texture_uvs, albedo, number_of_points); + + PointCloud pcd(result[0]); + if (use_vert_normals || use_triangle_normal) pcd.SetPointNormals(result[1]); + if (use_albedo || use_vert_colors) pcd.SetPointColors(result[2]); + return pcd.To(GetDevice()); +} + +core::Tensor TriangleMesh::ComputeMetrics(const TriangleMesh &mesh2, + std::vector metrics, + MetricParameters params) const { + if (IsEmpty() || mesh2.IsEmpty()) { + utility::LogError("One or both input triangle meshes are empty!"); + } + if (!IsCPU() || !mesh2.IsCPU()) { + utility::LogWarning( + "ComputeDistance is implemented only on CPU. Computing on " + "CPU."); + } + auto cpu_mesh1 = To(core::Device("CPU:0")), + cpu_mesh2 = mesh2.To(core::Device("CPU:0")); + core::Tensor points1 = + cpu_mesh1.SamplePointsUniformly(params.n_sampled_points) + .GetPointPositions(); + core::Tensor points2 = + cpu_mesh2.SamplePointsUniformly(params.n_sampled_points) + .GetPointPositions(); + + RaycastingScene scene1, scene2; + scene1.AddTriangles(cpu_mesh1); + scene2.AddTriangles(cpu_mesh2); + + core::Tensor distance21 = scene1.ComputeDistance(points2); + core::Tensor distance12 = scene2.ComputeDistance(points1); + + return ComputeMetricsCommon(distance12, distance21, metrics, params); +} + } // namespace geometry } // namespace t } // namespace open3d diff --git a/cpp/open3d/t/geometry/TriangleMesh.h b/cpp/open3d/t/geometry/TriangleMesh.h index 9d9149d3cb6..a33ee147883 100644 --- a/cpp/open3d/t/geometry/TriangleMesh.h +++ b/cpp/open3d/t/geometry/TriangleMesh.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -24,6 +24,7 @@ namespace t { namespace geometry { class LineSet; +class PointCloud; /// \class TriangleMesh /// \brief A triangle mesh contains vertices and triangles. @@ -596,6 +597,20 @@ class TriangleMesh : public Geometry, public DrawableGeometry { core::Dtype int_dtype = core::Int64, const core::Device &device = core::Device("CPU:0")); + /// Create a mesh from a 3D scalar field (volume) by computing the + /// isosurface. This method uses the Flying Edges dual contouring method + /// that computes the isosurface similar to Marching Cubes. The center of + /// the first voxel of the volume is at the origin (0,0,0). The center of + /// the voxel at index [z,y,x] will be at (x,y,z). + /// \param volume 3D tensor with the volume. + /// \param contour_values A list of contour values at which isosurfaces will + /// be generated. The default value is 0. + /// \param device The device for the returned mesh. + static TriangleMesh CreateIsosurfaces( + const core::Tensor &volume, + const std::vector contour_values = {0.0}, + const core::Device &device = core::Device("CPU:0")); + public: /// Clear all data in the trianglemesh. TriangleMesh &Clear() override { @@ -994,6 +1009,59 @@ class TriangleMesh : public Geometry, public DrawableGeometry { /// If mesh is empty or has no triangles, returns an empty tensor. core::Tensor GetNonManifoldEdges(bool allow_boundary_edges = true) const; + /// Sample points uniformly from the triangle mesh surface and return as a + /// PointCloud. Normals and colors are interpolated from the triangle mesh. + /// If texture_uvs and albedo are present, these are used to estimate the + /// sampled point color, otherwise vertex colors are used, if present. + /// During sampling, triangle areas are computed and saved in the "areas" + /// attribute. + /// \param number_of_points The number of points to sample. + /// \param use_triangle_normal If true, use the triangle normal as the + /// normal of the sampled point. Otherwise, interpolate the vertex normals. + PointCloud SamplePointsUniformly(size_t number_of_points, + bool use_triangle_normal = false); + + /// Compute various metrics between two triangle meshes. This uses ray + /// casting for distance computations between a sampled point cloud and a + /// triangle mesh. Currently, Chamfer distance, Hausdorff distance and + /// F-Score [[Knapitsch2017]] + /// are supported. The Chamfer distance is the sum of the mean distance to + /// the nearest neighbor from the sampled surface points of the first mesh + /// to the second mesh and vice versa. The F-Score at a fixed threshold + /// radius is the harmonic mean of the Precision and Recall. Recall is the + /// percentage of surface points from the first mesh that have the second + /// mesh within the threshold radius, while Precision is the percentage of + /// sampled points from the second mesh that have the first mesh surface + /// within the threhold radius. + + /// \f{eqnarray*}{ + /// \text{Chamfer Distance: } d_{CD}(X,Y) &=& \frac{1}{|X|}\sum_{i \in X} + /// || x_i - n(x_i, Y) || + \frac{1}{|Y|}\sum_{i \in Y} || y_i - n(y_i, X) + /// || \\{} + /// \text{Hausdorff distance: } d_H(X,Y) &=& \max \left\{ \max_{i \in X} + /// || x_i - n(x_i, Y) ||, \max_{i \in Y} || y_i - n(y_i, X) || \right\} + /// \\{} + /// \text{Precision: } P(X,Y|d) &=& \frac{100}{|X|} \sum_{i \in X} || x_i + /// - n(x_i, Y) || < d \\{} + /// \text{Recall: } R(X,Y|d) &=& \frac{100}{|Y|} \sum_{i \in Y} || y_i - + /// n(y_i, X) || < d \\{} + /// \text{F-Score: } F(X,Y|d) &=& \frac{2 P(X,Y|d) R(X,Y|d)}{P(X,Y|d) + + /// R(X,Y|d)} + /// \f} + + /// As a side effect, the triangle areas are saved in the "areas" attribute. + /// \param mesh2 Other point cloud to compare with. + /// \param metrics List of Metric s to compute. Multiple metrics can be + /// computed at once for efficiency. + /// \param params MetricParameters struct holds parameters required by + /// different metrics. + /// \returns Tensor containing the requested metrics. + core::Tensor ComputeMetrics( + const TriangleMesh &mesh2, + std::vector metrics = {Metric::ChamferDistance}, + MetricParameters params = MetricParameters()) const; + protected: core::Device device_ = core::Device("CPU:0"); TensorMap vertex_attr_; diff --git a/cpp/open3d/t/geometry/TriangleMeshFactory.cpp b/cpp/open3d/t/geometry/TriangleMeshFactory.cpp index fb04d856c7c..2873585bdbe 100644 --- a/cpp/open3d/t/geometry/TriangleMeshFactory.cpp +++ b/cpp/open3d/t/geometry/TriangleMeshFactory.cpp @@ -1,10 +1,11 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- +#include #include #include #include @@ -285,6 +286,28 @@ TriangleMesh TriangleMesh::CreateText(const std::string &text, return tmesh; } +TriangleMesh TriangleMesh::CreateIsosurfaces( + const core::Tensor &volume, + const std::vector contour_values, + const core::Device &device) { + using namespace vtkutils; + core::AssertTensorShape(volume, {core::None, core::None, core::None}); + core::AssertTensorDtypes(volume, {core::Float32, core::Float64}); + + auto image_data = vtkutils::CreateVtkImageDataFromTensor( + const_cast(volume)); + vtkNew method; + method->SetNumberOfContours(contour_values.size()); + for (int i = 0; i < int(contour_values.size()); ++i) { + method->SetValue(i, contour_values[i]); + } + method->SetInputData(image_data); + method->Update(); + auto polydata = method->GetOutput(); + auto tmesh = CreateTriangleMeshFromVtkPolyData(polydata); + return tmesh.To(device); +} + } // namespace geometry } // namespace t } // namespace open3d diff --git a/cpp/open3d/t/geometry/Utility.h b/cpp/open3d/t/geometry/Utility.h index a8a73ae2895..c96521953ae 100644 --- a/cpp/open3d/t/geometry/Utility.h +++ b/cpp/open3d/t/geometry/Utility.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/VoxelBlockGrid.cpp b/cpp/open3d/t/geometry/VoxelBlockGrid.cpp index b98c09b95f2..063e271658e 100644 --- a/cpp/open3d/t/geometry/VoxelBlockGrid.cpp +++ b/cpp/open3d/t/geometry/VoxelBlockGrid.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/VoxelBlockGrid.h b/cpp/open3d/t/geometry/VoxelBlockGrid.h index a6922585faa..32f7e451946 100644 --- a/cpp/open3d/t/geometry/VoxelBlockGrid.h +++ b/cpp/open3d/t/geometry/VoxelBlockGrid.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/VtkUtils.cpp b/cpp/open3d/t/geometry/VtkUtils.cpp index e6b7245d833..d69d4a21b2c 100644 --- a/cpp/open3d/t/geometry/VtkUtils.cpp +++ b/cpp/open3d/t/geometry/VtkUtils.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -182,6 +183,34 @@ static vtkSmartPointer CreateVtkPointsFromTensor( return pts; } +OPEN3D_LOCAL vtkSmartPointer CreateVtkImageDataFromTensor( + core::Tensor& tensor, bool copy) { + core::AssertTensorDtypes(tensor, + {core::UInt8, core::Float32, core::Float64}); + if (tensor.NumDims() != 2 && tensor.NumDims() != 3) { + utility::LogError( + "Cannot convert Tensor to vtkImageData. The number of " + "dimensions must be 2 or 3 but is {}", + tensor.NumDims()); + } + + // Create a flat tensor that can be converted to a vtkDataArray + auto tensor_flat = tensor.Reshape({tensor.NumElements(), 1}); + if (tensor.GetDataPtr() != tensor_flat.GetDataPtr()) { + copy = true; + } + auto data_array = CreateVtkDataArrayFromTensor(tensor_flat, copy); + + vtkSmartPointer im = vtkSmartPointer::New(); + im->GetPointData()->SetScalars(data_array); + std::array size{1, 1, 1}; + for (int i = 0; i < tensor.NumDims(); ++i) { + size[i] = tensor.GetShape(tensor.NumDims() - i - 1); + } + im->SetDimensions(size.data()); + return im; +} + namespace { // Helper for creating the offset array from Common/DataModel/vtkCellArray.cxx struct GenerateOffsetsImpl { @@ -213,7 +242,9 @@ static vtkSmartPointer CreateVtkCellArrayFromTensor( const int cell_size = tensor.GetShape()[1]; auto tensor_flat = tensor.Reshape({tensor.NumElements(), 1}).Contiguous(); - copy = copy && tensor.GetDataPtr() == tensor_flat.GetDataPtr(); + if (tensor.GetDataPtr() != tensor_flat.GetDataPtr()) { + copy = true; + } auto connectivity = CreateVtkDataArrayFromTensor(tensor_flat, copy); // vtk nightly build (9.1.20220520) has a function cells->SetData(cell_size, diff --git a/cpp/open3d/t/geometry/VtkUtils.h b/cpp/open3d/t/geometry/VtkUtils.h index 85aeabe6770..0bd11255aa5 100644 --- a/cpp/open3d/t/geometry/VtkUtils.h +++ b/cpp/open3d/t/geometry/VtkUtils.h @@ -1,10 +1,11 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- +#include #include #include @@ -22,6 +23,14 @@ namespace vtkutils { /// Logs an error if no conversion exists. int DtypeToVtkType(const core::Dtype& dtype); +/// Creates a vtkImageData object from a Tensor. +/// The returned object may directly use the memory of the tensor and the tensor +/// must be kept alive until the returned vtkImageData is deleted. +/// \param tensor The source tensor. +/// \param copy If true always create a copy of the data. +vtkSmartPointer CreateVtkImageDataFromTensor(core::Tensor& tensor, + bool copy = false); + /// Creates a vtkPolyData object from a point cloud or triangle mesh. /// The returned vtkPolyData object may directly use the memory of the tensors /// stored inside the Geometry object. Therefore, the Geometry object must be diff --git a/cpp/open3d/t/geometry/kernel/CMakeLists.txt b/cpp/open3d/t/geometry/kernel/CMakeLists.txt index 582d5136c04..0b711053dbf 100644 --- a/cpp/open3d/t/geometry/kernel/CMakeLists.txt +++ b/cpp/open3d/t/geometry/kernel/CMakeLists.txt @@ -1,33 +1,22 @@ open3d_ispc_add_library(tgeometry_kernel OBJECT) +target_sources(tgeometry_kernel PRIVATE + Image.cpp + ImageCPU.cpp + PCAPartition.cpp + PointCloud.cpp + PointCloudCPU.cpp + Metrics.cpp + TriangleMesh.cpp + TriangleMeshCPU.cpp + Transform.cpp + TransformCPU.cpp + VoxelBlockGrid.cpp + VoxelBlockGridCPU.cpp +) if (WITH_UV_ATLAS) target_sources(tgeometry_kernel PRIVATE - Image.cpp - ImageCPU.cpp - PCAPartition.cpp - PointCloud.cpp - PointCloudCPU.cpp - TriangleMesh.cpp - TriangleMeshCPU.cpp - Transform.cpp - TransformCPU.cpp - UVUnwrapping.cpp - VoxelBlockGrid.cpp - VoxelBlockGridCPU.cpp - ) -else() - target_sources(tgeometry_kernel PRIVATE - Image.cpp - ImageCPU.cpp - PCAPartition.cpp - PointCloud.cpp - PointCloudCPU.cpp - TriangleMesh.cpp - TriangleMeshCPU.cpp - Transform.cpp - TransformCPU.cpp - VoxelBlockGrid.cpp - VoxelBlockGridCPU.cpp + UVUnwrapping.cpp ) endif() @@ -42,7 +31,7 @@ if (BUILD_CUDA_MODULE) ) endif() -if (WITH_IPPICV) +if (WITH_IPP) target_sources(tgeometry_kernel PRIVATE IPPImage.cpp ) diff --git a/cpp/open3d/t/geometry/kernel/GeometryIndexer.h b/cpp/open3d/t/geometry/kernel/GeometryIndexer.h index 2c0391b1a9f..60e047197d1 100644 --- a/cpp/open3d/t/geometry/kernel/GeometryIndexer.h +++ b/cpp/open3d/t/geometry/kernel/GeometryIndexer.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/kernel/GeometryMacros.h b/cpp/open3d/t/geometry/kernel/GeometryMacros.h index 4421543ae92..bb5eab80416 100644 --- a/cpp/open3d/t/geometry/kernel/GeometryMacros.h +++ b/cpp/open3d/t/geometry/kernel/GeometryMacros.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/kernel/IPPImage.cpp b/cpp/open3d/t/geometry/kernel/IPPImage.cpp index 275d15b560b..ba32d1af317 100644 --- a/cpp/open3d/t/geometry/kernel/IPPImage.cpp +++ b/cpp/open3d/t/geometry/kernel/IPPImage.cpp @@ -1,16 +1,23 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- #include "open3d/t/geometry/kernel/IPPImage.h" +#ifdef APPLE // macOS IPP <=v2021.9 uses old directory layout #include #include #include #include +#else // Linux and Windows IPP >=v2021.10 uses new directory layout +#include +#include +#include +#include +#endif #include "open3d/core/Dtype.h" #include "open3d/core/ParallelFor.h" @@ -48,7 +55,7 @@ void To(const core::Tensor &src_im, try { ::ipp::iwiScale(ipp_src_im, ipp_dst_im, scale, offset); } catch (const ::ipp::IwException &e) { - // See comments in icv/include/ippicv_types.h for m_status meaning + // See comments in ipp/ipptypes.h for m_status meaning utility::LogError("IPP-IW error {}: {}", e.m_status, e.m_string); } } @@ -71,7 +78,7 @@ void RGBToGray(const core::Tensor &src_im, core::Tensor &dst_im) { ::ipp::iwiColorConvert(ipp_src_im, ::ipp::iwiColorRGB, ipp_dst_im, ::ipp::iwiColorGray); } catch (const ::ipp::IwException &e) { - // See comments in icv/include/ippicv_types.h for m_status meaning + // See comments in ipp/ipptypes.h for m_status meaning utility::LogError("IPP-IW error {}: {}", e.m_status, e.m_string); } } @@ -111,7 +118,7 @@ void Resize(const open3d::core::Tensor &src_im, try { ::ipp::iwiResize(ipp_src_im, ipp_dst_im, it->second); } catch (const ::ipp::IwException &e) { - // See comments in icv/include/ippicv_types.h for m_status meaning + // See comments in ipp/ipptypes.h for m_status meaning utility::LogError("IPP-IW error {}: {}", e.m_status, e.m_string); } } @@ -148,7 +155,7 @@ void Dilate(const core::Tensor &src_im, core::Tensor &dst_im, int kernel_size) { ::ipp::IwDefault(), /* Do not use IwiFilterMorphologyParams() */ ippBorderRepl); } catch (const ::ipp::IwException &e) { - // See comments in icv/include/ippicv_types.h for m_status meaning + // See comments in ipp/ipptypes.h for m_status meaning utility::LogError("IPP-IW error {}: {}", e.m_status, e.m_string); } } @@ -180,7 +187,7 @@ void Filter(const open3d::core::Tensor &src_im, try { ::ipp::iwiFilter(ipp_src_im, ipp_dst_im, ipp_kernel); } catch (const ::ipp::IwException &e) { - // See comments in icv/include/ippicv_types.h for m_status meaning + // See comments in ipp/ipptypes.h for m_status meaning utility::LogError("IPP-IW error {}: {}", e.m_status, e.m_string); } }; @@ -211,7 +218,7 @@ void FilterBilateral(const core::Tensor &src_im, value_sigma * value_sigma, distance_sigma * distance_sigma); } catch (const ::ipp::IwException &e) { - // See comments in icv/include/ippicv_types.h for m_status meaning + // See comments in ipp/ipptypes.h for m_status meaning utility::LogError("IPP-IW error {}: {}", e.m_status, e.m_string); } } @@ -239,7 +246,7 @@ void FilterGaussian(const core::Tensor &src_im, try { ::ipp::iwiFilterGaussian(ipp_src_im, ipp_dst_im, kernel_size, sigma); } catch (const ::ipp::IwException &e) { - // See comments in icv/include/ippicv_types.h for m_status meaning + // See comments in ipp/ipptypes.h for m_status meaning utility::LogError("IPP-IW error {}: {}", e.m_status, e.m_string); } } @@ -287,7 +294,7 @@ void FilterSobel(const core::Tensor &src_im, // so we need to negate it in-place. dst_im_dx.Neg_(); } catch (const ::ipp::IwException &e) { - // See comments in icv/include/ippicv_types.h for m_status meaning + // See comments in ipp/ipptypes.h for m_status meaning utility::LogError("IPP-IW error {}: {}", e.m_status, e.m_string); } } diff --git a/cpp/open3d/t/geometry/kernel/IPPImage.h b/cpp/open3d/t/geometry/kernel/IPPImage.h index b861dd4d920..0903acffa14 100644 --- a/cpp/open3d/t/geometry/kernel/IPPImage.h +++ b/cpp/open3d/t/geometry/kernel/IPPImage.h @@ -1,18 +1,22 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- #pragma once -#ifdef WITH_IPPICV +#ifdef WITH_IPP +// Auto-enable multi-threaded implementations +#define IPP_ENABLED_THREADING_LAYER_REDEFINITIONS 1 #define IPP_CALL(ipp_function, ...) ipp_function(__VA_ARGS__); -// Required by IPPICV headers, defined here to keep other compile commands clean -#define ICV_BASE -#define IW_BUILD +#if IPP_VERSION_INT < \ + 20211000 // macOS IPP v2021.9.11 uses old directory layout #include +#else // Linux and Windows IPP v2021.10+ uses new directory layout +#include +#endif #include "open3d/core/Dtype.h" #include "open3d/core/Tensor.h" @@ -85,4 +89,4 @@ void FilterSobel(const open3d::core::Tensor &srcim, #else #define IPP_CALL(ipp_function, ...) \ utility::LogError("Not built with IPP-IW, cannot call " #ipp_function); -#endif // WITH_IPPICV +#endif // WITH_IPP diff --git a/cpp/open3d/t/geometry/kernel/Image.cpp b/cpp/open3d/t/geometry/kernel/Image.cpp index 9523e809b46..670d80de9ac 100644 --- a/cpp/open3d/t/geometry/kernel/Image.cpp +++ b/cpp/open3d/t/geometry/kernel/Image.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/kernel/Image.h b/cpp/open3d/t/geometry/kernel/Image.h index 71ef2ba7602..f2d1cbafd17 100644 --- a/cpp/open3d/t/geometry/kernel/Image.h +++ b/cpp/open3d/t/geometry/kernel/Image.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/kernel/ImageCPU.cpp b/cpp/open3d/t/geometry/kernel/ImageCPU.cpp index ac8f808acbc..d61cdfe7780 100644 --- a/cpp/open3d/t/geometry/kernel/ImageCPU.cpp +++ b/cpp/open3d/t/geometry/kernel/ImageCPU.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/kernel/ImageCUDA.cu b/cpp/open3d/t/geometry/kernel/ImageCUDA.cu index ac8f808acbc..d61cdfe7780 100644 --- a/cpp/open3d/t/geometry/kernel/ImageCUDA.cu +++ b/cpp/open3d/t/geometry/kernel/ImageCUDA.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/kernel/ImageImpl.h b/cpp/open3d/t/geometry/kernel/ImageImpl.h index e194e69c199..fbe2bcd1dca 100644 --- a/cpp/open3d/t/geometry/kernel/ImageImpl.h +++ b/cpp/open3d/t/geometry/kernel/ImageImpl.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/kernel/Metrics.cpp b/cpp/open3d/t/geometry/kernel/Metrics.cpp new file mode 100644 index 00000000000..7926d71738c --- /dev/null +++ b/cpp/open3d/t/geometry/kernel/Metrics.cpp @@ -0,0 +1,70 @@ +// ---------------------------------------------------------------------------- +// - Open3D: www.open3d.org - +// ---------------------------------------------------------------------------- +// Copyright (c) 2018-2024 www.open3d.org +// SPDX-License-Identifier: MIT +// ---------------------------------------------------------------------------- + +#include + +#include "open3d/core/Tensor.h" +#include "open3d/t/geometry/Geometry.h" +namespace open3d { +namespace t { +namespace geometry { + +core::Tensor ComputeMetricsCommon(core::Tensor distance12, + core::Tensor distance21, + std::vector metrics, + MetricParameters params) { + int n_metrics = metrics.size(); + if (std::find(metrics.begin(), metrics.end(), Metric::FScore) != + metrics.end()) { + n_metrics += params.fscore_radius.size() - 1; + } + core::Tensor metric_values({n_metrics}, core::Float32, + distance12.GetDevice()); + float metric_val; + + int idx = 0; + for (Metric metric : metrics) { + switch (metric) { + case Metric::ChamferDistance: + metric_val = distance21.Reshape({-1}).Mean({-1}).Item() + + distance12.Reshape({-1}).Mean({-1}).Item(); + metric_values[idx++] = metric_val; + break; + case Metric::HausdorffDistance: + metric_val = std::max( + distance12.Reshape({-1}).Max({-1}).Item(), + distance21.Reshape({-1}).Max({-1}).Item()); + metric_values[idx++] = metric_val; + break; + case Metric::FScore: + float *p_distance12 = distance12.GetDataPtr(), + *p_distance21 = distance21.GetDataPtr(); + for (float radius : params.fscore_radius) { + // Workaround since we don't have Tensor::CountNonZeros + float precision = 0., recall = 0.; + for (size_t i = 0; + i < static_cast(distance12.NumElements()); ++i) + precision += p_distance12[i] < radius; + precision *= 100. / distance12.NumElements(); + for (size_t i = 0; + i < static_cast(distance21.NumElements()); ++i) + recall += p_distance21[i] < radius; + recall *= 100. / distance21.NumElements(); + float fscore = 0.0; + if (precision + recall > 0) { + fscore = 2 * precision * recall / (precision + recall); + } + metric_values[idx++] = fscore; + } + break; + } + } + return metric_values; +} +} // namespace geometry +} // namespace t +} // namespace open3d diff --git a/cpp/open3d/t/geometry/kernel/Metrics.h b/cpp/open3d/t/geometry/kernel/Metrics.h new file mode 100644 index 00000000000..e64a7883ff5 --- /dev/null +++ b/cpp/open3d/t/geometry/kernel/Metrics.h @@ -0,0 +1,25 @@ +// ---------------------------------------------------------------------------- +// - Open3D: www.open3d.org - +// ---------------------------------------------------------------------------- +// Copyright (c) 2018-2024 www.open3d.org +// SPDX-License-Identifier: MIT +// ---------------------------------------------------------------------------- + +#include + +#include "open3d/core/Tensor.h" +#include "open3d/t/geometry/Geometry.h" +namespace open3d { +namespace t { +namespace geometry { + +/// Common code for computing geometry metrics from pairwise point distances. +/// This function expects Euclidean distances as input and returns the requested +/// metrics between point clouds / meshes. +core::Tensor ComputeMetricsCommon(core::Tensor distance12, + core::Tensor distance21, + std::vector metrics, + MetricParameters params); +} // namespace geometry +} // namespace t +} // namespace open3d diff --git a/cpp/open3d/t/geometry/kernel/NPPImage.cpp b/cpp/open3d/t/geometry/kernel/NPPImage.cpp index e0ff8d67e6b..eb47ec9ba30 100644 --- a/cpp/open3d/t/geometry/kernel/NPPImage.cpp +++ b/cpp/open3d/t/geometry/kernel/NPPImage.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/kernel/NPPImage.h b/cpp/open3d/t/geometry/kernel/NPPImage.h index f0966f07f74..4db7ea19936 100644 --- a/cpp/open3d/t/geometry/kernel/NPPImage.h +++ b/cpp/open3d/t/geometry/kernel/NPPImage.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- #pragma once diff --git a/cpp/open3d/t/geometry/kernel/PCAPartition.cpp b/cpp/open3d/t/geometry/kernel/PCAPartition.cpp index e1cfedc11da..4f937ab065b 100644 --- a/cpp/open3d/t/geometry/kernel/PCAPartition.cpp +++ b/cpp/open3d/t/geometry/kernel/PCAPartition.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/kernel/PCAPartition.h b/cpp/open3d/t/geometry/kernel/PCAPartition.h index 4127fa64200..618eaefd09c 100644 --- a/cpp/open3d/t/geometry/kernel/PCAPartition.h +++ b/cpp/open3d/t/geometry/kernel/PCAPartition.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/kernel/PointCloud.cpp b/cpp/open3d/t/geometry/kernel/PointCloud.cpp index cac496344e2..329c703e50c 100644 --- a/cpp/open3d/t/geometry/kernel/PointCloud.cpp +++ b/cpp/open3d/t/geometry/kernel/PointCloud.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/kernel/PointCloud.h b/cpp/open3d/t/geometry/kernel/PointCloud.h index c66e6501035..104e6ff6bb7 100644 --- a/cpp/open3d/t/geometry/kernel/PointCloud.h +++ b/cpp/open3d/t/geometry/kernel/PointCloud.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/kernel/PointCloudCPU.cpp b/cpp/open3d/t/geometry/kernel/PointCloudCPU.cpp index 2fdc949fda3..50acad94e20 100644 --- a/cpp/open3d/t/geometry/kernel/PointCloudCPU.cpp +++ b/cpp/open3d/t/geometry/kernel/PointCloudCPU.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/kernel/PointCloudCUDA.cu b/cpp/open3d/t/geometry/kernel/PointCloudCUDA.cu index 39090a2cd2d..82bce224fca 100644 --- a/cpp/open3d/t/geometry/kernel/PointCloudCUDA.cu +++ b/cpp/open3d/t/geometry/kernel/PointCloudCUDA.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/kernel/PointCloudImpl.h b/cpp/open3d/t/geometry/kernel/PointCloudImpl.h index 14a19c25c79..a6efbc0f9a5 100644 --- a/cpp/open3d/t/geometry/kernel/PointCloudImpl.h +++ b/cpp/open3d/t/geometry/kernel/PointCloudImpl.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -956,8 +956,8 @@ OPEN3D_HOST_DEVICE void EstimatePointWiseNormalsWithFastEigen3x3( normals_ptr[1] = 0.0; normals_ptr[2] = 0.0; return; - } else if (covariance_ptr[0] < covariance_ptr[4] && - covariance_ptr[0] < covariance_ptr[8]) { + } else if (covariance_ptr[4] < covariance_ptr[0] && + covariance_ptr[4] < covariance_ptr[8]) { normals_ptr[0] = 0.0; normals_ptr[1] = 1.0; normals_ptr[2] = 0.0; diff --git a/cpp/open3d/t/geometry/kernel/Transform.cpp b/cpp/open3d/t/geometry/kernel/Transform.cpp index d6b8cdcfd35..96a1078edb0 100644 --- a/cpp/open3d/t/geometry/kernel/Transform.cpp +++ b/cpp/open3d/t/geometry/kernel/Transform.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/kernel/Transform.h b/cpp/open3d/t/geometry/kernel/Transform.h index 1cd7b13cc05..d64d860572e 100644 --- a/cpp/open3d/t/geometry/kernel/Transform.h +++ b/cpp/open3d/t/geometry/kernel/Transform.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/kernel/TransformCPU.cpp b/cpp/open3d/t/geometry/kernel/TransformCPU.cpp index 272ecb99025..4252b9d20d1 100644 --- a/cpp/open3d/t/geometry/kernel/TransformCPU.cpp +++ b/cpp/open3d/t/geometry/kernel/TransformCPU.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/kernel/TransformCUDA.cu b/cpp/open3d/t/geometry/kernel/TransformCUDA.cu index 272ecb99025..4252b9d20d1 100644 --- a/cpp/open3d/t/geometry/kernel/TransformCUDA.cu +++ b/cpp/open3d/t/geometry/kernel/TransformCUDA.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/kernel/TransformImpl.h b/cpp/open3d/t/geometry/kernel/TransformImpl.h index 9e70bff5329..14c08a01e52 100644 --- a/cpp/open3d/t/geometry/kernel/TransformImpl.h +++ b/cpp/open3d/t/geometry/kernel/TransformImpl.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/kernel/TriangleMesh.cpp b/cpp/open3d/t/geometry/kernel/TriangleMesh.cpp index a2bd1e49f26..0d0d4b17263 100644 --- a/cpp/open3d/t/geometry/kernel/TriangleMesh.cpp +++ b/cpp/open3d/t/geometry/kernel/TriangleMesh.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/kernel/TriangleMesh.h b/cpp/open3d/t/geometry/kernel/TriangleMesh.h index f5aca664fa5..9d939141121 100644 --- a/cpp/open3d/t/geometry/kernel/TriangleMesh.h +++ b/cpp/open3d/t/geometry/kernel/TriangleMesh.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -29,6 +29,17 @@ void ComputeTriangleAreasCPU(const core::Tensor& vertices, const core::Tensor& triangles, core::Tensor& triangle_areas); +std::array SamplePointsUniformlyCPU( + const core::Tensor& triangles, + const core::Tensor& vertices, + const core::Tensor& triangle_areas, + const core::Tensor& vertex_normals, + const core::Tensor& vertex_colors, + const core::Tensor& triangle_normals, + const core::Tensor& texture_uvs, + const core::Tensor& albedo, + size_t number_of_points); + #ifdef BUILD_CUDA_MODULE void NormalizeNormalsCUDA(core::Tensor& normals); diff --git a/cpp/open3d/t/geometry/kernel/TriangleMeshCPU.cpp b/cpp/open3d/t/geometry/kernel/TriangleMeshCPU.cpp index 24a68a691f8..e91cf6a8962 100644 --- a/cpp/open3d/t/geometry/kernel/TriangleMeshCPU.cpp +++ b/cpp/open3d/t/geometry/kernel/TriangleMeshCPU.cpp @@ -1,11 +1,17 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- +#include + +#include "open3d/core/Dtype.h" +#include "open3d/t/geometry/TriangleMesh.h" #include "open3d/t/geometry/kernel/TriangleMeshImpl.h" +#include "open3d/utility/Parallel.h" +#include "open3d/utility/Random.h" namespace open3d { namespace t { @@ -49,6 +55,135 @@ void ComputeVertexNormalsCPU(const core::Tensor& triangles, }); } +template +void mix_3x3(T* out, const T* a, const T* b, const T* c, float wts[3]) { + out[0] = wts[0] * a[0] + wts[1] * b[0] + wts[2] * c[0]; + out[1] = wts[0] * a[1] + wts[1] * b[1] + wts[2] * c[1]; + out[2] = wts[0] * a[2] + wts[1] * b[2] + wts[2] * c[2]; +} +template void mix_3x3(float* out, + const float* a, + const float* b, + const float* c, + float wts[3]); + +/// All input tensors must be on CPU, contiguous and the correct shape. +/// normals are computed if either vertex_normals and triangle_normals +/// are not empty (used in that order). +/// colors (Float32) are computed if either albedo and texture_uvs or +/// vertex_colors are not empty (used in that order). +std::array SamplePointsUniformlyCPU( + const core::Tensor& triangles, + const core::Tensor& vertices, + const core::Tensor& triangle_areas, + const core::Tensor& vertex_normals, + const core::Tensor& vertex_colors, + const core::Tensor& triangle_normals, + const core::Tensor& texture_uvs, + const core::Tensor& albedo, + size_t number_of_points) { + utility::random::UniformRealGenerator uniform_generator(0.0, 1.0); + core::Tensor points = core::Tensor::Empty( + {static_cast(number_of_points), 3}, vertices.GetDtype()); + core::Tensor normals, colors; + bool use_vert_normal = vertex_normals.NumElements() > 0, + use_triangle_normal = triangle_normals.NumElements() > 0, + use_vert_colors = vertex_colors.NumElements() > 0, + use_albedo = albedo.NumElements() > 0 && texture_uvs.NumElements() > 0; + if (use_vert_normal || use_triangle_normal) { + normals = core::Tensor::Empty( + {static_cast(number_of_points), 3}, points.GetDtype()); + } + if (use_albedo || use_vert_colors) { + colors = core::Tensor::Empty( + {static_cast(number_of_points), 3}, core::Float32); + } + const size_t tex_width = use_albedo ? albedo.GetShape(1) : 0, + tex_height = use_albedo ? albedo.GetShape(0) : 0; + DISPATCH_FLOAT_INT_DTYPE_TO_TEMPLATE( + vertices.GetDtype(), triangles.GetDtype(), [&]() { + const int_t* p_triangles = triangles.GetDataPtr(); + const scalar_t* p_vertices = vertices.GetDataPtr(); + const scalar_t* p_vert_normals = + use_vert_normal ? vertex_normals.GetDataPtr() + : nullptr; + const float* p_vert_colors = + use_vert_colors ? vertex_colors.GetDataPtr() + : nullptr; + const scalar_t* p_tri_normals = + use_triangle_normal + ? triangle_normals.GetDataPtr() + : nullptr; + const scalar_t* p_tri_uvs = + use_albedo ? texture_uvs.GetDataPtr() + : nullptr; + const float* p_albedo = + use_albedo ? albedo.GetDataPtr() : nullptr; + + scalar_t* p_points = points.GetDataPtr(); + scalar_t* p_normals = (use_vert_normal || use_triangle_normal) + ? normals.GetDataPtr() + : nullptr; + float* p_colors = (use_albedo || use_vert_colors) + ? colors.GetDataPtr() + : nullptr; + + utility::random::DiscreteGenerator + triangle_index_generator( + triangle_areas.GetDataPtr(), + triangle_areas.GetDataPtr() + + triangles.GetLength()); + // TODO(SS): Parallelize this. + for (size_t point_idx = 0; point_idx < number_of_points; + ++point_idx, p_points += 3) { + float r1 = uniform_generator(); + float r2 = uniform_generator(); + float wts[3] = {1 - std::sqrt(r1), std::sqrt(r1) * (1 - r2), + std::sqrt(r1) * r2}; + size_t tidx = triangle_index_generator(); + int_t vert_idx[3] = {p_triangles[3 * tidx + 0], + p_triangles[3 * tidx + 1], + p_triangles[3 * tidx + 2]}; + + mix_3x3(p_points, p_vertices + 3 * vert_idx[0], + p_vertices + 3 * vert_idx[1], + p_vertices + 3 * vert_idx[2], wts); + + if (use_vert_normal) { + mix_3x3(p_normals, p_vert_normals + 3 * vert_idx[0], + p_vert_normals + 3 * vert_idx[1], + p_vert_normals + 3 * vert_idx[2], wts); + p_normals += 3; + } else if (use_triangle_normal) { + std::copy(p_tri_normals + 3 * tidx, + p_tri_normals + 3 * (tidx + 1), p_normals); + p_normals += 3; + } + // if there is a texture, sample from texture nearest nbr + // pixel instead + if (use_albedo) { + float u = wts[0] * p_tri_uvs[6 * tidx] + + wts[1] * p_tri_uvs[6 * tidx + 2] + + wts[2] * p_tri_uvs[6 * tidx + 4]; + float v = wts[0] * p_tri_uvs[6 * tidx + 1] + + wts[1] * p_tri_uvs[6 * tidx + 3] + + wts[2] * p_tri_uvs[6 * tidx + 5]; + size_t x = u * tex_width, y = v * tex_height; + std::copy(p_albedo + 3 * (y * tex_width + x), + p_albedo + 3 * (y * tex_width + x + 1), + p_colors); + p_colors += 3; + } // if there is no texture, sample from vertex color + else if (use_vert_colors) { + mix_3x3(p_colors, p_vert_colors + 3 * vert_idx[0], + p_vert_colors + 3 * vert_idx[1], + p_vert_colors + 3 * vert_idx[2], wts); + p_colors += 3; + } + } + }); + return {points, normals, colors}; +} } // namespace trianglemesh } // namespace kernel } // namespace geometry diff --git a/cpp/open3d/t/geometry/kernel/TriangleMeshCUDA.cu b/cpp/open3d/t/geometry/kernel/TriangleMeshCUDA.cu index d4bcd245d56..455e4e6e6eb 100644 --- a/cpp/open3d/t/geometry/kernel/TriangleMeshCUDA.cu +++ b/cpp/open3d/t/geometry/kernel/TriangleMeshCUDA.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/kernel/TriangleMeshImpl.h b/cpp/open3d/t/geometry/kernel/TriangleMeshImpl.h index 5b675344fa6..bbc032121f8 100644 --- a/cpp/open3d/t/geometry/kernel/TriangleMeshImpl.h +++ b/cpp/open3d/t/geometry/kernel/TriangleMeshImpl.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/kernel/UVUnwrapping.cpp b/cpp/open3d/t/geometry/kernel/UVUnwrapping.cpp index 866e620d6bf..3cac1466654 100644 --- a/cpp/open3d/t/geometry/kernel/UVUnwrapping.cpp +++ b/cpp/open3d/t/geometry/kernel/UVUnwrapping.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/kernel/UVUnwrapping.h b/cpp/open3d/t/geometry/kernel/UVUnwrapping.h index e2262b15dc3..d0c16dc6730 100644 --- a/cpp/open3d/t/geometry/kernel/UVUnwrapping.h +++ b/cpp/open3d/t/geometry/kernel/UVUnwrapping.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/kernel/VoxelBlockGrid.cpp b/cpp/open3d/t/geometry/kernel/VoxelBlockGrid.cpp index 7a430459fbe..03064043c81 100644 --- a/cpp/open3d/t/geometry/kernel/VoxelBlockGrid.cpp +++ b/cpp/open3d/t/geometry/kernel/VoxelBlockGrid.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/kernel/VoxelBlockGrid.h b/cpp/open3d/t/geometry/kernel/VoxelBlockGrid.h index bb186a9aefe..43fb19df2e2 100644 --- a/cpp/open3d/t/geometry/kernel/VoxelBlockGrid.h +++ b/cpp/open3d/t/geometry/kernel/VoxelBlockGrid.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/kernel/VoxelBlockGridCPU.cpp b/cpp/open3d/t/geometry/kernel/VoxelBlockGridCPU.cpp index 45549c82714..018fd4b40d2 100644 --- a/cpp/open3d/t/geometry/kernel/VoxelBlockGridCPU.cpp +++ b/cpp/open3d/t/geometry/kernel/VoxelBlockGridCPU.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/kernel/VoxelBlockGridCUDA.cu b/cpp/open3d/t/geometry/kernel/VoxelBlockGridCUDA.cu index 2d053c10248..fd44cc8d3d0 100644 --- a/cpp/open3d/t/geometry/kernel/VoxelBlockGridCUDA.cu +++ b/cpp/open3d/t/geometry/kernel/VoxelBlockGridCUDA.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/geometry/kernel/VoxelBlockGridImpl.h b/cpp/open3d/t/geometry/kernel/VoxelBlockGridImpl.h index dd0fb9dc148..01bd9060b9e 100644 --- a/cpp/open3d/t/geometry/kernel/VoxelBlockGridImpl.h +++ b/cpp/open3d/t/geometry/kernel/VoxelBlockGridImpl.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/io/HashMapIO.cpp b/cpp/open3d/t/io/HashMapIO.cpp index 309cf3f3eb9..841b3cfecd8 100644 --- a/cpp/open3d/t/io/HashMapIO.cpp +++ b/cpp/open3d/t/io/HashMapIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/io/HashMapIO.h b/cpp/open3d/t/io/HashMapIO.h index 099ac44c23b..f685a905881 100644 --- a/cpp/open3d/t/io/HashMapIO.h +++ b/cpp/open3d/t/io/HashMapIO.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/io/ImageIO.cpp b/cpp/open3d/t/io/ImageIO.cpp index d172ad16cb7..97941c517ef 100644 --- a/cpp/open3d/t/io/ImageIO.cpp +++ b/cpp/open3d/t/io/ImageIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/io/ImageIO.h b/cpp/open3d/t/io/ImageIO.h index 6a7edd6e17b..44a1a9d6a66 100644 --- a/cpp/open3d/t/io/ImageIO.h +++ b/cpp/open3d/t/io/ImageIO.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/io/NumpyIO.cpp b/cpp/open3d/t/io/NumpyIO.cpp index c2986e8a482..f793f8feab6 100644 --- a/cpp/open3d/t/io/NumpyIO.cpp +++ b/cpp/open3d/t/io/NumpyIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/io/NumpyIO.h b/cpp/open3d/t/io/NumpyIO.h index 0870f73e310..4e4c518bbd4 100644 --- a/cpp/open3d/t/io/NumpyIO.h +++ b/cpp/open3d/t/io/NumpyIO.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/io/PointCloudIO.cpp b/cpp/open3d/t/io/PointCloudIO.cpp index fa66d0e2869..dbdd9b44391 100644 --- a/cpp/open3d/t/io/PointCloudIO.cpp +++ b/cpp/open3d/t/io/PointCloudIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/io/PointCloudIO.h b/cpp/open3d/t/io/PointCloudIO.h index de02b29053b..44dbd0f2ea3 100644 --- a/cpp/open3d/t/io/PointCloudIO.h +++ b/cpp/open3d/t/io/PointCloudIO.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/io/TriangleMeshIO.cpp b/cpp/open3d/t/io/TriangleMeshIO.cpp index 3f511eb984e..6f4974365a5 100644 --- a/cpp/open3d/t/io/TriangleMeshIO.cpp +++ b/cpp/open3d/t/io/TriangleMeshIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/io/TriangleMeshIO.h b/cpp/open3d/t/io/TriangleMeshIO.h index a4d975d471a..259259888d3 100644 --- a/cpp/open3d/t/io/TriangleMeshIO.h +++ b/cpp/open3d/t/io/TriangleMeshIO.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/io/file_format/FileASSIMP.cpp b/cpp/open3d/t/io/file_format/FileASSIMP.cpp index 514d59fca1b..dd86fbfb264 100644 --- a/cpp/open3d/t/io/file_format/FileASSIMP.cpp +++ b/cpp/open3d/t/io/file_format/FileASSIMP.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -35,14 +35,16 @@ namespace t { namespace io { // Split all polygons with more than 3 edges into triangles. +// Ref: +// https://github.com/assimp/assimp/blob/master/include/assimp/postprocess.h const unsigned int kPostProcessFlags_compulsory = aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | - aiProcess_SortByPType; + aiProcess_SortByPType | aiProcess_PreTransformVertices; const unsigned int kPostProcessFlags_fast = - aiProcessPreset_TargetRealtime_Fast | - aiProcess_RemoveRedundantMaterials | aiProcess_OptimizeMeshes | - aiProcess_PreTransformVertices; + kPostProcessFlags_compulsory | aiProcess_GenNormals | + aiProcess_GenUVCoords | aiProcess_RemoveRedundantMaterials | + aiProcess_OptimizeMeshes; bool ReadTriangleMeshUsingASSIMP( const std::string& filename, @@ -58,7 +60,8 @@ bool ReadTriangleMeshUsingASSIMP( const auto* scene = importer.ReadFile(filename.c_str(), post_process_flags); if (!scene) { - utility::LogWarning("Unable to load file {} with ASSIMP", filename); + utility::LogWarning("Unable to load file {} with ASSIMP: {}", filename, + importer.GetErrorString()); return false; } @@ -219,7 +222,7 @@ bool WriteTriangleMeshUsingASSIMP(const std::string& filename, // Sanity checks... if (write_ascii) { utility::LogWarning( - "TriangleMesh can't be saved in ASCII fromat as .glb"); + "TriangleMesh can't be saved in ASCII format as .glb"); return false; } if (compressed) { @@ -242,7 +245,7 @@ bool WriteTriangleMeshUsingASSIMP(const std::string& filename, if (mesh.HasTriangleColors()) { utility::LogWarning( "Exporting triangle colors is not supported. Please convert to " - "vertex colors or export to a format that supporst it."); + "vertex colors or export to a format that supports it."); } Assimp::Exporter exporter; @@ -470,7 +473,9 @@ bool WriteTriangleMeshUsingASSIMP(const std::string& filename, // Export if (exporter.Export(ai_scene.get(), "glb2", filename.c_str()) == AI_FAILURE) { - utility::LogWarning("Got error: {}", exporter.GetErrorString()); + utility::LogWarning( + "Got error: ({}) while writing TriangleMesh to file {}.", + exporter.GetErrorString(), filename); return false; } diff --git a/cpp/open3d/t/io/file_format/FileJPG.cpp b/cpp/open3d/t/io/file_format/FileJPG.cpp index e1830f5135f..c572617680c 100644 --- a/cpp/open3d/t/io/file_format/FileJPG.cpp +++ b/cpp/open3d/t/io/file_format/FileJPG.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/io/file_format/FilePCD.cpp b/cpp/open3d/t/io/file_format/FilePCD.cpp index 4aa229c0d55..b61d3f34ae6 100644 --- a/cpp/open3d/t/io/file_format/FilePCD.cpp +++ b/cpp/open3d/t/io/file_format/FilePCD.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -89,30 +89,34 @@ struct WriteAttributePtr { }; static core::Dtype GetDtypeFromPCDHeaderField(char type, int size) { - if (type == 'I') { + char type_uppercase = std::toupper(type, std::locale()); + if (type_uppercase == 'I') { if (size == 1) return core::Dtype::Int8; if (size == 2) return core::Dtype::Int16; if (size == 4) return core::Dtype::Int32; if (size == 8) return core::Dtype::Int64; else - utility::LogError("Unsupported data type."); - } else if (type == 'U') { + utility::LogError("Unsupported size {} for data type {}.", size, + type); + } else if (type_uppercase == 'U') { if (size == 1) return core::Dtype::UInt8; if (size == 2) return core::Dtype::UInt16; if (size == 4) return core::Dtype::UInt32; if (size == 8) return core::Dtype::UInt64; else - utility::LogError("Unsupported data type."); - } else if (type == 'F') { + utility::LogError("Unsupported size {} for data type {}.", size, + type); + } else if (type_uppercase == 'F') { if (size == 4) return core::Dtype::Float32; if (size == 8) return core::Dtype::Float64; else - utility::LogError("Unsupported data type."); + utility::LogError("Unsupported size {} for data type {}.", size, + type); } else { - utility::LogError("Unsupported data type."); + utility::LogError("Unsupported data type {}.", type); } } @@ -305,13 +309,14 @@ static void ReadASCIIPCDColorsFromField(ReadAttributePtr &attr, if (field.size == 4) { std::uint8_t data[4] = {0}; char *end; - if (field.type == 'I') { + char type_uppercase = std::toupper(field.type, std::locale()); + if (type_uppercase == 'I') { std::int32_t value = std::strtol(data_ptr, &end, 0); std::memcpy(data, &value, sizeof(std::int32_t)); - } else if (field.type == 'U') { + } else if (type_uppercase == 'U') { std::uint32_t value = std::strtoul(data_ptr, &end, 0); std::memcpy(data, &value, sizeof(std::uint32_t)); - } else if (field.type == 'F') { + } else if (type_uppercase == 'F') { float value = std::strtof(data_ptr, &end); std::memcpy(data, &value, sizeof(float)); } diff --git a/cpp/open3d/t/io/file_format/FilePLY.cpp b/cpp/open3d/t/io/file_format/FilePLY.cpp index fe0db654b86..abc34238d09 100644 --- a/cpp/open3d/t/io/file_format/FilePLY.cpp +++ b/cpp/open3d/t/io/file_format/FilePLY.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/io/file_format/FilePNG.cpp b/cpp/open3d/t/io/file_format/FilePNG.cpp index 8560bc8b431..3ac8f74d17b 100644 --- a/cpp/open3d/t/io/file_format/FilePNG.cpp +++ b/cpp/open3d/t/io/file_format/FilePNG.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/io/file_format/FilePTS.cpp b/cpp/open3d/t/io/file_format/FilePTS.cpp index 5bd7d932bfc..d5f1f52be54 100644 --- a/cpp/open3d/t/io/file_format/FilePTS.cpp +++ b/cpp/open3d/t/io/file_format/FilePTS.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/io/file_format/FileTXT.cpp b/cpp/open3d/t/io/file_format/FileTXT.cpp index e0bee8e7027..615e882d6b9 100644 --- a/cpp/open3d/t/io/file_format/FileTXT.cpp +++ b/cpp/open3d/t/io/file_format/FileTXT.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/io/sensor/RGBDSensor.h b/cpp/open3d/t/io/sensor/RGBDSensor.h index 93dd110b933..e82d37aa4a1 100644 --- a/cpp/open3d/t/io/sensor/RGBDSensor.h +++ b/cpp/open3d/t/io/sensor/RGBDSensor.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/io/sensor/RGBDVideoMetadata.cpp b/cpp/open3d/t/io/sensor/RGBDVideoMetadata.cpp index 04fefbc8fc0..27d213ac999 100644 --- a/cpp/open3d/t/io/sensor/RGBDVideoMetadata.cpp +++ b/cpp/open3d/t/io/sensor/RGBDVideoMetadata.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/io/sensor/RGBDVideoMetadata.h b/cpp/open3d/t/io/sensor/RGBDVideoMetadata.h index a50eba2d0d2..90f7ba61708 100644 --- a/cpp/open3d/t/io/sensor/RGBDVideoMetadata.h +++ b/cpp/open3d/t/io/sensor/RGBDVideoMetadata.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/io/sensor/RGBDVideoReader.cpp b/cpp/open3d/t/io/sensor/RGBDVideoReader.cpp index 4115a42e12e..d85ccefa237 100644 --- a/cpp/open3d/t/io/sensor/RGBDVideoReader.cpp +++ b/cpp/open3d/t/io/sensor/RGBDVideoReader.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/io/sensor/RGBDVideoReader.h b/cpp/open3d/t/io/sensor/RGBDVideoReader.h index ed0580afa46..4337d9eea0f 100644 --- a/cpp/open3d/t/io/sensor/RGBDVideoReader.h +++ b/cpp/open3d/t/io/sensor/RGBDVideoReader.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/io/sensor/realsense/RSBagReader.cpp b/cpp/open3d/t/io/sensor/realsense/RSBagReader.cpp index 1bb6dd76081..9661cb80f8b 100644 --- a/cpp/open3d/t/io/sensor/realsense/RSBagReader.cpp +++ b/cpp/open3d/t/io/sensor/realsense/RSBagReader.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/io/sensor/realsense/RSBagReader.h b/cpp/open3d/t/io/sensor/realsense/RSBagReader.h index 8043398e960..bc843f97619 100644 --- a/cpp/open3d/t/io/sensor/realsense/RSBagReader.h +++ b/cpp/open3d/t/io/sensor/realsense/RSBagReader.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/io/sensor/realsense/RealSensePrivate.h b/cpp/open3d/t/io/sensor/realsense/RealSensePrivate.h index c9de591cbe1..3ab7f9f7765 100644 --- a/cpp/open3d/t/io/sensor/realsense/RealSensePrivate.h +++ b/cpp/open3d/t/io/sensor/realsense/RealSensePrivate.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/io/sensor/realsense/RealSenseSensor.cpp b/cpp/open3d/t/io/sensor/realsense/RealSenseSensor.cpp index e20264b5b8f..18e2226254e 100644 --- a/cpp/open3d/t/io/sensor/realsense/RealSenseSensor.cpp +++ b/cpp/open3d/t/io/sensor/realsense/RealSenseSensor.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/io/sensor/realsense/RealSenseSensor.h b/cpp/open3d/t/io/sensor/realsense/RealSenseSensor.h index 51ea8eb5e8a..3308e661f6f 100644 --- a/cpp/open3d/t/io/sensor/realsense/RealSenseSensor.h +++ b/cpp/open3d/t/io/sensor/realsense/RealSenseSensor.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/io/sensor/realsense/RealSenseSensorConfig.cpp b/cpp/open3d/t/io/sensor/realsense/RealSenseSensorConfig.cpp index 30056f991ed..7ff43fb8457 100644 --- a/cpp/open3d/t/io/sensor/realsense/RealSenseSensorConfig.cpp +++ b/cpp/open3d/t/io/sensor/realsense/RealSenseSensorConfig.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/io/sensor/realsense/RealSenseSensorConfig.h b/cpp/open3d/t/io/sensor/realsense/RealSenseSensorConfig.h index 985a8e7b874..f075fb09aa6 100644 --- a/cpp/open3d/t/io/sensor/realsense/RealSenseSensorConfig.h +++ b/cpp/open3d/t/io/sensor/realsense/RealSenseSensorConfig.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/kernel/Feature.cpp b/cpp/open3d/t/pipelines/kernel/Feature.cpp index 575932df95d..bd4014ecb5d 100644 --- a/cpp/open3d/t/pipelines/kernel/Feature.cpp +++ b/cpp/open3d/t/pipelines/kernel/Feature.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/kernel/Feature.h b/cpp/open3d/t/pipelines/kernel/Feature.h index 7dad8aa2991..6dd4a405342 100644 --- a/cpp/open3d/t/pipelines/kernel/Feature.h +++ b/cpp/open3d/t/pipelines/kernel/Feature.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/kernel/FeatureCPU.cpp b/cpp/open3d/t/pipelines/kernel/FeatureCPU.cpp index 0261a83ef64..2cf8222f5ba 100644 --- a/cpp/open3d/t/pipelines/kernel/FeatureCPU.cpp +++ b/cpp/open3d/t/pipelines/kernel/FeatureCPU.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/kernel/FeatureCUDA.cu b/cpp/open3d/t/pipelines/kernel/FeatureCUDA.cu index 0261a83ef64..2cf8222f5ba 100644 --- a/cpp/open3d/t/pipelines/kernel/FeatureCUDA.cu +++ b/cpp/open3d/t/pipelines/kernel/FeatureCUDA.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/kernel/FeatureImpl.h b/cpp/open3d/t/pipelines/kernel/FeatureImpl.h index 54a7e44f9e8..bd00f29fb77 100644 --- a/cpp/open3d/t/pipelines/kernel/FeatureImpl.h +++ b/cpp/open3d/t/pipelines/kernel/FeatureImpl.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/kernel/FillInLinearSystem.cpp b/cpp/open3d/t/pipelines/kernel/FillInLinearSystem.cpp index 37e69fb5f62..9d5e825da9a 100644 --- a/cpp/open3d/t/pipelines/kernel/FillInLinearSystem.cpp +++ b/cpp/open3d/t/pipelines/kernel/FillInLinearSystem.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/kernel/FillInLinearSystem.h b/cpp/open3d/t/pipelines/kernel/FillInLinearSystem.h index 39a4638cf78..1c529813841 100644 --- a/cpp/open3d/t/pipelines/kernel/FillInLinearSystem.h +++ b/cpp/open3d/t/pipelines/kernel/FillInLinearSystem.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/kernel/FillInLinearSystemCPU.cpp b/cpp/open3d/t/pipelines/kernel/FillInLinearSystemCPU.cpp index dfd5b25d8ef..1aa5c62663c 100644 --- a/cpp/open3d/t/pipelines/kernel/FillInLinearSystemCPU.cpp +++ b/cpp/open3d/t/pipelines/kernel/FillInLinearSystemCPU.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/kernel/FillInLinearSystemCUDA.cu b/cpp/open3d/t/pipelines/kernel/FillInLinearSystemCUDA.cu index dfd5b25d8ef..1aa5c62663c 100644 --- a/cpp/open3d/t/pipelines/kernel/FillInLinearSystemCUDA.cu +++ b/cpp/open3d/t/pipelines/kernel/FillInLinearSystemCUDA.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/kernel/FillInLinearSystemImpl.h b/cpp/open3d/t/pipelines/kernel/FillInLinearSystemImpl.h index b541082e2d2..e158809f6a4 100644 --- a/cpp/open3d/t/pipelines/kernel/FillInLinearSystemImpl.h +++ b/cpp/open3d/t/pipelines/kernel/FillInLinearSystemImpl.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/kernel/RGBDOdometry.cpp b/cpp/open3d/t/pipelines/kernel/RGBDOdometry.cpp index 783f263a322..ac61daeaa2c 100644 --- a/cpp/open3d/t/pipelines/kernel/RGBDOdometry.cpp +++ b/cpp/open3d/t/pipelines/kernel/RGBDOdometry.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/kernel/RGBDOdometry.h b/cpp/open3d/t/pipelines/kernel/RGBDOdometry.h index 04bf1f83371..27e44dce158 100644 --- a/cpp/open3d/t/pipelines/kernel/RGBDOdometry.h +++ b/cpp/open3d/t/pipelines/kernel/RGBDOdometry.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/kernel/RGBDOdometryCPU.cpp b/cpp/open3d/t/pipelines/kernel/RGBDOdometryCPU.cpp index e140c455e96..10ed434d5b0 100644 --- a/cpp/open3d/t/pipelines/kernel/RGBDOdometryCPU.cpp +++ b/cpp/open3d/t/pipelines/kernel/RGBDOdometryCPU.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/kernel/RGBDOdometryCUDA.cu b/cpp/open3d/t/pipelines/kernel/RGBDOdometryCUDA.cu index 2fbc1567f2d..8709196ee4a 100644 --- a/cpp/open3d/t/pipelines/kernel/RGBDOdometryCUDA.cu +++ b/cpp/open3d/t/pipelines/kernel/RGBDOdometryCUDA.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/kernel/RGBDOdometryImpl.h b/cpp/open3d/t/pipelines/kernel/RGBDOdometryImpl.h index 429419b0b9b..d1aacbbeac3 100644 --- a/cpp/open3d/t/pipelines/kernel/RGBDOdometryImpl.h +++ b/cpp/open3d/t/pipelines/kernel/RGBDOdometryImpl.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/kernel/RGBDOdometryJacobianImpl.h b/cpp/open3d/t/pipelines/kernel/RGBDOdometryJacobianImpl.h index 53ad47444e3..0dbe0d97f94 100644 --- a/cpp/open3d/t/pipelines/kernel/RGBDOdometryJacobianImpl.h +++ b/cpp/open3d/t/pipelines/kernel/RGBDOdometryJacobianImpl.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/kernel/Registration.cpp b/cpp/open3d/t/pipelines/kernel/Registration.cpp index b99a5065359..326671431f3 100644 --- a/cpp/open3d/t/pipelines/kernel/Registration.cpp +++ b/cpp/open3d/t/pipelines/kernel/Registration.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/kernel/Registration.h b/cpp/open3d/t/pipelines/kernel/Registration.h index 3a375b85c3c..3358d30a9ac 100644 --- a/cpp/open3d/t/pipelines/kernel/Registration.h +++ b/cpp/open3d/t/pipelines/kernel/Registration.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/kernel/RegistrationCPU.cpp b/cpp/open3d/t/pipelines/kernel/RegistrationCPU.cpp index d2ea8b584ab..5fd20f196bb 100644 --- a/cpp/open3d/t/pipelines/kernel/RegistrationCPU.cpp +++ b/cpp/open3d/t/pipelines/kernel/RegistrationCPU.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/kernel/RegistrationCUDA.cu b/cpp/open3d/t/pipelines/kernel/RegistrationCUDA.cu index 20532dde857..1fe76815a2f 100644 --- a/cpp/open3d/t/pipelines/kernel/RegistrationCUDA.cu +++ b/cpp/open3d/t/pipelines/kernel/RegistrationCUDA.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/kernel/RegistrationImpl.h b/cpp/open3d/t/pipelines/kernel/RegistrationImpl.h index 9d0309b16c7..3f08ca4c811 100644 --- a/cpp/open3d/t/pipelines/kernel/RegistrationImpl.h +++ b/cpp/open3d/t/pipelines/kernel/RegistrationImpl.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/kernel/TransformationConverter.cpp b/cpp/open3d/t/pipelines/kernel/TransformationConverter.cpp index ec5bac0c9de..c181ade770e 100644 --- a/cpp/open3d/t/pipelines/kernel/TransformationConverter.cpp +++ b/cpp/open3d/t/pipelines/kernel/TransformationConverter.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/kernel/TransformationConverter.cu b/cpp/open3d/t/pipelines/kernel/TransformationConverter.cu index 7eb97abb1b3..55fe8bcb14c 100644 --- a/cpp/open3d/t/pipelines/kernel/TransformationConverter.cu +++ b/cpp/open3d/t/pipelines/kernel/TransformationConverter.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/kernel/TransformationConverter.h b/cpp/open3d/t/pipelines/kernel/TransformationConverter.h index 1155f20b4d5..4d4d43c5d8d 100644 --- a/cpp/open3d/t/pipelines/kernel/TransformationConverter.h +++ b/cpp/open3d/t/pipelines/kernel/TransformationConverter.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/kernel/TransformationConverterImpl.h b/cpp/open3d/t/pipelines/kernel/TransformationConverterImpl.h index 86879dbf863..e75484ce3f5 100644 --- a/cpp/open3d/t/pipelines/kernel/TransformationConverterImpl.h +++ b/cpp/open3d/t/pipelines/kernel/TransformationConverterImpl.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/odometry/RGBDOdometry.cpp b/cpp/open3d/t/pipelines/odometry/RGBDOdometry.cpp index 3d0ee8a2aec..ac2e26af0c4 100644 --- a/cpp/open3d/t/pipelines/odometry/RGBDOdometry.cpp +++ b/cpp/open3d/t/pipelines/odometry/RGBDOdometry.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/odometry/RGBDOdometry.h b/cpp/open3d/t/pipelines/odometry/RGBDOdometry.h index 20c2de8e3bc..b868d1aa69a 100644 --- a/cpp/open3d/t/pipelines/odometry/RGBDOdometry.h +++ b/cpp/open3d/t/pipelines/odometry/RGBDOdometry.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/registration/Feature.cpp b/cpp/open3d/t/pipelines/registration/Feature.cpp index d20e1a1b58c..8fc78a535ef 100644 --- a/cpp/open3d/t/pipelines/registration/Feature.cpp +++ b/cpp/open3d/t/pipelines/registration/Feature.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/registration/Feature.h b/cpp/open3d/t/pipelines/registration/Feature.h index 59b6ba489d8..65a88408833 100644 --- a/cpp/open3d/t/pipelines/registration/Feature.h +++ b/cpp/open3d/t/pipelines/registration/Feature.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/registration/Registration.cpp b/cpp/open3d/t/pipelines/registration/Registration.cpp index 2b7cbb19976..7487828b379 100644 --- a/cpp/open3d/t/pipelines/registration/Registration.cpp +++ b/cpp/open3d/t/pipelines/registration/Registration.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/registration/Registration.h b/cpp/open3d/t/pipelines/registration/Registration.h index 036c126ca43..ed933b60132 100644 --- a/cpp/open3d/t/pipelines/registration/Registration.h +++ b/cpp/open3d/t/pipelines/registration/Registration.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/registration/RobustKernel.h b/cpp/open3d/t/pipelines/registration/RobustKernel.h index 215ab9d8018..62613a71722 100644 --- a/cpp/open3d/t/pipelines/registration/RobustKernel.h +++ b/cpp/open3d/t/pipelines/registration/RobustKernel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/registration/RobustKernelImpl.h b/cpp/open3d/t/pipelines/registration/RobustKernelImpl.h index 95e551a05f7..623f59db8e1 100644 --- a/cpp/open3d/t/pipelines/registration/RobustKernelImpl.h +++ b/cpp/open3d/t/pipelines/registration/RobustKernelImpl.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/registration/TransformationEstimation.cpp b/cpp/open3d/t/pipelines/registration/TransformationEstimation.cpp index 5c19333c00a..922cc31ef70 100644 --- a/cpp/open3d/t/pipelines/registration/TransformationEstimation.cpp +++ b/cpp/open3d/t/pipelines/registration/TransformationEstimation.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/registration/TransformationEstimation.h b/cpp/open3d/t/pipelines/registration/TransformationEstimation.h index acc13f7d726..ab72cc33f10 100644 --- a/cpp/open3d/t/pipelines/registration/TransformationEstimation.h +++ b/cpp/open3d/t/pipelines/registration/TransformationEstimation.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/slac/ControlGrid.cpp b/cpp/open3d/t/pipelines/slac/ControlGrid.cpp index c440c57005b..857d6c4913f 100644 --- a/cpp/open3d/t/pipelines/slac/ControlGrid.cpp +++ b/cpp/open3d/t/pipelines/slac/ControlGrid.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/slac/ControlGrid.h b/cpp/open3d/t/pipelines/slac/ControlGrid.h index bdb5a5e21c7..10f2b6ac801 100644 --- a/cpp/open3d/t/pipelines/slac/ControlGrid.h +++ b/cpp/open3d/t/pipelines/slac/ControlGrid.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/slac/FillInLinearSystemImpl.h b/cpp/open3d/t/pipelines/slac/FillInLinearSystemImpl.h index 4ad6a5d89d1..1e155a69ef6 100644 --- a/cpp/open3d/t/pipelines/slac/FillInLinearSystemImpl.h +++ b/cpp/open3d/t/pipelines/slac/FillInLinearSystemImpl.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/slac/SLACOptimizer.cpp b/cpp/open3d/t/pipelines/slac/SLACOptimizer.cpp index f51f59ce4fd..005c5f06dc3 100644 --- a/cpp/open3d/t/pipelines/slac/SLACOptimizer.cpp +++ b/cpp/open3d/t/pipelines/slac/SLACOptimizer.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/slac/SLACOptimizer.h b/cpp/open3d/t/pipelines/slac/SLACOptimizer.h index fb0aafde516..838eec89a02 100644 --- a/cpp/open3d/t/pipelines/slac/SLACOptimizer.h +++ b/cpp/open3d/t/pipelines/slac/SLACOptimizer.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/slac/Visualization.cpp b/cpp/open3d/t/pipelines/slac/Visualization.cpp index d84bfb3cbca..23de27d0b42 100644 --- a/cpp/open3d/t/pipelines/slac/Visualization.cpp +++ b/cpp/open3d/t/pipelines/slac/Visualization.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/slac/Visualization.h b/cpp/open3d/t/pipelines/slac/Visualization.h index 9c70bcdaa4a..d576b919c4e 100644 --- a/cpp/open3d/t/pipelines/slac/Visualization.h +++ b/cpp/open3d/t/pipelines/slac/Visualization.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/slam/Frame.h b/cpp/open3d/t/pipelines/slam/Frame.h index 70e4955cfee..794588d4b8d 100644 --- a/cpp/open3d/t/pipelines/slam/Frame.h +++ b/cpp/open3d/t/pipelines/slam/Frame.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/slam/Model.cpp b/cpp/open3d/t/pipelines/slam/Model.cpp index 9ca3cad0ac5..18fc3e0bfec 100644 --- a/cpp/open3d/t/pipelines/slam/Model.cpp +++ b/cpp/open3d/t/pipelines/slam/Model.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/t/pipelines/slam/Model.h b/cpp/open3d/t/pipelines/slam/Model.h index b9f0c6105e1..84ab6c32f56 100644 --- a/cpp/open3d/t/pipelines/slam/Model.h +++ b/cpp/open3d/t/pipelines/slam/Model.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/CPUInfo.cpp b/cpp/open3d/utility/CPUInfo.cpp index 12a9e99ddb5..502e1241e19 100644 --- a/cpp/open3d/utility/CPUInfo.cpp +++ b/cpp/open3d/utility/CPUInfo.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/CPUInfo.h b/cpp/open3d/utility/CPUInfo.h index 0dd80fa9466..b02c470fd13 100644 --- a/cpp/open3d/utility/CPUInfo.h +++ b/cpp/open3d/utility/CPUInfo.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- #pragma once diff --git a/cpp/open3d/utility/CompilerInfo.cpp b/cpp/open3d/utility/CompilerInfo.cpp index 41981cf9810..ecd538ce92d 100644 --- a/cpp/open3d/utility/CompilerInfo.cpp +++ b/cpp/open3d/utility/CompilerInfo.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/CompilerInfo.h b/cpp/open3d/utility/CompilerInfo.h index 61c0a4404be..8bfbecb6a93 100644 --- a/cpp/open3d/utility/CompilerInfo.h +++ b/cpp/open3d/utility/CompilerInfo.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- #pragma once diff --git a/cpp/open3d/utility/Console.cpp b/cpp/open3d/utility/Console.cpp index 27e719ec63b..2faae23aabb 100644 --- a/cpp/open3d/utility/Console.cpp +++ b/cpp/open3d/utility/Console.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/Console.h b/cpp/open3d/utility/Console.h index 976f776feb6..eb3f3b65066 100644 --- a/cpp/open3d/utility/Console.h +++ b/cpp/open3d/utility/Console.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/Download.cpp b/cpp/open3d/utility/Download.cpp index 025dbc6641e..6f3443cc907 100644 --- a/cpp/open3d/utility/Download.cpp +++ b/cpp/open3d/utility/Download.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/Download.h b/cpp/open3d/utility/Download.h index 84ec68c42bb..0ab24f6e78b 100644 --- a/cpp/open3d/utility/Download.h +++ b/cpp/open3d/utility/Download.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/Eigen.cpp b/cpp/open3d/utility/Eigen.cpp index b3f6fb34476..eb60c357fb7 100644 --- a/cpp/open3d/utility/Eigen.cpp +++ b/cpp/open3d/utility/Eigen.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/Eigen.h b/cpp/open3d/utility/Eigen.h index d3438d6d547..871b6be12bc 100644 --- a/cpp/open3d/utility/Eigen.h +++ b/cpp/open3d/utility/Eigen.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/Extract.cpp b/cpp/open3d/utility/Extract.cpp index 888de14b455..8004cc380bd 100644 --- a/cpp/open3d/utility/Extract.cpp +++ b/cpp/open3d/utility/Extract.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/Extract.h b/cpp/open3d/utility/Extract.h index 355ff6277b8..7a847d49744 100644 --- a/cpp/open3d/utility/Extract.h +++ b/cpp/open3d/utility/Extract.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/ExtractZIP.cpp b/cpp/open3d/utility/ExtractZIP.cpp index 9d80393d72a..eba295992c2 100644 --- a/cpp/open3d/utility/ExtractZIP.cpp +++ b/cpp/open3d/utility/ExtractZIP.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/ExtractZIP.h b/cpp/open3d/utility/ExtractZIP.h index a9e406be616..e11923492d0 100644 --- a/cpp/open3d/utility/ExtractZIP.h +++ b/cpp/open3d/utility/ExtractZIP.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/FileSystem.cpp b/cpp/open3d/utility/FileSystem.cpp index 98ff4926f2b..604507edc35 100644 --- a/cpp/open3d/utility/FileSystem.cpp +++ b/cpp/open3d/utility/FileSystem.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/FileSystem.h b/cpp/open3d/utility/FileSystem.h index de77a863299..f1f56f99a5e 100644 --- a/cpp/open3d/utility/FileSystem.h +++ b/cpp/open3d/utility/FileSystem.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/Helper.cpp b/cpp/open3d/utility/Helper.cpp index 47530070249..4a1db5f37db 100644 --- a/cpp/open3d/utility/Helper.cpp +++ b/cpp/open3d/utility/Helper.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/Helper.h b/cpp/open3d/utility/Helper.h index 067a93d47b4..5b026437f84 100644 --- a/cpp/open3d/utility/Helper.h +++ b/cpp/open3d/utility/Helper.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/Helper.isph b/cpp/open3d/utility/Helper.isph index 25a785a0966..e7b3becb669 100644 --- a/cpp/open3d/utility/Helper.isph +++ b/cpp/open3d/utility/Helper.isph @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/IJsonConvertible.cpp b/cpp/open3d/utility/IJsonConvertible.cpp index b9f9fa9b07d..2d4a4959b83 100644 --- a/cpp/open3d/utility/IJsonConvertible.cpp +++ b/cpp/open3d/utility/IJsonConvertible.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/IJsonConvertible.h b/cpp/open3d/utility/IJsonConvertible.h index 8febffa566f..270363310f5 100644 --- a/cpp/open3d/utility/IJsonConvertible.h +++ b/cpp/open3d/utility/IJsonConvertible.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -86,7 +86,7 @@ namespace fmt { template <> struct formatter { template - auto format(const Json::Value &value, FormatContext &ctx) + auto format(const Json::Value &value, FormatContext &ctx) const -> decltype(ctx.out()) { return format_to(ctx.out(), "{}", open3d::utility::JsonToString(value)); } diff --git a/cpp/open3d/utility/ISAInfo.cpp b/cpp/open3d/utility/ISAInfo.cpp index fb7f9841ad2..a712eac448b 100644 --- a/cpp/open3d/utility/ISAInfo.cpp +++ b/cpp/open3d/utility/ISAInfo.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/ISAInfo.h b/cpp/open3d/utility/ISAInfo.h index 46947ce5993..8d9577127ce 100644 --- a/cpp/open3d/utility/ISAInfo.h +++ b/cpp/open3d/utility/ISAInfo.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- #pragma once diff --git a/cpp/open3d/utility/ISAInfo.ispc b/cpp/open3d/utility/ISAInfo.ispc index 89dbf92175b..e8c1273c896 100644 --- a/cpp/open3d/utility/ISAInfo.ispc +++ b/cpp/open3d/utility/ISAInfo.ispc @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/ISAInfo.isph b/cpp/open3d/utility/ISAInfo.isph index 468b7cd4d7f..be32e17b7cf 100644 --- a/cpp/open3d/utility/ISAInfo.isph +++ b/cpp/open3d/utility/ISAInfo.isph @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/Logging.cpp b/cpp/open3d/utility/Logging.cpp index 782c51553f3..7440212f097 100644 --- a/cpp/open3d/utility/Logging.cpp +++ b/cpp/open3d/utility/Logging.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/Logging.h b/cpp/open3d/utility/Logging.h index fdb132f9b06..5c1afcf5c00 100644 --- a/cpp/open3d/utility/Logging.h +++ b/cpp/open3d/utility/Logging.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/MiniVec.h b/cpp/open3d/utility/MiniVec.h index 6bf608d6082..17eca20b129 100644 --- a/cpp/open3d/utility/MiniVec.h +++ b/cpp/open3d/utility/MiniVec.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/Optional.h b/cpp/open3d/utility/Optional.h index ccbbb27d38b..345c9b15eb7 100644 --- a/cpp/open3d/utility/Optional.h +++ b/cpp/open3d/utility/Optional.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // Copyright (C) 2011 - 2012 Andrzej Krzemienski. diff --git a/cpp/open3d/utility/Overload.h b/cpp/open3d/utility/Overload.h index 0b6282184bb..d42a023518d 100644 --- a/cpp/open3d/utility/Overload.h +++ b/cpp/open3d/utility/Overload.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/Parallel.cpp b/cpp/open3d/utility/Parallel.cpp index b05f2375a95..79989eeeddd 100644 --- a/cpp/open3d/utility/Parallel.cpp +++ b/cpp/open3d/utility/Parallel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/Parallel.h b/cpp/open3d/utility/Parallel.h index 9763f533221..ad37dfaa1be 100644 --- a/cpp/open3d/utility/Parallel.h +++ b/cpp/open3d/utility/Parallel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/ParallelScan.h b/cpp/open3d/utility/ParallelScan.h index 0479d611eb5..6fc4f8b940c 100644 --- a/cpp/open3d/utility/ParallelScan.h +++ b/cpp/open3d/utility/ParallelScan.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -10,42 +10,6 @@ #include #include -// clang-format off -#if TBB_INTERFACE_VERSION >= 10000 - #ifdef OPEN3D_USE_ONEAPI_PACKAGES - #ifdef _PSTL_UDR_PRESENT - #undef _PSTL_UDR_PRESENT - #endif - #define _PSTL_UDR_PRESENT 0 - #ifdef _PSTL_UDS_PRESENT - #undef _PSTL_UDS_PRESENT - #endif - #define _PSTL_UDS_PRESENT 0 - #include - #include - #else - // Check if the C++ standard library implements parallel algorithms - // and use this over parallelstl to avoid conflicts. - // Clang does not implement it so far, so checking for C++17 is not sufficient. - #ifdef __cpp_lib_parallel_algorithm - #include - #include - #else - #include - #include - // parallelstl incorrectly assumes MSVC to unconditionally implement - // parallel algorithms even if __cpp_lib_parallel_algorithm is not - // defined. So manually include the header which pulls all - // "pstl::execution" definitions into the "std" namespace. - #if __PSTL_CPP17_EXECUTION_POLICIES_PRESENT - #include - #endif - #endif - #endif -#endif - -// clang-format on - namespace open3d { namespace utility { @@ -77,19 +41,9 @@ class ScanSumBody { template void InclusivePrefixSum(const Tin* first, const Tin* last, Tout* out) { -#if TBB_INTERFACE_VERSION >= 10000 - // use parallelstl if we have TBB 2018 or later -#ifdef OPEN3D_USE_ONEAPI_PACKAGES - std::inclusive_scan(oneapi::dpl::execution::par_unseq, first, last, out); - -#else - std::inclusive_scan(std::execution::par_unseq, first, last, out); -#endif -#else ScanSumBody body(out, first); size_t n = std::distance(first, last); tbb::parallel_scan(tbb::blocked_range(0, n), body); -#endif } } // namespace utility diff --git a/cpp/open3d/utility/Preprocessor.h b/cpp/open3d/utility/Preprocessor.h index 707b516a623..3111562d9ad 100644 --- a/cpp/open3d/utility/Preprocessor.h +++ b/cpp/open3d/utility/Preprocessor.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/ProgressBar.cpp b/cpp/open3d/utility/ProgressBar.cpp index 5a5c6fce1ab..efbe57023c4 100644 --- a/cpp/open3d/utility/ProgressBar.cpp +++ b/cpp/open3d/utility/ProgressBar.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/ProgressBar.h b/cpp/open3d/utility/ProgressBar.h index 710fa370f0e..e5882541900 100644 --- a/cpp/open3d/utility/ProgressBar.h +++ b/cpp/open3d/utility/ProgressBar.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/ProgressReporters.h b/cpp/open3d/utility/ProgressReporters.h index 53657d7746a..ccd29d5386a 100644 --- a/cpp/open3d/utility/ProgressReporters.h +++ b/cpp/open3d/utility/ProgressReporters.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/Random.cpp b/cpp/open3d/utility/Random.cpp index 8d0c54a9697..554439e0674 100644 --- a/cpp/open3d/utility/Random.cpp +++ b/cpp/open3d/utility/Random.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/Random.h b/cpp/open3d/utility/Random.h index 1a3411d29a2..ffb5a4113a3 100644 --- a/cpp/open3d/utility/Random.h +++ b/cpp/open3d/utility/Random.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/Timer.cpp b/cpp/open3d/utility/Timer.cpp index 93ff5012bba..31122587497 100644 --- a/cpp/open3d/utility/Timer.cpp +++ b/cpp/open3d/utility/Timer.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/utility/Timer.h b/cpp/open3d/utility/Timer.h index 2a508a78dc2..a5896a1127a 100644 --- a/cpp/open3d/utility/Timer.h +++ b/cpp/open3d/utility/Timer.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/CMakeLists.txt b/cpp/open3d/visualization/CMakeLists.txt index fd794dcea24..8cf18c2088c 100644 --- a/cpp/open3d/visualization/CMakeLists.txt +++ b/cpp/open3d/visualization/CMakeLists.txt @@ -1,6 +1,9 @@ open3d_ispc_add_library(visualization OBJECT) -target_sources(visualization PRIVATE +open3d_ispc_add_library(visualization_impl OBJECT) +set_target_properties(visualization_impl PROPERTIES CXX_VISIBILITY_PRESET hidden) + +target_sources(visualization_impl PRIVATE shader/GeometryRenderer.cpp shader/ImageMaskShader.cpp shader/ImageShader.cpp @@ -62,14 +65,14 @@ if (BUILD_GUI) rendering/Renderer.cpp rendering/RendererHandle.cpp rendering/RotationInteractorLogic.cpp + rendering/filament/FilamentEngine.cpp + rendering/filament/FilamentRenderer.cpp ) - target_sources(visualization PRIVATE + target_sources(visualization_impl PRIVATE rendering/filament/FilamentCamera.cpp - rendering/filament/FilamentEngine.cpp rendering/filament/FilamentEntitiesMods.cpp rendering/filament/FilamentGeometryBuffersBuilder.cpp - rendering/filament/FilamentRenderer.cpp rendering/filament/FilamentRenderToBuffer.cpp rendering/filament/FilamentResourceManager.cpp rendering/filament/FilamentScene.cpp @@ -131,7 +134,7 @@ open3d_add_encoded_shader(shader # Source group for Visual Studio add_source_group(shader/glsl) -add_dependencies(visualization shader) +add_dependencies(visualization_impl shader) open3d_show_and_abort_on_warning(visualization) @@ -139,6 +142,11 @@ open3d_set_global_properties(visualization) open3d_set_open3d_lib_properties(visualization) open3d_link_3rdparty_libraries(visualization) +open3d_show_and_abort_on_warning(visualization_impl) +open3d_set_global_properties(visualization_impl) +open3d_set_open3d_lib_properties(visualization_impl) +open3d_link_3rdparty_libraries(visualization_impl) + # export GUI_RESOURCE_DIR to parent scope if (BUILD_GUI) set(GUI_RESOURCE_DIR ${GUI_RESOURCE_DIR} PARENT_SCOPE) diff --git a/cpp/open3d/visualization/app/Viewer.cpp b/cpp/open3d/visualization/app/Viewer.cpp index 8dc5de39875..c24c37fe849 100644 --- a/cpp/open3d/visualization/app/Viewer.cpp +++ b/cpp/open3d/visualization/app/Viewer.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/app/Viewer.h b/cpp/open3d/visualization/app/Viewer.h index f36f42f729d..4978342dddf 100644 --- a/cpp/open3d/visualization/app/Viewer.h +++ b/cpp/open3d/visualization/app/Viewer.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Application.cpp b/cpp/open3d/visualization/gui/Application.cpp index 89cfa9746b2..55ca48cd8ff 100644 --- a/cpp/open3d/visualization/gui/Application.cpp +++ b/cpp/open3d/visualization/gui/Application.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Application.h b/cpp/open3d/visualization/gui/Application.h index e7bbef4fe13..49de13e5d37 100644 --- a/cpp/open3d/visualization/gui/Application.h +++ b/cpp/open3d/visualization/gui/Application.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/BitmapWindowSystem.cpp b/cpp/open3d/visualization/gui/BitmapWindowSystem.cpp index 49fe527eeca..f40e5545556 100644 --- a/cpp/open3d/visualization/gui/BitmapWindowSystem.cpp +++ b/cpp/open3d/visualization/gui/BitmapWindowSystem.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/BitmapWindowSystem.h b/cpp/open3d/visualization/gui/BitmapWindowSystem.h index 8b7268630a7..a0558c6898b 100644 --- a/cpp/open3d/visualization/gui/BitmapWindowSystem.h +++ b/cpp/open3d/visualization/gui/BitmapWindowSystem.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Button.cpp b/cpp/open3d/visualization/gui/Button.cpp index 129ed0d4fec..f87a3456d8d 100644 --- a/cpp/open3d/visualization/gui/Button.cpp +++ b/cpp/open3d/visualization/gui/Button.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Button.h b/cpp/open3d/visualization/gui/Button.h index 03d7c1f17d0..cf3d32b666c 100644 --- a/cpp/open3d/visualization/gui/Button.h +++ b/cpp/open3d/visualization/gui/Button.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Checkbox.cpp b/cpp/open3d/visualization/gui/Checkbox.cpp index 1c95e97206a..f25b3af70ae 100644 --- a/cpp/open3d/visualization/gui/Checkbox.cpp +++ b/cpp/open3d/visualization/gui/Checkbox.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Checkbox.h b/cpp/open3d/visualization/gui/Checkbox.h index 0863fb7e790..313756a599a 100644 --- a/cpp/open3d/visualization/gui/Checkbox.h +++ b/cpp/open3d/visualization/gui/Checkbox.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Color.cpp b/cpp/open3d/visualization/gui/Color.cpp index b4d4d0a9dd3..5d11e093a07 100644 --- a/cpp/open3d/visualization/gui/Color.cpp +++ b/cpp/open3d/visualization/gui/Color.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Color.h b/cpp/open3d/visualization/gui/Color.h index fe1c9025685..44f70fa605b 100644 --- a/cpp/open3d/visualization/gui/Color.h +++ b/cpp/open3d/visualization/gui/Color.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/ColorEdit.cpp b/cpp/open3d/visualization/gui/ColorEdit.cpp index 1a21c676156..13eb65a3c68 100644 --- a/cpp/open3d/visualization/gui/ColorEdit.cpp +++ b/cpp/open3d/visualization/gui/ColorEdit.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/ColorEdit.h b/cpp/open3d/visualization/gui/ColorEdit.h index 89ca5a2d3db..050a9208a0e 100644 --- a/cpp/open3d/visualization/gui/ColorEdit.h +++ b/cpp/open3d/visualization/gui/ColorEdit.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Combobox.cpp b/cpp/open3d/visualization/gui/Combobox.cpp index 2bba54cc0f5..eb4c59d7625 100644 --- a/cpp/open3d/visualization/gui/Combobox.cpp +++ b/cpp/open3d/visualization/gui/Combobox.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Combobox.h b/cpp/open3d/visualization/gui/Combobox.h index b1f4e0d60f4..e17d9b7d483 100644 --- a/cpp/open3d/visualization/gui/Combobox.h +++ b/cpp/open3d/visualization/gui/Combobox.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Dialog.cpp b/cpp/open3d/visualization/gui/Dialog.cpp index 1563735083b..0f4dba1aaef 100644 --- a/cpp/open3d/visualization/gui/Dialog.cpp +++ b/cpp/open3d/visualization/gui/Dialog.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Dialog.h b/cpp/open3d/visualization/gui/Dialog.h index b15f7226d12..8823086d705 100644 --- a/cpp/open3d/visualization/gui/Dialog.h +++ b/cpp/open3d/visualization/gui/Dialog.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Events.cpp b/cpp/open3d/visualization/gui/Events.cpp index e0819be8164..046be63a950 100644 --- a/cpp/open3d/visualization/gui/Events.cpp +++ b/cpp/open3d/visualization/gui/Events.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Events.h b/cpp/open3d/visualization/gui/Events.h index 90f94364910..fcdaebf126a 100644 --- a/cpp/open3d/visualization/gui/Events.h +++ b/cpp/open3d/visualization/gui/Events.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/FileDialog.cpp b/cpp/open3d/visualization/gui/FileDialog.cpp index 28f6efe2b92..d9a1d82175e 100644 --- a/cpp/open3d/visualization/gui/FileDialog.cpp +++ b/cpp/open3d/visualization/gui/FileDialog.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/FileDialog.h b/cpp/open3d/visualization/gui/FileDialog.h index f28ee11c463..59e60955b96 100644 --- a/cpp/open3d/visualization/gui/FileDialog.h +++ b/cpp/open3d/visualization/gui/FileDialog.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/FileDialogNative.cpp b/cpp/open3d/visualization/gui/FileDialogNative.cpp index 7e42930f9b9..27b69d7ecb5 100644 --- a/cpp/open3d/visualization/gui/FileDialogNative.cpp +++ b/cpp/open3d/visualization/gui/FileDialogNative.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Font.cpp b/cpp/open3d/visualization/gui/Font.cpp index 39e30fccd53..0067b28537d 100644 --- a/cpp/open3d/visualization/gui/Font.cpp +++ b/cpp/open3d/visualization/gui/Font.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Font.h b/cpp/open3d/visualization/gui/Font.h index 62467154ac7..071326b9943 100644 --- a/cpp/open3d/visualization/gui/Font.h +++ b/cpp/open3d/visualization/gui/Font.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/GLFWWindowSystem.cpp b/cpp/open3d/visualization/gui/GLFWWindowSystem.cpp index 37f17121007..f1011a7cfff 100644 --- a/cpp/open3d/visualization/gui/GLFWWindowSystem.cpp +++ b/cpp/open3d/visualization/gui/GLFWWindowSystem.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/GLFWWindowSystem.h b/cpp/open3d/visualization/gui/GLFWWindowSystem.h index a74a37af3e6..a8ef84f62f5 100644 --- a/cpp/open3d/visualization/gui/GLFWWindowSystem.h +++ b/cpp/open3d/visualization/gui/GLFWWindowSystem.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Gui.cpp b/cpp/open3d/visualization/gui/Gui.cpp index 2ea50c767c2..193691d6b8b 100644 --- a/cpp/open3d/visualization/gui/Gui.cpp +++ b/cpp/open3d/visualization/gui/Gui.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Gui.h b/cpp/open3d/visualization/gui/Gui.h index 55ff2f32036..3ab40897a88 100644 --- a/cpp/open3d/visualization/gui/Gui.h +++ b/cpp/open3d/visualization/gui/Gui.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/ImageWidget.cpp b/cpp/open3d/visualization/gui/ImageWidget.cpp index 89daee1b26d..5287791e856 100644 --- a/cpp/open3d/visualization/gui/ImageWidget.cpp +++ b/cpp/open3d/visualization/gui/ImageWidget.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/ImageWidget.h b/cpp/open3d/visualization/gui/ImageWidget.h index 778a2885aed..a251fdf90f2 100644 --- a/cpp/open3d/visualization/gui/ImageWidget.h +++ b/cpp/open3d/visualization/gui/ImageWidget.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/ImguiFilamentBridge.cpp b/cpp/open3d/visualization/gui/ImguiFilamentBridge.cpp index 243e3868a77..21a81a77b4a 100644 --- a/cpp/open3d/visualization/gui/ImguiFilamentBridge.cpp +++ b/cpp/open3d/visualization/gui/ImguiFilamentBridge.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // Altered from Filament's ImGuiHelper.cpp diff --git a/cpp/open3d/visualization/gui/ImguiFilamentBridge.h b/cpp/open3d/visualization/gui/ImguiFilamentBridge.h index 8eae6c97b57..69708f7f761 100644 --- a/cpp/open3d/visualization/gui/ImguiFilamentBridge.h +++ b/cpp/open3d/visualization/gui/ImguiFilamentBridge.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // Altered from Filament's ImGuiHelper.cpp diff --git a/cpp/open3d/visualization/gui/Label.cpp b/cpp/open3d/visualization/gui/Label.cpp index 60e257c7101..253c390f2ea 100644 --- a/cpp/open3d/visualization/gui/Label.cpp +++ b/cpp/open3d/visualization/gui/Label.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Label.h b/cpp/open3d/visualization/gui/Label.h index aa1e5cb071f..1192542b30e 100644 --- a/cpp/open3d/visualization/gui/Label.h +++ b/cpp/open3d/visualization/gui/Label.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Label3D.cpp b/cpp/open3d/visualization/gui/Label3D.cpp index 172f338f153..97bed9bb3c9 100644 --- a/cpp/open3d/visualization/gui/Label3D.cpp +++ b/cpp/open3d/visualization/gui/Label3D.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Label3D.h b/cpp/open3d/visualization/gui/Label3D.h index 06788b2f5a2..419da087842 100644 --- a/cpp/open3d/visualization/gui/Label3D.h +++ b/cpp/open3d/visualization/gui/Label3D.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Layout.cpp b/cpp/open3d/visualization/gui/Layout.cpp index f61c26eafe6..f8e4fa0d111 100644 --- a/cpp/open3d/visualization/gui/Layout.cpp +++ b/cpp/open3d/visualization/gui/Layout.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -386,10 +386,7 @@ CollapsableVert::CollapsableVert(const char* text, int spacing, const Margins& margins /*= Margins()*/) : Vert(spacing, margins), impl_(new CollapsableVert::Impl()) { - static int g_next_id = 1; - - impl_->text_ = text; - impl_->id_ = impl_->text_ + "##collapsing_" + std::to_string(g_next_id++); + SetText(text); } CollapsableVert::~CollapsableVert() {} @@ -398,6 +395,15 @@ void CollapsableVert::SetIsOpen(bool is_open) { impl_->is_open_ = is_open; } bool CollapsableVert::GetIsOpen() { return impl_->is_open_; } +void CollapsableVert::SetText(const char* text) { + static int g_next_id = 1; + + impl_->text_ = text; + impl_->id_ = impl_->text_ + "##collapsing_" + std::to_string(g_next_id++); +} + +std::string CollapsableVert::GetText() const { return impl_->text_; }; + FontId CollapsableVert::GetFontId() const { return impl_->font_id_; } void CollapsableVert::SetFontId(FontId font_id) { impl_->font_id_ = font_id; } diff --git a/cpp/open3d/visualization/gui/Layout.h b/cpp/open3d/visualization/gui/Layout.h index 8d069e49273..175e4ffe263 100644 --- a/cpp/open3d/visualization/gui/Layout.h +++ b/cpp/open3d/visualization/gui/Layout.h @@ -1,12 +1,14 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- #pragma once +#include + #include "open3d/visualization/gui/Widget.h" namespace open3d { @@ -148,6 +150,9 @@ class CollapsableVert : public Vert { /// Returns true if open and false if collapsed. bool GetIsOpen(); + void SetText(const char* text); + std::string GetText() const; + FontId GetFontId() const; void SetFontId(FontId font_id); diff --git a/cpp/open3d/visualization/gui/ListView.cpp b/cpp/open3d/visualization/gui/ListView.cpp index 94ba7e8cf9d..3234f5187f6 100644 --- a/cpp/open3d/visualization/gui/ListView.cpp +++ b/cpp/open3d/visualization/gui/ListView.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/ListView.h b/cpp/open3d/visualization/gui/ListView.h index ac764be0974..c94cbbcf14f 100644 --- a/cpp/open3d/visualization/gui/ListView.h +++ b/cpp/open3d/visualization/gui/ListView.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Menu.cpp b/cpp/open3d/visualization/gui/Menu.cpp index 7c0e19e9eeb..1c340bdc178 100644 --- a/cpp/open3d/visualization/gui/Menu.cpp +++ b/cpp/open3d/visualization/gui/Menu.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Menu.h b/cpp/open3d/visualization/gui/Menu.h index 9efecd370b9..80381e99387 100644 --- a/cpp/open3d/visualization/gui/Menu.h +++ b/cpp/open3d/visualization/gui/Menu.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/MenuBase.h b/cpp/open3d/visualization/gui/MenuBase.h index f4ecebdf042..29c2f5a9776 100644 --- a/cpp/open3d/visualization/gui/MenuBase.h +++ b/cpp/open3d/visualization/gui/MenuBase.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/MenuImgui.cpp b/cpp/open3d/visualization/gui/MenuImgui.cpp index aba98ddb19c..430aedbd1db 100644 --- a/cpp/open3d/visualization/gui/MenuImgui.cpp +++ b/cpp/open3d/visualization/gui/MenuImgui.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/MenuImgui.h b/cpp/open3d/visualization/gui/MenuImgui.h index 01fc324cd71..b3d9e410941 100644 --- a/cpp/open3d/visualization/gui/MenuImgui.h +++ b/cpp/open3d/visualization/gui/MenuImgui.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/MenuMacOS.h b/cpp/open3d/visualization/gui/MenuMacOS.h index 6b1a8f277ab..b1b9132e00a 100644 --- a/cpp/open3d/visualization/gui/MenuMacOS.h +++ b/cpp/open3d/visualization/gui/MenuMacOS.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/MenuMacOS.mm b/cpp/open3d/visualization/gui/MenuMacOS.mm index 0f958d15f6c..3e0a553584b 100644 --- a/cpp/open3d/visualization/gui/MenuMacOS.mm +++ b/cpp/open3d/visualization/gui/MenuMacOS.mm @@ -1,27 +1,8 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// The MIT License (MIT) -// -// Copyright (c) 2018-2023 www.open3d.org -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. +// Copyright (c) 2018-2024 www.open3d.org +// SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- #include "open3d/visualization/gui/MenuMacOS.h" diff --git a/cpp/open3d/visualization/gui/Native.h b/cpp/open3d/visualization/gui/Native.h index 1ad03de99df..e8b93f74690 100644 --- a/cpp/open3d/visualization/gui/Native.h +++ b/cpp/open3d/visualization/gui/Native.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/NativeLinux.cpp b/cpp/open3d/visualization/gui/NativeLinux.cpp index d6a64f1068c..89768633b9f 100644 --- a/cpp/open3d/visualization/gui/NativeLinux.cpp +++ b/cpp/open3d/visualization/gui/NativeLinux.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/NativeMacOS.mm b/cpp/open3d/visualization/gui/NativeMacOS.mm index 5803f731286..907731f3dda 100644 --- a/cpp/open3d/visualization/gui/NativeMacOS.mm +++ b/cpp/open3d/visualization/gui/NativeMacOS.mm @@ -1,27 +1,8 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// The MIT License (MIT) -// -// Copyright (c) 2018-2023 www.open3d.org -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. +// Copyright (c) 2018-2024 www.open3d.org +// SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- #include "open3d/visualization/gui/Native.h" diff --git a/cpp/open3d/visualization/gui/NativeWin32.cpp b/cpp/open3d/visualization/gui/NativeWin32.cpp index 17918030e68..42c2f48b1e0 100644 --- a/cpp/open3d/visualization/gui/NativeWin32.cpp +++ b/cpp/open3d/visualization/gui/NativeWin32.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/NumberEdit.cpp b/cpp/open3d/visualization/gui/NumberEdit.cpp index 46bcfaa81d1..9f59d3dff02 100644 --- a/cpp/open3d/visualization/gui/NumberEdit.cpp +++ b/cpp/open3d/visualization/gui/NumberEdit.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/NumberEdit.h b/cpp/open3d/visualization/gui/NumberEdit.h index 3a86f97d3c3..04403bc030e 100644 --- a/cpp/open3d/visualization/gui/NumberEdit.h +++ b/cpp/open3d/visualization/gui/NumberEdit.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/PickPointsInteractor.cpp b/cpp/open3d/visualization/gui/PickPointsInteractor.cpp index 63ecfba7955..78c76179550 100644 --- a/cpp/open3d/visualization/gui/PickPointsInteractor.cpp +++ b/cpp/open3d/visualization/gui/PickPointsInteractor.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/PickPointsInteractor.h b/cpp/open3d/visualization/gui/PickPointsInteractor.h index dd2e2646fba..9d173c4ad94 100644 --- a/cpp/open3d/visualization/gui/PickPointsInteractor.h +++ b/cpp/open3d/visualization/gui/PickPointsInteractor.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/ProgressBar.cpp b/cpp/open3d/visualization/gui/ProgressBar.cpp index 0c930155a41..06b47c89278 100644 --- a/cpp/open3d/visualization/gui/ProgressBar.cpp +++ b/cpp/open3d/visualization/gui/ProgressBar.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/ProgressBar.h b/cpp/open3d/visualization/gui/ProgressBar.h index 5b86162022c..898c4a05af8 100644 --- a/cpp/open3d/visualization/gui/ProgressBar.h +++ b/cpp/open3d/visualization/gui/ProgressBar.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/RadioButton.cpp b/cpp/open3d/visualization/gui/RadioButton.cpp index 0c26b63ccff..e3eac680d3d 100644 --- a/cpp/open3d/visualization/gui/RadioButton.cpp +++ b/cpp/open3d/visualization/gui/RadioButton.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/RadioButton.h b/cpp/open3d/visualization/gui/RadioButton.h index c9f3021a032..d111efca1bf 100644 --- a/cpp/open3d/visualization/gui/RadioButton.h +++ b/cpp/open3d/visualization/gui/RadioButton.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/SceneWidget.cpp b/cpp/open3d/visualization/gui/SceneWidget.cpp index fe03ec73a7f..d0df7af860e 100644 --- a/cpp/open3d/visualization/gui/SceneWidget.cpp +++ b/cpp/open3d/visualization/gui/SceneWidget.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/SceneWidget.h b/cpp/open3d/visualization/gui/SceneWidget.h index 233c7918c01..3d9941cde42 100644 --- a/cpp/open3d/visualization/gui/SceneWidget.h +++ b/cpp/open3d/visualization/gui/SceneWidget.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Slider.cpp b/cpp/open3d/visualization/gui/Slider.cpp index 04267113377..425579c5a13 100644 --- a/cpp/open3d/visualization/gui/Slider.cpp +++ b/cpp/open3d/visualization/gui/Slider.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Slider.h b/cpp/open3d/visualization/gui/Slider.h index 5ad3c263e5a..0c81d41cb14 100644 --- a/cpp/open3d/visualization/gui/Slider.h +++ b/cpp/open3d/visualization/gui/Slider.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/StackedWidget.cpp b/cpp/open3d/visualization/gui/StackedWidget.cpp index 4bbca165aef..0e68dddaaca 100644 --- a/cpp/open3d/visualization/gui/StackedWidget.cpp +++ b/cpp/open3d/visualization/gui/StackedWidget.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/StackedWidget.h b/cpp/open3d/visualization/gui/StackedWidget.h index 455b1be11e1..13ed1f70d80 100644 --- a/cpp/open3d/visualization/gui/StackedWidget.h +++ b/cpp/open3d/visualization/gui/StackedWidget.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/TabControl.cpp b/cpp/open3d/visualization/gui/TabControl.cpp index baf516337af..81188b090c2 100644 --- a/cpp/open3d/visualization/gui/TabControl.cpp +++ b/cpp/open3d/visualization/gui/TabControl.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/TabControl.h b/cpp/open3d/visualization/gui/TabControl.h index 3912ec8f119..af6cae30c7a 100644 --- a/cpp/open3d/visualization/gui/TabControl.h +++ b/cpp/open3d/visualization/gui/TabControl.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Task.cpp b/cpp/open3d/visualization/gui/Task.cpp index 075fb2f30de..79dde9eb552 100644 --- a/cpp/open3d/visualization/gui/Task.cpp +++ b/cpp/open3d/visualization/gui/Task.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Task.h b/cpp/open3d/visualization/gui/Task.h index c58080fdca6..3007f6680e5 100644 --- a/cpp/open3d/visualization/gui/Task.h +++ b/cpp/open3d/visualization/gui/Task.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/TextEdit.cpp b/cpp/open3d/visualization/gui/TextEdit.cpp index 13f859908ad..d720e1bb511 100644 --- a/cpp/open3d/visualization/gui/TextEdit.cpp +++ b/cpp/open3d/visualization/gui/TextEdit.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/TextEdit.h b/cpp/open3d/visualization/gui/TextEdit.h index 1e1ca5a2952..c94fd5305ba 100644 --- a/cpp/open3d/visualization/gui/TextEdit.h +++ b/cpp/open3d/visualization/gui/TextEdit.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Theme.cpp b/cpp/open3d/visualization/gui/Theme.cpp index e1736901835..e59f1027228 100644 --- a/cpp/open3d/visualization/gui/Theme.cpp +++ b/cpp/open3d/visualization/gui/Theme.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Theme.h b/cpp/open3d/visualization/gui/Theme.h index d00366bcd45..0ef630abf4f 100644 --- a/cpp/open3d/visualization/gui/Theme.h +++ b/cpp/open3d/visualization/gui/Theme.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/ToggleSwitch.cpp b/cpp/open3d/visualization/gui/ToggleSwitch.cpp index 24bc4f011dd..16c843f5fb1 100644 --- a/cpp/open3d/visualization/gui/ToggleSwitch.cpp +++ b/cpp/open3d/visualization/gui/ToggleSwitch.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/ToggleSwitch.h b/cpp/open3d/visualization/gui/ToggleSwitch.h index a1214635377..2b0aa5bf90c 100644 --- a/cpp/open3d/visualization/gui/ToggleSwitch.h +++ b/cpp/open3d/visualization/gui/ToggleSwitch.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/TreeView.cpp b/cpp/open3d/visualization/gui/TreeView.cpp index 19f934915f4..72fca10bd0e 100644 --- a/cpp/open3d/visualization/gui/TreeView.cpp +++ b/cpp/open3d/visualization/gui/TreeView.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/TreeView.h b/cpp/open3d/visualization/gui/TreeView.h index 176544f49ab..956f896149e 100644 --- a/cpp/open3d/visualization/gui/TreeView.h +++ b/cpp/open3d/visualization/gui/TreeView.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/UIImage.cpp b/cpp/open3d/visualization/gui/UIImage.cpp index 8932227fa65..561d9a15c3f 100644 --- a/cpp/open3d/visualization/gui/UIImage.cpp +++ b/cpp/open3d/visualization/gui/UIImage.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/UIImage.h b/cpp/open3d/visualization/gui/UIImage.h index 235ff3d44bd..f95327b9d14 100644 --- a/cpp/open3d/visualization/gui/UIImage.h +++ b/cpp/open3d/visualization/gui/UIImage.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Util.cpp b/cpp/open3d/visualization/gui/Util.cpp index 123d1485507..05f4e49f190 100644 --- a/cpp/open3d/visualization/gui/Util.cpp +++ b/cpp/open3d/visualization/gui/Util.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Util.h b/cpp/open3d/visualization/gui/Util.h index 375933bd6dd..a7c7ead2909 100644 --- a/cpp/open3d/visualization/gui/Util.h +++ b/cpp/open3d/visualization/gui/Util.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/VectorEdit.cpp b/cpp/open3d/visualization/gui/VectorEdit.cpp index e2fccbb870e..646dd5bc602 100644 --- a/cpp/open3d/visualization/gui/VectorEdit.cpp +++ b/cpp/open3d/visualization/gui/VectorEdit.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/VectorEdit.h b/cpp/open3d/visualization/gui/VectorEdit.h index c92f7519d80..6ed6e718092 100644 --- a/cpp/open3d/visualization/gui/VectorEdit.h +++ b/cpp/open3d/visualization/gui/VectorEdit.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Widget.cpp b/cpp/open3d/visualization/gui/Widget.cpp index 2b577a4c809..d8ab028acda 100644 --- a/cpp/open3d/visualization/gui/Widget.cpp +++ b/cpp/open3d/visualization/gui/Widget.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Widget.h b/cpp/open3d/visualization/gui/Widget.h index 26a743c9258..a3fc46ac723 100644 --- a/cpp/open3d/visualization/gui/Widget.h +++ b/cpp/open3d/visualization/gui/Widget.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/WidgetProxy.cpp b/cpp/open3d/visualization/gui/WidgetProxy.cpp index 00ffc1522de..2ab2de2cd3a 100644 --- a/cpp/open3d/visualization/gui/WidgetProxy.cpp +++ b/cpp/open3d/visualization/gui/WidgetProxy.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/WidgetProxy.h b/cpp/open3d/visualization/gui/WidgetProxy.h index 30132ee506f..13389917300 100644 --- a/cpp/open3d/visualization/gui/WidgetProxy.h +++ b/cpp/open3d/visualization/gui/WidgetProxy.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/WidgetStack.cpp b/cpp/open3d/visualization/gui/WidgetStack.cpp index 5a7675b5fce..ac6ea6bc135 100644 --- a/cpp/open3d/visualization/gui/WidgetStack.cpp +++ b/cpp/open3d/visualization/gui/WidgetStack.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/WidgetStack.h b/cpp/open3d/visualization/gui/WidgetStack.h index 560539d45a3..4e591131a8a 100644 --- a/cpp/open3d/visualization/gui/WidgetStack.h +++ b/cpp/open3d/visualization/gui/WidgetStack.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Window.cpp b/cpp/open3d/visualization/gui/Window.cpp index bb023903792..3c9f2a315c5 100644 --- a/cpp/open3d/visualization/gui/Window.cpp +++ b/cpp/open3d/visualization/gui/Window.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/Window.h b/cpp/open3d/visualization/gui/Window.h index b186d760699..78e366329c5 100644 --- a/cpp/open3d/visualization/gui/Window.h +++ b/cpp/open3d/visualization/gui/Window.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/gui/WindowSystem.h b/cpp/open3d/visualization/gui/WindowSystem.h index 682e732acb7..f77ce15886f 100644 --- a/cpp/open3d/visualization/gui/WindowSystem.h +++ b/cpp/open3d/visualization/gui/WindowSystem.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/Camera.cpp b/cpp/open3d/visualization/rendering/Camera.cpp index 0b0fac15654..071a36e9e0f 100644 --- a/cpp/open3d/visualization/rendering/Camera.cpp +++ b/cpp/open3d/visualization/rendering/Camera.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/Camera.h b/cpp/open3d/visualization/rendering/Camera.h index 136d1e5f743..d1502ba7553 100644 --- a/cpp/open3d/visualization/rendering/Camera.h +++ b/cpp/open3d/visualization/rendering/Camera.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/CameraInteractorLogic.cpp b/cpp/open3d/visualization/rendering/CameraInteractorLogic.cpp index 1b4f2b5e10e..bc934303239 100644 --- a/cpp/open3d/visualization/rendering/CameraInteractorLogic.cpp +++ b/cpp/open3d/visualization/rendering/CameraInteractorLogic.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/CameraInteractorLogic.h b/cpp/open3d/visualization/rendering/CameraInteractorLogic.h index 5e80e4336bc..ea066c30073 100644 --- a/cpp/open3d/visualization/rendering/CameraInteractorLogic.h +++ b/cpp/open3d/visualization/rendering/CameraInteractorLogic.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/CameraSphereInteractorLogic.cpp b/cpp/open3d/visualization/rendering/CameraSphereInteractorLogic.cpp index 366fea30550..31e88338c7d 100644 --- a/cpp/open3d/visualization/rendering/CameraSphereInteractorLogic.cpp +++ b/cpp/open3d/visualization/rendering/CameraSphereInteractorLogic.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/CameraSphereInteractorLogic.h b/cpp/open3d/visualization/rendering/CameraSphereInteractorLogic.h index a2e8e67516f..0d92abbd57f 100644 --- a/cpp/open3d/visualization/rendering/CameraSphereInteractorLogic.h +++ b/cpp/open3d/visualization/rendering/CameraSphereInteractorLogic.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/ColorGrading.cpp b/cpp/open3d/visualization/rendering/ColorGrading.cpp index a7bd647965d..a10bb9f5b97 100644 --- a/cpp/open3d/visualization/rendering/ColorGrading.cpp +++ b/cpp/open3d/visualization/rendering/ColorGrading.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/ColorGrading.h b/cpp/open3d/visualization/rendering/ColorGrading.h index 7df7c8dde1f..4db57db4bef 100644 --- a/cpp/open3d/visualization/rendering/ColorGrading.h +++ b/cpp/open3d/visualization/rendering/ColorGrading.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/Gradient.cpp b/cpp/open3d/visualization/rendering/Gradient.cpp index 04c6e287d4e..6a0d312003c 100644 --- a/cpp/open3d/visualization/rendering/Gradient.cpp +++ b/cpp/open3d/visualization/rendering/Gradient.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/Gradient.h b/cpp/open3d/visualization/rendering/Gradient.h index 6c1b9f07401..74ad5398664 100644 --- a/cpp/open3d/visualization/rendering/Gradient.h +++ b/cpp/open3d/visualization/rendering/Gradient.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/IBLRotationInteractorLogic.cpp b/cpp/open3d/visualization/rendering/IBLRotationInteractorLogic.cpp index cbd6c511f06..b5d902dba7f 100644 --- a/cpp/open3d/visualization/rendering/IBLRotationInteractorLogic.cpp +++ b/cpp/open3d/visualization/rendering/IBLRotationInteractorLogic.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/IBLRotationInteractorLogic.h b/cpp/open3d/visualization/rendering/IBLRotationInteractorLogic.h index 10f33876bbe..bcac90a3053 100644 --- a/cpp/open3d/visualization/rendering/IBLRotationInteractorLogic.h +++ b/cpp/open3d/visualization/rendering/IBLRotationInteractorLogic.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/Light.h b/cpp/open3d/visualization/rendering/Light.h index f0ca0a460c4..5538073b5f8 100644 --- a/cpp/open3d/visualization/rendering/Light.h +++ b/cpp/open3d/visualization/rendering/Light.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/LightDirectionInteractorLogic.cpp b/cpp/open3d/visualization/rendering/LightDirectionInteractorLogic.cpp index ab0d2cd1e42..ed840aea16d 100644 --- a/cpp/open3d/visualization/rendering/LightDirectionInteractorLogic.cpp +++ b/cpp/open3d/visualization/rendering/LightDirectionInteractorLogic.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/LightDirectionInteractorLogic.h b/cpp/open3d/visualization/rendering/LightDirectionInteractorLogic.h index 22bd97ba87b..92a22052248 100644 --- a/cpp/open3d/visualization/rendering/LightDirectionInteractorLogic.h +++ b/cpp/open3d/visualization/rendering/LightDirectionInteractorLogic.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/Material.cpp b/cpp/open3d/visualization/rendering/Material.cpp index d264711f987..321ea13ebd7 100644 --- a/cpp/open3d/visualization/rendering/Material.cpp +++ b/cpp/open3d/visualization/rendering/Material.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/Material.h b/cpp/open3d/visualization/rendering/Material.h index 27afcd8a69a..2eeddcafc6a 100644 --- a/cpp/open3d/visualization/rendering/Material.h +++ b/cpp/open3d/visualization/rendering/Material.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/MaterialModifier.cpp b/cpp/open3d/visualization/rendering/MaterialModifier.cpp index c7490f3b888..77b560d0a13 100644 --- a/cpp/open3d/visualization/rendering/MaterialModifier.cpp +++ b/cpp/open3d/visualization/rendering/MaterialModifier.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/MaterialModifier.h b/cpp/open3d/visualization/rendering/MaterialModifier.h index 7c4a87bab03..e9cc11eaa24 100644 --- a/cpp/open3d/visualization/rendering/MaterialModifier.h +++ b/cpp/open3d/visualization/rendering/MaterialModifier.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/MaterialRecord.h b/cpp/open3d/visualization/rendering/MaterialRecord.h index 987099f1816..6822cbaf1ff 100644 --- a/cpp/open3d/visualization/rendering/MaterialRecord.h +++ b/cpp/open3d/visualization/rendering/MaterialRecord.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/MatrixInteractorLogic.cpp b/cpp/open3d/visualization/rendering/MatrixInteractorLogic.cpp index f61e4628217..bf547fe7d4e 100644 --- a/cpp/open3d/visualization/rendering/MatrixInteractorLogic.cpp +++ b/cpp/open3d/visualization/rendering/MatrixInteractorLogic.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/MatrixInteractorLogic.h b/cpp/open3d/visualization/rendering/MatrixInteractorLogic.h index c8976fc43cf..7457c579e8b 100644 --- a/cpp/open3d/visualization/rendering/MatrixInteractorLogic.h +++ b/cpp/open3d/visualization/rendering/MatrixInteractorLogic.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/Model.h b/cpp/open3d/visualization/rendering/Model.h index 68ad6d4f5ed..070cecd1e28 100644 --- a/cpp/open3d/visualization/rendering/Model.h +++ b/cpp/open3d/visualization/rendering/Model.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/ModelInteractorLogic.cpp b/cpp/open3d/visualization/rendering/ModelInteractorLogic.cpp index 8814200627a..b6d3331aad4 100644 --- a/cpp/open3d/visualization/rendering/ModelInteractorLogic.cpp +++ b/cpp/open3d/visualization/rendering/ModelInteractorLogic.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/ModelInteractorLogic.h b/cpp/open3d/visualization/rendering/ModelInteractorLogic.h index e072d9ea336..7c5781f84cc 100644 --- a/cpp/open3d/visualization/rendering/ModelInteractorLogic.h +++ b/cpp/open3d/visualization/rendering/ModelInteractorLogic.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/Open3DScene.cpp b/cpp/open3d/visualization/rendering/Open3DScene.cpp index dacd926ec1f..c0142da8fb2 100644 --- a/cpp/open3d/visualization/rendering/Open3DScene.cpp +++ b/cpp/open3d/visualization/rendering/Open3DScene.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/Open3DScene.h b/cpp/open3d/visualization/rendering/Open3DScene.h index 28e7bdb36e2..5c3e0dce8f8 100644 --- a/cpp/open3d/visualization/rendering/Open3DScene.h +++ b/cpp/open3d/visualization/rendering/Open3DScene.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/RenderToBuffer.h b/cpp/open3d/visualization/rendering/RenderToBuffer.h index ee124a63859..97265e66ed7 100644 --- a/cpp/open3d/visualization/rendering/RenderToBuffer.h +++ b/cpp/open3d/visualization/rendering/RenderToBuffer.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/Renderer.cpp b/cpp/open3d/visualization/rendering/Renderer.cpp index 7ccf91a876b..78eae53f981 100644 --- a/cpp/open3d/visualization/rendering/Renderer.cpp +++ b/cpp/open3d/visualization/rendering/Renderer.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/Renderer.h b/cpp/open3d/visualization/rendering/Renderer.h index b642e4b6d46..fc787662103 100644 --- a/cpp/open3d/visualization/rendering/Renderer.h +++ b/cpp/open3d/visualization/rendering/Renderer.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/RendererHandle.cpp b/cpp/open3d/visualization/rendering/RendererHandle.cpp index 127606f7dd5..42d150788a7 100644 --- a/cpp/open3d/visualization/rendering/RendererHandle.cpp +++ b/cpp/open3d/visualization/rendering/RendererHandle.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/RendererHandle.h b/cpp/open3d/visualization/rendering/RendererHandle.h index dc8b06382e7..8f328accb51 100644 --- a/cpp/open3d/visualization/rendering/RendererHandle.h +++ b/cpp/open3d/visualization/rendering/RendererHandle.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -164,7 +164,7 @@ struct formatter< char>> { template auto format(const open3d::visualization::rendering::REHandle_abstract& uid, - FormatContext& ctx) -> decltype(ctx.out()) { + FormatContext& ctx) const -> decltype(ctx.out()) { return format_to(ctx.out(), "[{}, {}, hash: {}]", open3d::visualization::rendering::REHandle_abstract:: TypeToString(uid.type), diff --git a/cpp/open3d/visualization/rendering/RendererStructs.h b/cpp/open3d/visualization/rendering/RendererStructs.h index e07901c9ac0..e1b053a72a6 100644 --- a/cpp/open3d/visualization/rendering/RendererStructs.h +++ b/cpp/open3d/visualization/rendering/RendererStructs.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/RotationInteractorLogic.cpp b/cpp/open3d/visualization/rendering/RotationInteractorLogic.cpp index e909412b846..f311ce1e841 100644 --- a/cpp/open3d/visualization/rendering/RotationInteractorLogic.cpp +++ b/cpp/open3d/visualization/rendering/RotationInteractorLogic.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/RotationInteractorLogic.h b/cpp/open3d/visualization/rendering/RotationInteractorLogic.h index 1371950cff8..9b108ea102d 100644 --- a/cpp/open3d/visualization/rendering/RotationInteractorLogic.h +++ b/cpp/open3d/visualization/rendering/RotationInteractorLogic.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/Scene.h b/cpp/open3d/visualization/rendering/Scene.h index 75578f39f89..cbf9eb3efb4 100644 --- a/cpp/open3d/visualization/rendering/Scene.h +++ b/cpp/open3d/visualization/rendering/Scene.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/View.h b/cpp/open3d/visualization/rendering/View.h index f9a586b59fc..cd29b6a4df2 100644 --- a/cpp/open3d/visualization/rendering/View.h +++ b/cpp/open3d/visualization/rendering/View.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/filament/FilamentCamera.cpp b/cpp/open3d/visualization/rendering/filament/FilamentCamera.cpp index 31f8572392e..553bfe91815 100644 --- a/cpp/open3d/visualization/rendering/filament/FilamentCamera.cpp +++ b/cpp/open3d/visualization/rendering/filament/FilamentCamera.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/filament/FilamentCamera.h b/cpp/open3d/visualization/rendering/filament/FilamentCamera.h index 29d30249257..90da81a245e 100644 --- a/cpp/open3d/visualization/rendering/filament/FilamentCamera.h +++ b/cpp/open3d/visualization/rendering/filament/FilamentCamera.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/filament/FilamentEngine.cpp b/cpp/open3d/visualization/rendering/filament/FilamentEngine.cpp index f3d03ebec40..f90b00d5a03 100644 --- a/cpp/open3d/visualization/rendering/filament/FilamentEngine.cpp +++ b/cpp/open3d/visualization/rendering/filament/FilamentEngine.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/filament/FilamentEngine.h b/cpp/open3d/visualization/rendering/filament/FilamentEngine.h index 834acca20b8..f270279ff97 100644 --- a/cpp/open3d/visualization/rendering/filament/FilamentEngine.h +++ b/cpp/open3d/visualization/rendering/filament/FilamentEngine.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/filament/FilamentEntitiesMods.cpp b/cpp/open3d/visualization/rendering/filament/FilamentEntitiesMods.cpp index feadc341780..68fa808b8b3 100644 --- a/cpp/open3d/visualization/rendering/filament/FilamentEntitiesMods.cpp +++ b/cpp/open3d/visualization/rendering/filament/FilamentEntitiesMods.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/filament/FilamentEntitiesMods.h b/cpp/open3d/visualization/rendering/filament/FilamentEntitiesMods.h index ea99c2fa145..80fa1971f3e 100644 --- a/cpp/open3d/visualization/rendering/filament/FilamentEntitiesMods.h +++ b/cpp/open3d/visualization/rendering/filament/FilamentEntitiesMods.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/filament/FilamentGeometryBuffersBuilder.cpp b/cpp/open3d/visualization/rendering/filament/FilamentGeometryBuffersBuilder.cpp index fc2c40ea1b2..fe3dbd39bf7 100644 --- a/cpp/open3d/visualization/rendering/filament/FilamentGeometryBuffersBuilder.cpp +++ b/cpp/open3d/visualization/rendering/filament/FilamentGeometryBuffersBuilder.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/filament/FilamentGeometryBuffersBuilder.h b/cpp/open3d/visualization/rendering/filament/FilamentGeometryBuffersBuilder.h index 0d6271c8894..afaa4a84831 100644 --- a/cpp/open3d/visualization/rendering/filament/FilamentGeometryBuffersBuilder.h +++ b/cpp/open3d/visualization/rendering/filament/FilamentGeometryBuffersBuilder.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/filament/FilamentRenderToBuffer.cpp b/cpp/open3d/visualization/rendering/filament/FilamentRenderToBuffer.cpp index cb5525754e9..27e758deddb 100644 --- a/cpp/open3d/visualization/rendering/filament/FilamentRenderToBuffer.cpp +++ b/cpp/open3d/visualization/rendering/filament/FilamentRenderToBuffer.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -144,6 +144,10 @@ void FilamentRenderToBuffer::CopySettings(const View* view) { // overhead and the depth buffer is discarded when post-processing is // enabled so the returned image is all 0s. view_->ConfigureForColorPicking(); + // Set shadowing to true as there is a pixel coordinate scaling + // issue on Apple Retina displays that results in quarter size depth + // images if shadowing is disabled. + view_->SetShadowing(true, View::ShadowType::kPCF); } } diff --git a/cpp/open3d/visualization/rendering/filament/FilamentRenderToBuffer.h b/cpp/open3d/visualization/rendering/filament/FilamentRenderToBuffer.h index cf19fd9c01c..3817b27e96b 100644 --- a/cpp/open3d/visualization/rendering/filament/FilamentRenderToBuffer.h +++ b/cpp/open3d/visualization/rendering/filament/FilamentRenderToBuffer.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/filament/FilamentRenderer.cpp b/cpp/open3d/visualization/rendering/filament/FilamentRenderer.cpp index e7ea9771cae..8600de2db4f 100644 --- a/cpp/open3d/visualization/rendering/filament/FilamentRenderer.cpp +++ b/cpp/open3d/visualization/rendering/filament/FilamentRenderer.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/filament/FilamentRenderer.h b/cpp/open3d/visualization/rendering/filament/FilamentRenderer.h index 097f341108d..8c89cfd0a80 100644 --- a/cpp/open3d/visualization/rendering/filament/FilamentRenderer.h +++ b/cpp/open3d/visualization/rendering/filament/FilamentRenderer.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/filament/FilamentResourceManager.cpp b/cpp/open3d/visualization/rendering/filament/FilamentResourceManager.cpp index 1dcf1715368..baee308e93c 100644 --- a/cpp/open3d/visualization/rendering/filament/FilamentResourceManager.cpp +++ b/cpp/open3d/visualization/rendering/filament/FilamentResourceManager.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/filament/FilamentResourceManager.h b/cpp/open3d/visualization/rendering/filament/FilamentResourceManager.h index 606d590f447..d3a6716bbab 100644 --- a/cpp/open3d/visualization/rendering/filament/FilamentResourceManager.h +++ b/cpp/open3d/visualization/rendering/filament/FilamentResourceManager.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/filament/FilamentScene.cpp b/cpp/open3d/visualization/rendering/filament/FilamentScene.cpp index 64dffe9dc69..ecb6c5c89c0 100644 --- a/cpp/open3d/visualization/rendering/filament/FilamentScene.cpp +++ b/cpp/open3d/visualization/rendering/filament/FilamentScene.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -590,7 +590,7 @@ void FilamentScene::UpdateGeometry(const std::string& object_name, const size_t color_array_size = n_vertices * 3 * sizeof(float); if (pcloud_is_gpu) { auto color_data = static_cast(malloc(color_array_size)); - memcpy(color_data, cpu_pcloud.GetPointPositions().GetDataPtr(), + memcpy(color_data, cpu_pcloud.GetPointColors().GetDataPtr(), color_array_size); filament::VertexBuffer::BufferDescriptor color_descriptor( color_data, color_array_size, DeallocateBuffer); diff --git a/cpp/open3d/visualization/rendering/filament/FilamentScene.h b/cpp/open3d/visualization/rendering/filament/FilamentScene.h index f956d7c5888..4556f895441 100644 --- a/cpp/open3d/visualization/rendering/filament/FilamentScene.h +++ b/cpp/open3d/visualization/rendering/filament/FilamentScene.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/filament/FilamentView.cpp b/cpp/open3d/visualization/rendering/filament/FilamentView.cpp index 2a11feff3f0..8022905dd10 100644 --- a/cpp/open3d/visualization/rendering/filament/FilamentView.cpp +++ b/cpp/open3d/visualization/rendering/filament/FilamentView.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/filament/FilamentView.h b/cpp/open3d/visualization/rendering/filament/FilamentView.h index 8af6b63d9a6..792e0d2c149 100644 --- a/cpp/open3d/visualization/rendering/filament/FilamentView.h +++ b/cpp/open3d/visualization/rendering/filament/FilamentView.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/filament/LineSetBuffers.cpp b/cpp/open3d/visualization/rendering/filament/LineSetBuffers.cpp index 88d5230556f..2e14cfbca48 100644 --- a/cpp/open3d/visualization/rendering/filament/LineSetBuffers.cpp +++ b/cpp/open3d/visualization/rendering/filament/LineSetBuffers.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/filament/PointCloudBuffers.cpp b/cpp/open3d/visualization/rendering/filament/PointCloudBuffers.cpp index 014d4b0562a..2d0c1295ed6 100644 --- a/cpp/open3d/visualization/rendering/filament/PointCloudBuffers.cpp +++ b/cpp/open3d/visualization/rendering/filament/PointCloudBuffers.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/rendering/filament/TriangleMeshBuffers.cpp b/cpp/open3d/visualization/rendering/filament/TriangleMeshBuffers.cpp index a3edcccd540..776e7011191 100644 --- a/cpp/open3d/visualization/rendering/filament/TriangleMeshBuffers.cpp +++ b/cpp/open3d/visualization/rendering/filament/TriangleMeshBuffers.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/shader/GeometryRenderer.cpp b/cpp/open3d/visualization/shader/GeometryRenderer.cpp index 9725103d080..fb24a822ebf 100644 --- a/cpp/open3d/visualization/shader/GeometryRenderer.cpp +++ b/cpp/open3d/visualization/shader/GeometryRenderer.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/shader/GeometryRenderer.h b/cpp/open3d/visualization/shader/GeometryRenderer.h index 21230eab20f..5952c6a3e48 100644 --- a/cpp/open3d/visualization/shader/GeometryRenderer.h +++ b/cpp/open3d/visualization/shader/GeometryRenderer.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/shader/ImageMaskShader.cpp b/cpp/open3d/visualization/shader/ImageMaskShader.cpp index a63046e0dd6..9bfbeb57e89 100644 --- a/cpp/open3d/visualization/shader/ImageMaskShader.cpp +++ b/cpp/open3d/visualization/shader/ImageMaskShader.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/shader/ImageMaskShader.h b/cpp/open3d/visualization/shader/ImageMaskShader.h index c5ed2239ff0..c549525fd49 100644 --- a/cpp/open3d/visualization/shader/ImageMaskShader.h +++ b/cpp/open3d/visualization/shader/ImageMaskShader.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/shader/ImageShader.cpp b/cpp/open3d/visualization/shader/ImageShader.cpp index ed9c952028e..9f3baffc586 100644 --- a/cpp/open3d/visualization/shader/ImageShader.cpp +++ b/cpp/open3d/visualization/shader/ImageShader.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/shader/ImageShader.h b/cpp/open3d/visualization/shader/ImageShader.h index 9b5d78ac717..e6340ca5232 100644 --- a/cpp/open3d/visualization/shader/ImageShader.h +++ b/cpp/open3d/visualization/shader/ImageShader.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/shader/NormalShader.cpp b/cpp/open3d/visualization/shader/NormalShader.cpp index 46fc78a7c83..33ffe9d3400 100644 --- a/cpp/open3d/visualization/shader/NormalShader.cpp +++ b/cpp/open3d/visualization/shader/NormalShader.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/shader/NormalShader.h b/cpp/open3d/visualization/shader/NormalShader.h index cb0c6a95b13..4f05686554d 100644 --- a/cpp/open3d/visualization/shader/NormalShader.h +++ b/cpp/open3d/visualization/shader/NormalShader.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/shader/PhongShader.cpp b/cpp/open3d/visualization/shader/PhongShader.cpp index 5b4ac86df50..b50694579cd 100644 --- a/cpp/open3d/visualization/shader/PhongShader.cpp +++ b/cpp/open3d/visualization/shader/PhongShader.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/shader/PhongShader.h b/cpp/open3d/visualization/shader/PhongShader.h index d58b68d1bac..9859aee1f8f 100644 --- a/cpp/open3d/visualization/shader/PhongShader.h +++ b/cpp/open3d/visualization/shader/PhongShader.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/shader/PickingShader.cpp b/cpp/open3d/visualization/shader/PickingShader.cpp index d712e3a2af1..2b35b285388 100644 --- a/cpp/open3d/visualization/shader/PickingShader.cpp +++ b/cpp/open3d/visualization/shader/PickingShader.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/shader/PickingShader.h b/cpp/open3d/visualization/shader/PickingShader.h index f76f2314953..040f2c1cbb3 100644 --- a/cpp/open3d/visualization/shader/PickingShader.h +++ b/cpp/open3d/visualization/shader/PickingShader.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/shader/RGBDImageShader.cpp b/cpp/open3d/visualization/shader/RGBDImageShader.cpp index d63c608a601..e311d421542 100644 --- a/cpp/open3d/visualization/shader/RGBDImageShader.cpp +++ b/cpp/open3d/visualization/shader/RGBDImageShader.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/shader/RGBDImageShader.h b/cpp/open3d/visualization/shader/RGBDImageShader.h index 02a83f6da73..642672d28ee 100644 --- a/cpp/open3d/visualization/shader/RGBDImageShader.h +++ b/cpp/open3d/visualization/shader/RGBDImageShader.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/shader/ShaderWrapper.cpp b/cpp/open3d/visualization/shader/ShaderWrapper.cpp index 84f770fc64c..84e35d26f41 100644 --- a/cpp/open3d/visualization/shader/ShaderWrapper.cpp +++ b/cpp/open3d/visualization/shader/ShaderWrapper.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/shader/ShaderWrapper.h b/cpp/open3d/visualization/shader/ShaderWrapper.h index 7f41b9aff23..db053fb80cb 100644 --- a/cpp/open3d/visualization/shader/ShaderWrapper.h +++ b/cpp/open3d/visualization/shader/ShaderWrapper.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/shader/Simple2DShader.cpp b/cpp/open3d/visualization/shader/Simple2DShader.cpp index e96da9acb0e..4a204d0dbf7 100644 --- a/cpp/open3d/visualization/shader/Simple2DShader.cpp +++ b/cpp/open3d/visualization/shader/Simple2DShader.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/shader/Simple2DShader.h b/cpp/open3d/visualization/shader/Simple2DShader.h index 44d147310f2..32fa3e935f1 100644 --- a/cpp/open3d/visualization/shader/Simple2DShader.h +++ b/cpp/open3d/visualization/shader/Simple2DShader.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/shader/SimpleBlackShader.cpp b/cpp/open3d/visualization/shader/SimpleBlackShader.cpp index 48e2a69bdc1..e45d5d1abb1 100644 --- a/cpp/open3d/visualization/shader/SimpleBlackShader.cpp +++ b/cpp/open3d/visualization/shader/SimpleBlackShader.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/shader/SimpleBlackShader.h b/cpp/open3d/visualization/shader/SimpleBlackShader.h index 06384f86d6c..94059ec10bb 100644 --- a/cpp/open3d/visualization/shader/SimpleBlackShader.h +++ b/cpp/open3d/visualization/shader/SimpleBlackShader.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/shader/SimpleShader.cpp b/cpp/open3d/visualization/shader/SimpleShader.cpp index d25bfb3412a..c14db429639 100644 --- a/cpp/open3d/visualization/shader/SimpleShader.cpp +++ b/cpp/open3d/visualization/shader/SimpleShader.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/shader/SimpleShader.h b/cpp/open3d/visualization/shader/SimpleShader.h index 5262f5485ed..e5bd2cbaa23 100644 --- a/cpp/open3d/visualization/shader/SimpleShader.h +++ b/cpp/open3d/visualization/shader/SimpleShader.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/shader/TexturePhongShader.cpp b/cpp/open3d/visualization/shader/TexturePhongShader.cpp index 0c69f18a177..c4256c070a7 100644 --- a/cpp/open3d/visualization/shader/TexturePhongShader.cpp +++ b/cpp/open3d/visualization/shader/TexturePhongShader.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/shader/TexturePhongShader.h b/cpp/open3d/visualization/shader/TexturePhongShader.h index 6f469546808..86ef6e2a94b 100644 --- a/cpp/open3d/visualization/shader/TexturePhongShader.h +++ b/cpp/open3d/visualization/shader/TexturePhongShader.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/shader/TextureSimpleShader.cpp b/cpp/open3d/visualization/shader/TextureSimpleShader.cpp index 7b1b88723da..0e9a428728d 100644 --- a/cpp/open3d/visualization/shader/TextureSimpleShader.cpp +++ b/cpp/open3d/visualization/shader/TextureSimpleShader.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/shader/TextureSimpleShader.h b/cpp/open3d/visualization/shader/TextureSimpleShader.h index 6980beabee8..ae696e24afb 100644 --- a/cpp/open3d/visualization/shader/TextureSimpleShader.h +++ b/cpp/open3d/visualization/shader/TextureSimpleShader.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/utility/ColorMap.cpp b/cpp/open3d/visualization/utility/ColorMap.cpp index cd2f9f02c03..71530c1982a 100644 --- a/cpp/open3d/visualization/utility/ColorMap.cpp +++ b/cpp/open3d/visualization/utility/ColorMap.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/utility/ColorMap.h b/cpp/open3d/visualization/utility/ColorMap.h index 59c6b66b6fe..6f620581a9e 100644 --- a/cpp/open3d/visualization/utility/ColorMap.h +++ b/cpp/open3d/visualization/utility/ColorMap.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/utility/Draw.cpp b/cpp/open3d/visualization/utility/Draw.cpp index fac8b6fe1ec..6bb9e8817af 100644 --- a/cpp/open3d/visualization/utility/Draw.cpp +++ b/cpp/open3d/visualization/utility/Draw.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/utility/Draw.h b/cpp/open3d/visualization/utility/Draw.h index 9a51dffa16a..dba40b3e355 100644 --- a/cpp/open3d/visualization/utility/Draw.h +++ b/cpp/open3d/visualization/utility/Draw.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/utility/DrawGeometry.cpp b/cpp/open3d/visualization/utility/DrawGeometry.cpp index a03c54ead87..e057e393f29 100644 --- a/cpp/open3d/visualization/utility/DrawGeometry.cpp +++ b/cpp/open3d/visualization/utility/DrawGeometry.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/utility/DrawGeometry.h b/cpp/open3d/visualization/utility/DrawGeometry.h index 6650787bc2a..3d55e1e78cb 100644 --- a/cpp/open3d/visualization/utility/DrawGeometry.h +++ b/cpp/open3d/visualization/utility/DrawGeometry.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/utility/GLHelper.cpp b/cpp/open3d/visualization/utility/GLHelper.cpp index c0ab2d992ef..81e1cb3087c 100644 --- a/cpp/open3d/visualization/utility/GLHelper.cpp +++ b/cpp/open3d/visualization/utility/GLHelper.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/utility/GLHelper.h b/cpp/open3d/visualization/utility/GLHelper.h index 02020b75067..76e5eab94a0 100644 --- a/cpp/open3d/visualization/utility/GLHelper.h +++ b/cpp/open3d/visualization/utility/GLHelper.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/utility/PointCloudPicker.cpp b/cpp/open3d/visualization/utility/PointCloudPicker.cpp index 6e43f541e0f..77c8f2f05a3 100644 --- a/cpp/open3d/visualization/utility/PointCloudPicker.cpp +++ b/cpp/open3d/visualization/utility/PointCloudPicker.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/utility/PointCloudPicker.h b/cpp/open3d/visualization/utility/PointCloudPicker.h index 213f935445c..915e65b44e9 100644 --- a/cpp/open3d/visualization/utility/PointCloudPicker.h +++ b/cpp/open3d/visualization/utility/PointCloudPicker.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/utility/SelectionPolygon.cpp b/cpp/open3d/visualization/utility/SelectionPolygon.cpp index d1437b24fe9..227ff55db01 100644 --- a/cpp/open3d/visualization/utility/SelectionPolygon.cpp +++ b/cpp/open3d/visualization/utility/SelectionPolygon.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/utility/SelectionPolygon.h b/cpp/open3d/visualization/utility/SelectionPolygon.h index 4cb778f7e5e..4cdc40cae87 100644 --- a/cpp/open3d/visualization/utility/SelectionPolygon.h +++ b/cpp/open3d/visualization/utility/SelectionPolygon.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/utility/SelectionPolygonVolume.cpp b/cpp/open3d/visualization/utility/SelectionPolygonVolume.cpp index f02472ca6e8..fbbfaa38eeb 100644 --- a/cpp/open3d/visualization/utility/SelectionPolygonVolume.cpp +++ b/cpp/open3d/visualization/utility/SelectionPolygonVolume.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/utility/SelectionPolygonVolume.h b/cpp/open3d/visualization/utility/SelectionPolygonVolume.h index 614058eba3d..c6e6ec87e0f 100644 --- a/cpp/open3d/visualization/utility/SelectionPolygonVolume.h +++ b/cpp/open3d/visualization/utility/SelectionPolygonVolume.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/GuiSettingsModel.cpp b/cpp/open3d/visualization/visualizer/GuiSettingsModel.cpp index 71c5db0ebff..ddb21ff5ba5 100644 --- a/cpp/open3d/visualization/visualizer/GuiSettingsModel.cpp +++ b/cpp/open3d/visualization/visualizer/GuiSettingsModel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/GuiSettingsModel.h b/cpp/open3d/visualization/visualizer/GuiSettingsModel.h index 307ebec9691..cb179a6b51c 100644 --- a/cpp/open3d/visualization/visualizer/GuiSettingsModel.h +++ b/cpp/open3d/visualization/visualizer/GuiSettingsModel.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/GuiSettingsView.cpp b/cpp/open3d/visualization/visualizer/GuiSettingsView.cpp index f9ecd658358..a7d44acc2dd 100644 --- a/cpp/open3d/visualization/visualizer/GuiSettingsView.cpp +++ b/cpp/open3d/visualization/visualizer/GuiSettingsView.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/GuiSettingsView.h b/cpp/open3d/visualization/visualizer/GuiSettingsView.h index 0eab298b8b6..10e81f9fc43 100644 --- a/cpp/open3d/visualization/visualizer/GuiSettingsView.h +++ b/cpp/open3d/visualization/visualizer/GuiSettingsView.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/GuiVisualizer.cpp b/cpp/open3d/visualization/visualizer/GuiVisualizer.cpp index 545ee98001e..62b6b3fca99 100644 --- a/cpp/open3d/visualization/visualizer/GuiVisualizer.cpp +++ b/cpp/open3d/visualization/visualizer/GuiVisualizer.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/GuiVisualizer.h b/cpp/open3d/visualization/visualizer/GuiVisualizer.h index 4f8a0e9087d..7ae59ae22dd 100644 --- a/cpp/open3d/visualization/visualizer/GuiVisualizer.h +++ b/cpp/open3d/visualization/visualizer/GuiVisualizer.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/GuiWidgets.cpp b/cpp/open3d/visualization/visualizer/GuiWidgets.cpp index 3d6ac28ecbd..5cd444afc58 100644 --- a/cpp/open3d/visualization/visualizer/GuiWidgets.cpp +++ b/cpp/open3d/visualization/visualizer/GuiWidgets.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/GuiWidgets.h b/cpp/open3d/visualization/visualizer/GuiWidgets.h index dcc2ef38b71..1ddf304617d 100644 --- a/cpp/open3d/visualization/visualizer/GuiWidgets.h +++ b/cpp/open3d/visualization/visualizer/GuiWidgets.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/MessageProcessor.cpp b/cpp/open3d/visualization/visualizer/MessageProcessor.cpp index ea637efe76a..1300ec915c3 100644 --- a/cpp/open3d/visualization/visualizer/MessageProcessor.cpp +++ b/cpp/open3d/visualization/visualizer/MessageProcessor.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/MessageProcessor.h b/cpp/open3d/visualization/visualizer/MessageProcessor.h index 3525c5e0e30..c75773f1a47 100644 --- a/cpp/open3d/visualization/visualizer/MessageProcessor.h +++ b/cpp/open3d/visualization/visualizer/MessageProcessor.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/O3DVisualizer.cpp b/cpp/open3d/visualization/visualizer/O3DVisualizer.cpp index 554d38b2466..0cf3ce380cb 100644 --- a/cpp/open3d/visualization/visualizer/O3DVisualizer.cpp +++ b/cpp/open3d/visualization/visualizer/O3DVisualizer.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -1706,6 +1706,18 @@ Ctrl-alt-click to polygon select)"; } } + void SetPanelOpen(const std::string &name, bool open) { + if (name == settings.mouse_panel->GetText()) { + settings.mouse_panel->SetIsOpen(open); + } else if (name == settings.scene_panel->GetText()) { + settings.scene_panel->SetIsOpen(open); + } else if (name == settings.light_panel->GetText()) { + settings.light_panel->SetIsOpen(open); + } else if (name == settings.geometries_panel->GetText()) { + settings.geometries_panel->SetIsOpen(open); + } + } + void SetPicking() { if (selections_->GetNumberOfSets() == 0) { NewSelectionSet(); @@ -2446,6 +2458,10 @@ void O3DVisualizer::SetMouseMode(SceneWidget::Controls mode) { impl_->SetMouseMode(mode); } +void O3DVisualizer::SetPanelOpen(const std::string &name, bool open) { + impl_->SetPanelOpen(name, open); +} + void O3DVisualizer::EnableGroup(const std::string &group, bool enable) { impl_->EnableGroup(group, enable); } diff --git a/cpp/open3d/visualization/visualizer/O3DVisualizer.h b/cpp/open3d/visualization/visualizer/O3DVisualizer.h index 4ceec56de76..dcd97e770a9 100644 --- a/cpp/open3d/visualization/visualizer/O3DVisualizer.h +++ b/cpp/open3d/visualization/visualizer/O3DVisualizer.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -175,6 +175,7 @@ class O3DVisualizer : public gui::Window { void SetLineWidth(int line_width); void EnableGroup(const std::string& group, bool enable); void SetMouseMode(gui::SceneWidget::Controls mode); + void SetPanelOpen(const std::string& name, bool open); std::vector GetSelectionSets() const; diff --git a/cpp/open3d/visualization/visualizer/O3DVisualizerSelections.cpp b/cpp/open3d/visualization/visualizer/O3DVisualizerSelections.cpp index ed2370adc3a..e245dda3b23 100644 --- a/cpp/open3d/visualization/visualizer/O3DVisualizerSelections.cpp +++ b/cpp/open3d/visualization/visualizer/O3DVisualizerSelections.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/O3DVisualizerSelections.h b/cpp/open3d/visualization/visualizer/O3DVisualizerSelections.h index 38d4c5898e1..dd1f8eddb43 100644 --- a/cpp/open3d/visualization/visualizer/O3DVisualizerSelections.h +++ b/cpp/open3d/visualization/visualizer/O3DVisualizerSelections.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/RenderOption.cpp b/cpp/open3d/visualization/visualizer/RenderOption.cpp index d4617edff69..1ae831d0400 100644 --- a/cpp/open3d/visualization/visualizer/RenderOption.cpp +++ b/cpp/open3d/visualization/visualizer/RenderOption.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/RenderOption.h b/cpp/open3d/visualization/visualizer/RenderOption.h index 83f22e9bc41..918b339cca4 100644 --- a/cpp/open3d/visualization/visualizer/RenderOption.h +++ b/cpp/open3d/visualization/visualizer/RenderOption.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/RenderOptionWithEditing.cpp b/cpp/open3d/visualization/visualizer/RenderOptionWithEditing.cpp index 3fecb139af9..690e3a8617b 100644 --- a/cpp/open3d/visualization/visualizer/RenderOptionWithEditing.cpp +++ b/cpp/open3d/visualization/visualizer/RenderOptionWithEditing.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/RenderOptionWithEditing.h b/cpp/open3d/visualization/visualizer/RenderOptionWithEditing.h index bd4bf0befdd..9f642f81b10 100644 --- a/cpp/open3d/visualization/visualizer/RenderOptionWithEditing.h +++ b/cpp/open3d/visualization/visualizer/RenderOptionWithEditing.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/ViewControl.cpp b/cpp/open3d/visualization/visualizer/ViewControl.cpp index a4ba2aae314..0f7da7cc892 100644 --- a/cpp/open3d/visualization/visualizer/ViewControl.cpp +++ b/cpp/open3d/visualization/visualizer/ViewControl.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/ViewControl.h b/cpp/open3d/visualization/visualizer/ViewControl.h index 7d438427210..19dd7c7f92b 100644 --- a/cpp/open3d/visualization/visualizer/ViewControl.h +++ b/cpp/open3d/visualization/visualizer/ViewControl.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/ViewControlWithCustomAnimation.cpp b/cpp/open3d/visualization/visualizer/ViewControlWithCustomAnimation.cpp index b176706aece..dc4d9a77408 100644 --- a/cpp/open3d/visualization/visualizer/ViewControlWithCustomAnimation.cpp +++ b/cpp/open3d/visualization/visualizer/ViewControlWithCustomAnimation.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/ViewControlWithCustomAnimation.h b/cpp/open3d/visualization/visualizer/ViewControlWithCustomAnimation.h index 0155ecf80e5..e2fba484dc5 100644 --- a/cpp/open3d/visualization/visualizer/ViewControlWithCustomAnimation.h +++ b/cpp/open3d/visualization/visualizer/ViewControlWithCustomAnimation.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/ViewControlWithEditing.cpp b/cpp/open3d/visualization/visualizer/ViewControlWithEditing.cpp index a11b0ad3eba..3122b4e133b 100644 --- a/cpp/open3d/visualization/visualizer/ViewControlWithEditing.cpp +++ b/cpp/open3d/visualization/visualizer/ViewControlWithEditing.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/ViewControlWithEditing.h b/cpp/open3d/visualization/visualizer/ViewControlWithEditing.h index c1fa57e992d..ae652912051 100644 --- a/cpp/open3d/visualization/visualizer/ViewControlWithEditing.h +++ b/cpp/open3d/visualization/visualizer/ViewControlWithEditing.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/ViewParameters.cpp b/cpp/open3d/visualization/visualizer/ViewParameters.cpp index c3d3dd3f0a7..d80358d2b0f 100644 --- a/cpp/open3d/visualization/visualizer/ViewParameters.cpp +++ b/cpp/open3d/visualization/visualizer/ViewParameters.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/ViewParameters.h b/cpp/open3d/visualization/visualizer/ViewParameters.h index 41541895677..7ee6bb72510 100644 --- a/cpp/open3d/visualization/visualizer/ViewParameters.h +++ b/cpp/open3d/visualization/visualizer/ViewParameters.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/ViewTrajectory.cpp b/cpp/open3d/visualization/visualizer/ViewTrajectory.cpp index e3435b76a71..947c2bb51a1 100644 --- a/cpp/open3d/visualization/visualizer/ViewTrajectory.cpp +++ b/cpp/open3d/visualization/visualizer/ViewTrajectory.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/ViewTrajectory.h b/cpp/open3d/visualization/visualizer/ViewTrajectory.h index e3f93303420..8ce08403164 100644 --- a/cpp/open3d/visualization/visualizer/ViewTrajectory.h +++ b/cpp/open3d/visualization/visualizer/ViewTrajectory.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/Visualizer.cpp b/cpp/open3d/visualization/visualizer/Visualizer.cpp index 216c4898a0a..37b24827e49 100644 --- a/cpp/open3d/visualization/visualizer/Visualizer.cpp +++ b/cpp/open3d/visualization/visualizer/Visualizer.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/Visualizer.h b/cpp/open3d/visualization/visualizer/Visualizer.h index 3d72d54ee41..7a2cd149baa 100644 --- a/cpp/open3d/visualization/visualizer/Visualizer.h +++ b/cpp/open3d/visualization/visualizer/Visualizer.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/VisualizerCallback.cpp b/cpp/open3d/visualization/visualizer/VisualizerCallback.cpp index d9482407e89..93eeec8d35c 100644 --- a/cpp/open3d/visualization/visualizer/VisualizerCallback.cpp +++ b/cpp/open3d/visualization/visualizer/VisualizerCallback.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/VisualizerRender.cpp b/cpp/open3d/visualization/visualizer/VisualizerRender.cpp index 175d11f99f8..9ca5c966da2 100644 --- a/cpp/open3d/visualization/visualizer/VisualizerRender.cpp +++ b/cpp/open3d/visualization/visualizer/VisualizerRender.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/VisualizerWithCustomAnimation.cpp b/cpp/open3d/visualization/visualizer/VisualizerWithCustomAnimation.cpp index 795b3a4a449..fa13111961e 100644 --- a/cpp/open3d/visualization/visualizer/VisualizerWithCustomAnimation.cpp +++ b/cpp/open3d/visualization/visualizer/VisualizerWithCustomAnimation.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/VisualizerWithCustomAnimation.h b/cpp/open3d/visualization/visualizer/VisualizerWithCustomAnimation.h index f3d8e1b0c55..836995eb823 100644 --- a/cpp/open3d/visualization/visualizer/VisualizerWithCustomAnimation.h +++ b/cpp/open3d/visualization/visualizer/VisualizerWithCustomAnimation.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/VisualizerWithEditing.cpp b/cpp/open3d/visualization/visualizer/VisualizerWithEditing.cpp index 7a56a6f8d86..69328302dfa 100644 --- a/cpp/open3d/visualization/visualizer/VisualizerWithEditing.cpp +++ b/cpp/open3d/visualization/visualizer/VisualizerWithEditing.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/VisualizerWithEditing.h b/cpp/open3d/visualization/visualizer/VisualizerWithEditing.h index 66ee4477df0..b6b34242dac 100644 --- a/cpp/open3d/visualization/visualizer/VisualizerWithEditing.h +++ b/cpp/open3d/visualization/visualizer/VisualizerWithEditing.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/VisualizerWithKeyCallback.cpp b/cpp/open3d/visualization/visualizer/VisualizerWithKeyCallback.cpp index 6fd167b73e5..5a4b0063b01 100644 --- a/cpp/open3d/visualization/visualizer/VisualizerWithKeyCallback.cpp +++ b/cpp/open3d/visualization/visualizer/VisualizerWithKeyCallback.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/VisualizerWithKeyCallback.h b/cpp/open3d/visualization/visualizer/VisualizerWithKeyCallback.h index add4e265edc..734bbfef0cb 100644 --- a/cpp/open3d/visualization/visualizer/VisualizerWithKeyCallback.h +++ b/cpp/open3d/visualization/visualizer/VisualizerWithKeyCallback.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/VisualizerWithVertexSelection.cpp b/cpp/open3d/visualization/visualizer/VisualizerWithVertexSelection.cpp index 3bf224f2368..fcc6ad48140 100644 --- a/cpp/open3d/visualization/visualizer/VisualizerWithVertexSelection.cpp +++ b/cpp/open3d/visualization/visualizer/VisualizerWithVertexSelection.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/visualizer/VisualizerWithVertexSelection.h b/cpp/open3d/visualization/visualizer/VisualizerWithVertexSelection.h index bc9c3298cd0..d360c996bf8 100644 --- a/cpp/open3d/visualization/visualizer/VisualizerWithVertexSelection.h +++ b/cpp/open3d/visualization/visualizer/VisualizerWithVertexSelection.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/webrtc_server/BitmapTrackSource.cpp b/cpp/open3d/visualization/webrtc_server/BitmapTrackSource.cpp index f28c7684cff..6fd753baf43 100644 --- a/cpp/open3d/visualization/webrtc_server/BitmapTrackSource.cpp +++ b/cpp/open3d/visualization/webrtc_server/BitmapTrackSource.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/webrtc_server/BitmapTrackSource.h b/cpp/open3d/visualization/webrtc_server/BitmapTrackSource.h index 2605b8f592e..81ea8243392 100644 --- a/cpp/open3d/visualization/webrtc_server/BitmapTrackSource.h +++ b/cpp/open3d/visualization/webrtc_server/BitmapTrackSource.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/webrtc_server/HttpServerRequestHandler.cpp b/cpp/open3d/visualization/webrtc_server/HttpServerRequestHandler.cpp index 3d933f6070f..1a1030714cd 100644 --- a/cpp/open3d/visualization/webrtc_server/HttpServerRequestHandler.cpp +++ b/cpp/open3d/visualization/webrtc_server/HttpServerRequestHandler.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/webrtc_server/HttpServerRequestHandler.h b/cpp/open3d/visualization/webrtc_server/HttpServerRequestHandler.h index 44367f12270..91af2fdbb5c 100644 --- a/cpp/open3d/visualization/webrtc_server/HttpServerRequestHandler.h +++ b/cpp/open3d/visualization/webrtc_server/HttpServerRequestHandler.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/webrtc_server/ImageCapturer.cpp b/cpp/open3d/visualization/webrtc_server/ImageCapturer.cpp index d870c2170bb..a7ad0109607 100644 --- a/cpp/open3d/visualization/webrtc_server/ImageCapturer.cpp +++ b/cpp/open3d/visualization/webrtc_server/ImageCapturer.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/webrtc_server/ImageCapturer.h b/cpp/open3d/visualization/webrtc_server/ImageCapturer.h index b83624f05cf..f1b094ba3ca 100644 --- a/cpp/open3d/visualization/webrtc_server/ImageCapturer.h +++ b/cpp/open3d/visualization/webrtc_server/ImageCapturer.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // diff --git a/cpp/open3d/visualization/webrtc_server/PeerConnectionManager.cpp b/cpp/open3d/visualization/webrtc_server/PeerConnectionManager.cpp index 7b61ac144f5..c29696c39e2 100644 --- a/cpp/open3d/visualization/webrtc_server/PeerConnectionManager.cpp +++ b/cpp/open3d/visualization/webrtc_server/PeerConnectionManager.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/webrtc_server/PeerConnectionManager.h b/cpp/open3d/visualization/webrtc_server/PeerConnectionManager.h index 8ef27e79a54..e57f7891ce1 100644 --- a/cpp/open3d/visualization/webrtc_server/PeerConnectionManager.h +++ b/cpp/open3d/visualization/webrtc_server/PeerConnectionManager.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/webrtc_server/VideoFilter.h b/cpp/open3d/visualization/webrtc_server/VideoFilter.h index 6a9ddc2f2dd..16588c96a2a 100644 --- a/cpp/open3d/visualization/webrtc_server/VideoFilter.h +++ b/cpp/open3d/visualization/webrtc_server/VideoFilter.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/webrtc_server/VideoScaler.h b/cpp/open3d/visualization/webrtc_server/VideoScaler.h index 733ef7a8517..cd57e3dc898 100644 --- a/cpp/open3d/visualization/webrtc_server/VideoScaler.h +++ b/cpp/open3d/visualization/webrtc_server/VideoScaler.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/webrtc_server/WebRTCWindowSystem.cpp b/cpp/open3d/visualization/webrtc_server/WebRTCWindowSystem.cpp index 4440f0d865b..667a7c88be4 100644 --- a/cpp/open3d/visualization/webrtc_server/WebRTCWindowSystem.cpp +++ b/cpp/open3d/visualization/webrtc_server/WebRTCWindowSystem.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/open3d/visualization/webrtc_server/WebRTCWindowSystem.h b/cpp/open3d/visualization/webrtc_server/WebRTCWindowSystem.h index 1904187ba54..c2769333639 100644 --- a/cpp/open3d/visualization/webrtc_server/WebRTCWindowSystem.h +++ b/cpp/open3d/visualization/webrtc_server/WebRTCWindowSystem.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- /// \file WebRTCWindowSystem.h diff --git a/cpp/open3d/visualization/webrtc_server/html/webrtcstreamer.js b/cpp/open3d/visualization/webrtc_server/html/webrtcstreamer.js index 418139df27e..d7bcd8f6c13 100755 --- a/cpp/open3d/visualization/webrtc_server/html/webrtcstreamer.js +++ b/cpp/open3d/visualization/webrtc_server/html/webrtcstreamer.js @@ -1,27 +1,8 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// The MIT License (MIT) -// -// Copyright (c) 2018-2023 www.open3d.org -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. +// Copyright (c) 2018-2024 www.open3d.org +// SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // Contains source code from // https://github.com/mpromonet/webrtc-streamer diff --git a/cpp/pybind/CMakeLists.txt b/cpp/pybind/CMakeLists.txt index 2072615e6c9..6efae9a17fd 100644 --- a/cpp/pybind/CMakeLists.txt +++ b/cpp/pybind/CMakeLists.txt @@ -75,17 +75,40 @@ endif() # `build/lib/${CMAKE_BUILD_TYPE}/Python/{cpu|cuda}` set(PYTHON_COMPILED_MODULE_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/Python/$,cuda,cpu>") + +# Set BUILD_RPATH to find tbb (and a shared libOpen3D). We don't install through cmake. +if (APPLE) + set_target_properties(pybind PROPERTIES BUILD_RPATH "@loader_path;@loader_path/..") +elseif (UNIX) + # Use RPATH instead of RUNPATH in pybind so that needed libc++.so can find child dependant libc++abi.so in RPATH + # https://stackoverflow.com/questions/69662319/managing-secondary-dependencies-of-shared-libraries + target_link_options(pybind PRIVATE "LINKER:--disable-new-dtags") + set_target_properties(pybind PROPERTIES BUILD_RPATH "$ORIGIN;$ORIGIN/..") +endif() set_target_properties(pybind PROPERTIES FOLDER "Python" LIBRARY_OUTPUT_DIRECTORY "${PYTHON_COMPILED_MODULE_DIR}" ARCHIVE_OUTPUT_DIRECTORY "${PYTHON_COMPILED_MODULE_DIR}") + +if (BUILD_SHARED_LIBS) + if (WIN32) # CMake does not add soversion suffix to WIN32 DLLs + set(_libopen3d_soname "Open3D.dll") + elseif(APPLE) + set(_libopen3d_soname "libOpen3D.${OPEN3D_ABI_VERSION}.dylib") + else() + set(_libopen3d_soname "libOpen3D.so.${OPEN3D_ABI_VERSION}") + endif() + add_custom_command(TARGET pybind POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + $ $/${_libopen3d_soname} + ) +endif() # Include additional libraries that may be absent from the user system -# eg: libc++.so and libc++abi.so (needed by filament) for Linux. +# eg: libc++.so, libc++abi.so (needed by filament) for Linux. # libc++.so is a linker script including libc++.so.1 and libc++abi.so, so append 1 to libc++.so -set(PYTHON_EXTRA_LIBRARIES "") +set(PYTHON_EXTRA_LIBRARIES $) if (BUILD_GUI AND CMAKE_SYSTEM_NAME STREQUAL "Linux") - list(APPEND PYTHON_EXTRA_LIBRARIES ${CPP_LIBRARY}.1 ${CPPABI_LIBRARY} - ${MESA_CPU_GL_LIBRARY}) + list(APPEND PYTHON_EXTRA_LIBRARIES ${CPP_LIBRARY}.1 ${CPPABI_LIBRARY}) endif() if (WITH_OPENMP AND APPLE AND NOT BUILD_SHARED_LIBS) # Package libomp v11.1.0, if it is not installed. Later version cause crash on @@ -102,7 +125,7 @@ if (WITH_OPENMP AND APPLE AND NOT BUILD_SHARED_LIBS) file(GENERATE OUTPUT update_pybind_libomp.sh CONTENT [=[libomp_library=$(dyld_info -dependents "$" | grep libomp | tr -d '[:space:]') -install_name_tool -change $libomp_library @loader_path/../libomp.dylib \ +install_name_tool -change $libomp_library @rpath/$(basename $libomp_library) \ "$"]=]) add_custom_command(TARGET pybind POST_BUILD COMMAND bash update_pybind_libomp.sh @@ -122,6 +145,10 @@ message(STATUS "PYPI_PACKAGE_NAME: ${PYPI_PACKAGE_NAME}") # add the open3d python module first set(COMPILED_MODULE_PATH_LIST $) +# add the open3d DSO / DLL if shared +if (BUILD_SHARED_LIBS) + list(APPEND COMPILED_MODULE_PATH_LIST $/${_libopen3d_soname}) +endif() set(GENERATED_OUTPUTS "") diff --git a/cpp/pybind/camera/camera.cpp b/cpp/pybind/camera/camera.cpp index fa4f201e70a..442ca803add 100644 --- a/cpp/pybind/camera/camera.cpp +++ b/cpp/pybind/camera/camera.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -14,12 +14,48 @@ namespace open3d { namespace camera { -void pybind_camera_classes(py::module &m) { - // open3d.camera.PinholeCameraIntrinsic +void pybind_camera_declarations(py::module &m) { + py::module m_camera = m.def_submodule("camera"); py::class_ pinhole_intr( - m, "PinholeCameraIntrinsic", + m_camera, "PinholeCameraIntrinsic", "PinholeCameraIntrinsic class stores intrinsic camera matrix, and " "image height and width."); + // open3d.camera.PinholeCameraIntrinsicParameters + py::enum_ pinhole_intr_params( + m_camera, "PinholeCameraIntrinsicParameters", py::arithmetic(), + "PinholeCameraIntrinsicParameters"); + pinhole_intr_params + .value("PrimeSenseDefault", + PinholeCameraIntrinsicParameters::PrimeSenseDefault, + "Default camera intrinsic parameter for PrimeSense.") + .value("Kinect2DepthCameraDefault", + PinholeCameraIntrinsicParameters::Kinect2DepthCameraDefault, + "Default camera intrinsic parameter for Kinect2 depth " + "camera.") + .value("Kinect2ColorCameraDefault", + PinholeCameraIntrinsicParameters::Kinect2ColorCameraDefault, + "Default camera intrinsic parameter for Kinect2 color " + "camera.") + .export_values(); + pinhole_intr_params.attr("__doc__") = docstring::static_property( + py::cpp_function([](py::handle arg) -> std::string { + return "Enum class that contains default camera intrinsic " + "parameters for different sensors."; + }), + py::none(), py::none(), ""); + py::class_ pinhole_param( + m_camera, "PinholeCameraParameters", + "Contains both intrinsic and extrinsic pinhole camera parameters."); + py::class_ pinhole_traj( + m_camera, "PinholeCameraTrajectory", + "Contains a list of ``PinholeCameraParameters``, useful to storing " + "trajectories."); +} +void pybind_camera_definitions(py::module &m) { + auto m_camera = static_cast(m.attr("camera")); + // open3d.camera.PinholeCameraIntrinsic + auto pinhole_intr = static_cast>( + m_camera.attr("PinholeCameraIntrinsic")); py::detail::bind_default_constructor(pinhole_intr); py::detail::bind_copy_functions(pinhole_intr); pinhole_intr @@ -57,15 +93,16 @@ void pybind_camera_classes(py::module &m) { "0, cx], [0, fy, " "cy], [0, 0, 1]]``") .def("__repr__", [](const PinholeCameraIntrinsic &c) { - return std::string("PinholeCameraIntrinsic with width = ") + - std::to_string(c.width_) + - std::string(" and height = ") + - std::to_string(c.height_) + - std::string( - ".\nAccess intrinsics with intrinsic_matrix."); + return fmt::format( + "PinholeCameraIntrinsic(" + "width={}, " + "height={}, " + ")", + c.width_, c.height_); }); - docstring::ClassMethodDocInject(m, "PinholeCameraIntrinsic", "__init__"); - docstring::ClassMethodDocInject(m, "PinholeCameraIntrinsic", + docstring::ClassMethodDocInject(m_camera, "PinholeCameraIntrinsic", + "__init__"); + docstring::ClassMethodDocInject(m_camera, "PinholeCameraIntrinsic", "set_intrinsics", {{"width", "Width of the image."}, {"height", "Height of the image."}, @@ -73,41 +110,18 @@ void pybind_camera_classes(py::module &m) { {"fy", "Y-axis focal length."}, {"cx", "X-axis principle point."}, {"cy", "Y-axis principle point."}}); - docstring::ClassMethodDocInject(m, "PinholeCameraIntrinsic", + docstring::ClassMethodDocInject(m_camera, "PinholeCameraIntrinsic", "get_focal_length"); - docstring::ClassMethodDocInject(m, "PinholeCameraIntrinsic", + docstring::ClassMethodDocInject(m_camera, "PinholeCameraIntrinsic", "get_principal_point"); - docstring::ClassMethodDocInject(m, "PinholeCameraIntrinsic", "get_skew"); - docstring::ClassMethodDocInject(m, "PinholeCameraIntrinsic", "is_valid"); - - // open3d.camera.PinholeCameraIntrinsicParameters - py::enum_ pinhole_intr_params( - m, "PinholeCameraIntrinsicParameters", py::arithmetic(), - "PinholeCameraIntrinsicParameters"); - pinhole_intr_params - .value("PrimeSenseDefault", - PinholeCameraIntrinsicParameters::PrimeSenseDefault, - "Default camera intrinsic parameter for PrimeSense.") - .value("Kinect2DepthCameraDefault", - PinholeCameraIntrinsicParameters::Kinect2DepthCameraDefault, - "Default camera intrinsic parameter for Kinect2 depth " - "camera.") - .value("Kinect2ColorCameraDefault", - PinholeCameraIntrinsicParameters::Kinect2ColorCameraDefault, - "Default camera intrinsic parameter for Kinect2 color " - "camera.") - .export_values(); - pinhole_intr_params.attr("__doc__") = docstring::static_property( - py::cpp_function([](py::handle arg) -> std::string { - return "Enum class that contains default camera intrinsic " - "parameters for different sensors."; - }), - py::none(), py::none(), ""); + docstring::ClassMethodDocInject(m_camera, "PinholeCameraIntrinsic", + "get_skew"); + docstring::ClassMethodDocInject(m_camera, "PinholeCameraIntrinsic", + "is_valid"); // open3d.camera.PinholeCameraParameters - py::class_ pinhole_param( - m, "PinholeCameraParameters", - "Contains both intrinsic and extrinsic pinhole camera parameters."); + auto pinhole_param = static_cast>( + m_camera.attr("PinholeCameraParameters")); py::detail::bind_default_constructor( pinhole_param); py::detail::bind_copy_functions(pinhole_param); @@ -125,10 +139,8 @@ void pybind_camera_classes(py::module &m) { }); // open3d.camera.PinholeCameraTrajectory - py::class_ pinhole_traj( - m, "PinholeCameraTrajectory", - "Contains a list of ``PinholeCameraParameters``, useful to storing " - "trajectories."); + auto pinhole_traj = static_cast>( + m_camera.attr("PinholeCameraTrajectory")); py::detail::bind_default_constructor(pinhole_traj); py::detail::bind_copy_functions(pinhole_traj); pinhole_traj @@ -141,10 +153,5 @@ void pybind_camera_classes(py::module &m) { }); } -void pybind_camera(py::module &m) { - py::module m_submodule = m.def_submodule("camera"); - pybind_camera_classes(m_submodule); -} - } // namespace camera } // namespace open3d diff --git a/cpp/pybind/camera/camera.h b/cpp/pybind/camera/camera.h index 38ef9c76afc..dbc4a762987 100644 --- a/cpp/pybind/camera/camera.h +++ b/cpp/pybind/camera/camera.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -12,7 +12,8 @@ namespace open3d { namespace camera { -void pybind_camera(py::module &m); +void pybind_camera_declarations(py::module &m); +void pybind_camera_definitions(py::module &m); } // namespace camera } // namespace open3d diff --git a/cpp/pybind/core/blob.cpp b/cpp/pybind/core/blob.cpp index 309e9381f9b..b7a4827d5c5 100644 --- a/cpp/pybind/core/blob.cpp +++ b/cpp/pybind/core/blob.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -14,7 +14,9 @@ namespace open3d { namespace core { -void pybind_core_blob(py::module &m) { py::class_ blob(m, "Blob"); } +void pybind_core_blob_declarations(py::module &m) { + py::class_ blob(m, "Blob"); +} } // namespace core } // namespace open3d diff --git a/cpp/pybind/core/core.cpp b/cpp/pybind/core/core.cpp index 3ce45511c0a..c69e658e045 100644 --- a/cpp/pybind/core/core.cpp +++ b/cpp/pybind/core/core.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -16,27 +16,42 @@ namespace open3d { namespace core { -void pybind_core(py::module& m) { +void pybind_core_declarations(py::module& m) { py::module m_core = m.def_submodule("core"); // opn3d::core namespace. - pybind_cuda_utils(m_core); - pybind_sycl_utils(m_core); - pybind_core_blob(m_core); - pybind_core_dtype(m_core); - pybind_core_device(m_core); - pybind_core_size_vector(m_core); - pybind_core_tensor(m_core); - pybind_core_tensor_function(m_core); - pybind_core_linalg(m_core); - pybind_core_kernel(m_core); - pybind_core_hashmap(m_core); - pybind_core_hashset(m_core); - pybind_core_scalar(m_core); + pybind_cuda_utils_declarations(m_core); + pybind_core_blob_declarations(m_core); + pybind_core_dtype_declarations(m_core); + pybind_core_device_declarations(m_core); + pybind_core_size_vector_declarations(m_core); + pybind_core_tensor_declarations(m_core); + pybind_core_kernel_declarations(m_core); + pybind_core_hashmap_declarations(m_core); + pybind_core_hashset_declarations(m_core); + pybind_core_scalar_declarations(m_core); // opn3d::core::nns namespace. py::module m_nns = m_core.def_submodule("nns"); - nns::pybind_core_nns(m_nns); + nns::pybind_core_nns_declarations(m_nns); +} + +void pybind_core_definitions(py::module& m) { + auto m_core = static_cast(m.attr("core")); + pybind_cuda_utils_definitions(m_core); + pybind_sycl_utils_definitions(m_core); + pybind_core_dtype_definitions(m_core); + pybind_core_device_definitions(m_core); + pybind_core_size_vector_definitions(m_core); + pybind_core_tensor_definitions(m_core); + pybind_core_tensor_function_definitions(m_core); + pybind_core_linalg_definitions(m_core); + pybind_core_kernel_definitions(m_core); + pybind_core_hashmap_definitions(m_core); + pybind_core_hashset_definitions(m_core); + pybind_core_scalar_definitions(m_core); + auto m_nns = static_cast(m_core.attr("nns")); + nns::pybind_core_nns_definitions(m_nns); } } // namespace core diff --git a/cpp/pybind/core/core.h b/cpp/pybind/core/core.h index 14897df8fdb..798098b93fc 100644 --- a/cpp/pybind/core/core.h +++ b/cpp/pybind/core/core.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -13,21 +13,32 @@ namespace open3d { namespace core { -void pybind_core(py::module& m); -void pybind_cuda_utils(py::module& m); -void pybind_sycl_utils(py::module& m); -void pybind_core_blob(py::module& m); -void pybind_core_dtype(py::module& m); -void pybind_core_device(py::module& m); -void pybind_core_size_vector(py::module& m); -void pybind_core_tensor(py::module& m); +void pybind_core_declarations(py::module& m); +void pybind_cuda_utils_declarations(py::module& m); +void pybind_core_blob_declarations(py::module& m); +void pybind_core_dtype_declarations(py::module& m); +void pybind_core_device_declarations(py::module& m); +void pybind_core_size_vector_declarations(py::module& m); +void pybind_core_tensor_declarations(py::module& m); void pybind_core_tensor_accessor(py::class_& t); -void pybind_core_tensor_function(py::module& m); -void pybind_core_linalg(py::module& m); -void pybind_core_kernel(py::module& m); -void pybind_core_hashmap(py::module& m); -void pybind_core_hashset(py::module& m); -void pybind_core_scalar(py::module& m); +void pybind_core_tensor_function_definitions(py::module& m); +void pybind_core_kernel_declarations(py::module& m); +void pybind_core_hashmap_declarations(py::module& m); +void pybind_core_hashset_declarations(py::module& m); +void pybind_core_scalar_declarations(py::module& m); + +void pybind_core_definitions(py::module& m); +void pybind_cuda_utils_definitions(py::module& m); +void pybind_sycl_utils_definitions(py::module& m); +void pybind_core_dtype_definitions(py::module& m); +void pybind_core_device_definitions(py::module& m); +void pybind_core_size_vector_definitions(py::module& m); +void pybind_core_tensor_definitions(py::module& m); +void pybind_core_linalg_definitions(py::module& m); +void pybind_core_kernel_definitions(py::module& m); +void pybind_core_hashmap_definitions(py::module& m); +void pybind_core_hashset_definitions(py::module& m); +void pybind_core_scalar_definitions(py::module& m); } // namespace core } // namespace open3d diff --git a/cpp/pybind/core/cuda_utils.cpp b/cpp/pybind/core/cuda_utils.cpp index 3befab655c2..cb82bb030c4 100644 --- a/cpp/pybind/core/cuda_utils.cpp +++ b/cpp/pybind/core/cuda_utils.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -12,9 +12,11 @@ namespace open3d { namespace core { -void pybind_cuda_utils(py::module& m) { +void pybind_cuda_utils_declarations(py::module& m) { py::module m_cuda = m.def_submodule("cuda"); - +} +void pybind_cuda_utils_definitions(py::module& m) { + auto m_cuda = static_cast(m.attr("cuda")); m_cuda.def("device_count", cuda::DeviceCount, "Returns the number of available CUDA devices. Returns 0 if " "Open3D is not compiled with CUDA support."); diff --git a/cpp/pybind/core/device.cpp b/cpp/pybind/core/device.cpp index bcf11805173..c048d4c1e8a 100644 --- a/cpp/pybind/core/device.cpp +++ b/cpp/pybind/core/device.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -14,10 +14,17 @@ namespace open3d { namespace core { -void pybind_core_device(py::module &m) { +void pybind_core_device_declarations(py::module &m) { py::class_ device( m, "Device", "Device context specifying device type and device id."); + py::enum_(device, "DeviceType") + .value("CPU", Device::DeviceType::CPU) + .value("CUDA", Device::DeviceType::CUDA) + .export_values(); +} +void pybind_core_device_definitions(py::module &m) { + auto device = static_cast>(m.attr("Device")); device.def(py::init<>()); device.def(py::init()); device.def(py::init()); @@ -41,11 +48,6 @@ void pybind_core_device(py::module &m) { return Device(t[0].cast(), t[1].cast()); })); - - py::enum_(device, "DeviceType") - .value("CPU", Device::DeviceType::CPU) - .value("CUDA", Device::DeviceType::CUDA) - .export_values(); } } // namespace core diff --git a/cpp/pybind/core/dtype.cpp b/cpp/pybind/core/dtype.cpp index e4ab4489c4b..f6e87aa11e9 100644 --- a/cpp/pybind/core/dtype.cpp +++ b/cpp/pybind/core/dtype.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -15,10 +15,21 @@ namespace open3d { namespace core { -void pybind_core_dtype(py::module &m) { - // open3d.core.Dtype class +void pybind_core_dtype_declarations(py::module &m) { py::class_> dtype(m, "Dtype", "Open3D data types."); + py::enum_(dtype, "DtypeCode") + .value("Undefined", Dtype::DtypeCode::Undefined) + .value("Bool", Dtype::DtypeCode::Bool) + .value("Int", Dtype::DtypeCode::Int) + .value("UInt", Dtype::DtypeCode::UInt) + .value("Float", Dtype::DtypeCode::Float) + .value("Object", Dtype::DtypeCode::Object); +} +void pybind_core_dtype_definitions(py::module &m) { + // open3d.core.Dtype class + auto dtype = static_cast>>( + m.attr("Dtype")); dtype.def(py::init()); dtype.def_readonly_static("Undefined", &core::Undefined); dtype.def_readonly_static("Float32", &core::Float32); diff --git a/cpp/pybind/core/hashmap.cpp b/cpp/pybind/core/hashmap.cpp index 4c6740d1bfa..ce95bf15658 100644 --- a/cpp/pybind/core/hashmap.cpp +++ b/cpp/pybind/core/hashmap.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -50,11 +50,13 @@ const std::unordered_map argument_docs = { {"values_buffer_id", "Index of the value buffer tensor."}, {"device_id", "Target CUDA device ID."}}; -void pybind_core_hashmap(py::module& m) { +void pybind_core_hashmap_declarations(py::module& m) { py::class_ hashmap(m, "HashMap", "A HashMap is an unordered map from key to " "value wrapped by Tensors."); - +} +void pybind_core_hashmap_definitions(py::module& m) { + auto hashmap = static_cast>(m.attr("HashMap")); hashmap.def(py::init(), "init_capacity"_a, "key_dtype"_a, "key_element_shape"_a, @@ -193,11 +195,13 @@ void pybind_core_hashmap(py::module& m) { hashmap.def_property_readonly("is_cuda", &HashMap::IsCUDA); } -void pybind_core_hashset(py::module& m) { +void pybind_core_hashset_declarations(py::module& m) { py::class_ hashset( m, "HashSet", "A HashSet is an unordered set of keys wrapped by Tensors."); - +} +void pybind_core_hashset_definitions(py::module& m) { + auto hashset = static_cast>(m.attr("HashSet")); hashset.def( py::init(), "init_capacity"_a, "key_dtype"_a, "key_element_shape"_a, diff --git a/cpp/pybind/core/kernel.cpp b/cpp/pybind/core/kernel.cpp index 1d083778997..887bfae918f 100644 --- a/cpp/pybind/core/kernel.cpp +++ b/cpp/pybind/core/kernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -14,8 +14,11 @@ namespace open3d { namespace core { -void pybind_core_kernel(py::module &m) { +void pybind_core_kernel_declarations(py::module &m) { py::module m_kernel = m.def_submodule("kernel"); +} +void pybind_core_kernel_definitions(py::module &m) { + auto m_kernel = static_cast(m.attr("kernel")); m_kernel.def("test_linalg_integration", &core::kernel::TestLinalgIntegration); } diff --git a/cpp/pybind/core/linalg.cpp b/cpp/pybind/core/linalg.cpp index 39ec10650f2..fa90f6ed3f9 100644 --- a/cpp/pybind/core/linalg.cpp +++ b/cpp/pybind/core/linalg.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -21,7 +21,7 @@ namespace open3d { namespace core { -void pybind_core_linalg(py::module &m) { +void pybind_core_linalg_definitions(py::module &m) { m.def( "matmul", [](const Tensor &A, const Tensor &B) { diff --git a/cpp/pybind/core/nns/nearest_neighbor_search.cpp b/cpp/pybind/core/nns/nearest_neighbor_search.cpp index feab8bbcdbf..6ed494767c0 100644 --- a/cpp/pybind/core/nns/nearest_neighbor_search.cpp +++ b/cpp/pybind/core/nns/nearest_neighbor_search.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -18,31 +18,56 @@ namespace open3d { namespace core { namespace nns { -void pybind_core_nns(py::module &m_nns) { - static const std::unordered_map - map_nearest_neighbor_search_method_docs = { - {"query_points", "The query tensor of shape {n_query, d}."}, - {"radii", - "Tensor of shape {n_query,} containing multiple radii, " - "one for each query point."}, - {"radius", "Radius value for radius search."}, - {"max_knn", - "Maximum number of neighbors to search per query point."}, - {"knn", "Number of neighbors to search per query point."}}; - +void pybind_core_nns_declarations(py::module &m_nns) { py::class_> nns(m_nns, "NearestNeighborSearch", - "NearestNeighborSearch class for nearest neighbor search. " - "Construct a NearestNeighborSearch object with input " - "dataset_points of shape {n_dataset, d}."); + R"(NearestNeighborSearch class for nearest neighbor search. + +This class holds multiple index types to accelerate various nearest neighbor +search operations for a dataset of points with shape {n,d} with `n` as the number +of points and `d` as the dimension of the points. The class supports knn search, +fixed-radius search, multi-radius search, and hybrid search. + +Example: + The following example demonstrates how to perform knn search using the class:: + + import open3d as o3d + import numpy as np + + dataset = np.random.rand(10,3) + query_points = np.random.rand(5,3) + nns = o3d.core.nns.NearestNeighborSearch(dataset) + + # initialize the knn_index before we can use knn_search + nns.knn_index() + + # perform knn search to get the 3 closest points with respect to the + # Euclidean distance. The returned distance is given as the squared + # distances + indices, squared_distances = nns.knn_search(query_points, knn=3) + + )"); +} + +void pybind_core_nns_definitions(py::module &m_nns) { + auto nns = static_cast>>( + m_nns.attr("NearestNeighborSearch")); // Constructors. nns.def(py::init(), "dataset_points"_a, "index_dtype"_a = core::Int64); // Index functions. nns.def("knn_index", &NearestNeighborSearch::KnnIndex, - "Set index for knn search."); + R"(Initialize the index for knn search. + +This function needs to be called once before performing search operations. + +Returns: + True on success. + )"); + nns.def( "fixed_radius_index", [](NearestNeighborSearch &self, utility::optional radius) { @@ -52,9 +77,28 @@ void pybind_core_nns(py::module &m_nns) { return self.FixedRadiusIndex(radius.value()); } }, - py::arg("radius") = py::none()); + py::arg("radius") = py::none(), + R"(Initialize the index for fixed-radius search. + +This function needs to be called once before performing search operations. + +Args: + radius (float, optional): Radius value for fixed-radius search. Required + for GPU fixed radius index. + +Returns: + True on success. + )"); + nns.def("multi_radius_index", &NearestNeighborSearch::MultiRadiusIndex, - "Set index for multi-radius search."); + R"(Initialize the index for multi-radius search. + +This function needs to be called once before performing search operations. + +Returns: + True on success. + )"); + nns.def( "hybrid_index", [](NearestNeighborSearch &self, utility::optional radius) { @@ -64,11 +108,57 @@ void pybind_core_nns(py::module &m_nns) { return self.HybridIndex(radius.value()); } }, - py::arg("radius") = py::none()); + py::arg("radius") = py::none(), + R"(Initialize the index for hybrid search. + +This function needs to be called once before performing search operations. + +Args: + radius (float, optional): Radius value for hybrid search. Required + for GPU hybrid index. + +Returns: + True on success. + )"); // Search functions. nns.def("knn_search", &NearestNeighborSearch::KnnSearch, "query_points"_a, - "knn"_a, "Perform knn search."); + "knn"_a, + R"(Perform knn search. + +Note: + To use knn_search initialize the index using knn_index before calling this function. + +Args: + query_points (open3d.core.Tensor): Query points with shape {n, d}. + knn (int): Number of neighbors to search per query point. + +Example: + The following searches the 3 nearest neighbors for random dataset and query points:: + + import open3d as o3d + import numpy as np + + dataset = np.random.rand(10,3) + query_points = np.random.rand(5,3) + + nns = o3d.core.nns.NearestNeighborSearch(dataset) + + # initialize the knn_index before we can use knn_search + nns.knn_index() + + # perform knn search to get the 3 closest points with respect to the + # Euclidean distance. The returned distance is given as the squared + # distances + indices, squared_distances = nns.knn_search(query_points, knn=3) + +Returns: + Tuple of Tensors (indices, squared_distances). + - indices: Tensor of shape {n, knn}. + - squared_distances: Tensor of shape {n, knn}. The distances are squared L2 distances. + + )"); + nns.def( "fixed_radius_search", [](NearestNeighborSearch &self, Tensor query_points, double radius, @@ -81,28 +171,141 @@ void pybind_core_nns(py::module &m_nns) { } }, py::arg("query_points"), py::arg("radius"), - py::arg("sort") = py::none()); + py::arg("sort") = py::none(), + R"(Perform fixed-radius search. + +Note: + To use fixed_radius_search initialize the index using fixed_radius_index before calling this function. + +Args: + query_points (open3d.core.Tensor): Query points with shape {n, d}. + radius (float): Radius value for fixed-radius search. Note that this + parameter can differ from the radius used to initialize the index + for convenience, which may cause the index to be rebuilt for GPU + devices. + sort (bool, optional): Sort the results by distance. Default is True. + +Returns: + Tuple of Tensors (indices, splits, distances). + - indices: The indices of the neighbors. + - distances: The squared L2 distances. + - splits: The splits of the indices and distances defining the start + and exclusive end of each query point's neighbors. The shape is {num_queries+1} + +Example: + The following searches the neighbors within a radius of 1.0 a set of data and query points:: + + # define data and query points + points = np.array([ + [0.1,0.1,0.1], + [0.9,0.9,0.9], + [0.5,0.5,0.5], + [1.7,1.7,1.7], + [1.8,1.8,1.8], + [0.3,2.4,1.4]], dtype=np.float32) + + queries = np.array([ + [1.0,1.0,1.0], + [0.5,2.0,2.0], + [0.5,2.1,2.1], + [100,100,100], + ], dtype=np.float32) + + nns = o3d.core.nns.NearestNeighborSearch(points) + nns.fixed_radius_index(radius=1.0) + + neighbors_index, neighbors_distance, neighbors_splits = nns.fixed_radius_search(queries, radius=1.0, sort=True) + # returns neighbors_index = [1, 2, 5, 5] + # neighbors_distance = [0.03 0.75 0.56000006 0.62] + # neighbors_splits = [0, 2, 3, 4, 4] + + for i, (start_i, end_i) in enumerate(zip(neighbors_splits, neighbors_splits[1:])): + start_i = start_i.item() + end_i = end_i.item() + print(f"query_point {i} has the neighbors {neighbors_index[start_i:end_i].numpy()} " + f"with squared distances {neighbors_distance[start_i:end_i].numpy()}") + )"); + nns.def("multi_radius_search", &NearestNeighborSearch::MultiRadiusSearch, "query_points"_a, "radii"_a, - "Perform multi-radius search. Each query point has an independent " - "radius."); + R"(Perform multi-radius search. Each query point has an independent radius. + +Note: + To use multi_radius_search initialize the index using multi_radius_index before calling this function. + +Args: + query_points (open3d.core.Tensor): Query points with shape {n, d}. + radii (open3d.core.Tensor): Radii of query points. Each query point has one radius. + +Returns: + Tuple of Tensors (indices, splits, distances). + - indices: The indices of the neighbors. + - distances: The squared L2 distances. + - splits: The splits of the indices and distances defining the start + and exclusive end of each query point's neighbors. The shape is {num_queries+1} + +Example: + The following searches the neighbors with an individual radius for each query point:: + + # define data, query points and radii + points = np.array([ + [0.1,0.1,0.1], + [0.9,0.9,0.9], + [0.5,0.5,0.5], + [1.7,1.7,1.7], + [1.8,1.8,1.8], + [0.3,2.4,1.4]], dtype=np.float32) + + queries = np.array([ + [1.0,1.0,1.0], + [0.5,2.0,2.0], + [0.5,2.1,2.1], + [100,100,100], + ], dtype=np.float32) + + radii = np.array([0.5, 1.0, 1.5, 2], dtype=np.float32) + + nns = o3d.core.nns.NearestNeighborSearch(points) + + nns.multi_radius_index() + + neighbors_index, neighbors_distance, neighbors_splits = nns.multi_radius_search(queries, radii) + # returns neighbors_index = [1 5 5 3 4] + # neighbors_distance = [0.03 0.56 0.62 1.76 1.87] + # neighbors_splits = [0 1 2 5 5] + + + for i, (start_i, end_i) in enumerate(zip(neighbors_splits, neighbors_splits[1:])): + start_i = start_i.item() + end_i = end_i.item() + print(f"query_point {i} has the neighbors {neighbors_index[start_i:end_i].numpy()} " + f"with squared distances {neighbors_distance[start_i:end_i].numpy()}") + )"); + nns.def("hybrid_search", &NearestNeighborSearch::HybridSearch, "query_points"_a, "radius"_a, "max_knn"_a, - "Perform hybrid search."); - - // Docstrings. - docstring::ClassMethodDocInject(m_nns, "NearestNeighborSearch", - "knn_search", - map_nearest_neighbor_search_method_docs); - docstring::ClassMethodDocInject(m_nns, "NearestNeighborSearch", - "multi_radius_search", - map_nearest_neighbor_search_method_docs); - docstring::ClassMethodDocInject(m_nns, "NearestNeighborSearch", - "fixed_radius_search", - map_nearest_neighbor_search_method_docs); - docstring::ClassMethodDocInject(m_nns, "NearestNeighborSearch", - "hybrid_search", - map_nearest_neighbor_search_method_docs); + R"(Perform hybrid search. + +Hybrid search behaves similarly to fixed-radius search, but with a maximum number of neighbors to search per query point. + +Note: + To use hybrid_search initialize the index using hybrid_index before calling this function. + +Args: + query_points (open3d.core.Tensor): Query points with shape {n, d}. + radius (float): Radius value for hybrid search. + max_knn (int): Maximum number of neighbor to search per query. + +Returns: + Tuple of Tensors (indices, distances, counts) + - indices: The indices of the neighbors with shape {n, max_knn}. + If there are less than max_knn neighbors within the radius then the + last entries are padded with -1. + - distances: The squared L2 distances with shape {n, max_knn}. + If there are less than max_knn neighbors within the radius then the + last entries are padded with 0. + - counts: Counts of neighbour for each query points with shape {n}. + )"); } } // namespace nns diff --git a/cpp/pybind/core/nns/nearest_neighbor_search.h b/cpp/pybind/core/nns/nearest_neighbor_search.h index a391160b525..c81970cf4f0 100644 --- a/cpp/pybind/core/nns/nearest_neighbor_search.h +++ b/cpp/pybind/core/nns/nearest_neighbor_search.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -14,7 +14,8 @@ namespace open3d { namespace core { namespace nns { -void pybind_core_nns(py::module &m); +void pybind_core_nns_declarations(py::module &m); +void pybind_core_nns_definitions(py::module &m); } // namespace nns } // namespace core diff --git a/cpp/pybind/core/scalar.cpp b/cpp/pybind/core/scalar.cpp index 8a16a690f97..e72ecffec3d 100644 --- a/cpp/pybind/core/scalar.cpp +++ b/cpp/pybind/core/scalar.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -12,10 +12,12 @@ namespace open3d { namespace core { -void pybind_core_scalar(py::module& m) { +void pybind_core_scalar_declarations(py::module& m) { py::class_ scalar( m, "Scalar", "A Scalar can store one of {double, int64, bool}."); - +} +void pybind_core_scalar_definitions(py::module& m) { + auto scalar = static_cast>(m.attr("Scalar")); scalar.def(py::init([](float val) { return Scalar(val); })); scalar.def(py::init([](double val) { return Scalar(val); })); scalar.def(py::init([](int8_t val) { return Scalar(val); })); diff --git a/cpp/pybind/core/size_vector.cpp b/cpp/pybind/core/size_vector.cpp index 434dcb6ff59..65630d4949d 100644 --- a/cpp/pybind/core/size_vector.cpp +++ b/cpp/pybind/core/size_vector.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -13,12 +13,17 @@ namespace open3d { namespace core { -void pybind_core_size_vector(py::module& m) { +void pybind_core_size_vector_declarations(py::module& m) { // bind_vector takes care of most common methods for Python list. auto sv = py::bind_vector( m, "SizeVector", "A vector of integers for specifying shape, strides, etc."); - + auto dsv = py::bind_vector( + m, "DynamicSizeVector", + "A vector of integers for specifying shape, strides, etc. Some " + "elements can be None."); +} +void pybind_core_size_vector_definitions(py::module& m) { // In Python, We want (3), (3,), [3] and [3,] to represent the same thing. // The following are all equivalent to core::SizeVector({3}): // - o3d.core.SizeVector(3) # int @@ -33,17 +38,15 @@ void pybind_core_size_vector(py::module& m) { // // The API difference is due to the NumPy convention which allows integer to // represent a 1-element tuple, and the C++ constructor for vectors. + auto sv = static_cast>(m.attr("SizeVector")); sv.def(py::init([](int64_t i) { return SizeVector({i}); })); py::implicitly_convertible(); // Allows tuple and list implicit conversions to SizeVector. py::implicitly_convertible(); py::implicitly_convertible(); - - auto dsv = py::bind_vector( - m, "DynamicSizeVector", - "A vector of integers for specifying shape, strides, etc. Some " - "elements can be None."); + auto dsv = static_cast>( + m.attr("DynamicSizeVector")); dsv.def("__repr__", [](const DynamicSizeVector& dsv) { return dsv.ToString(); }); } diff --git a/cpp/pybind/core/sycl_utils.cpp b/cpp/pybind/core/sycl_utils.cpp index b0b486ba6f0..9a28dcb5072 100644 --- a/cpp/pybind/core/sycl_utils.cpp +++ b/cpp/pybind/core/sycl_utils.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -12,7 +12,28 @@ namespace open3d { namespace core { -void pybind_sycl_utils(py::module& m) { m.def("sycl_demo", &sycl::SYCLDemo); } +void pybind_sycl_utils_definitions(py::module& m) { + m.def("sycl_demo", &sy::SYCLDemo); + + py::module m_sycl = m.def_submodule("sycl"); + m_sycl.def("is_available", sy::IsAvailable, + "Returns true if Open3D is compiled with SYCL support and at " + "least one compatible SYCL device is detected."); + + m_sycl.def("get_available_devices", sy::GetAvailableSYCLDevices, + "Return a list of available SYCL devices."); + + m_sycl.def("print_sycl_devices", sy::PrintSYCLDevices, + "print_all"_a = false, + "Print SYCL device available to Open3D (either the best " + "available GPU, or a fallback CPU device). If `print_all` is " + "specified, also print SYCL devices of other types."); + + m_sycl.def("enable_persistent_jit_cache", sy::enablePersistentJITCache, + "Enables the JIT cache for SYCL. This sets an environment " + "variable and " + "will affect the entire process and any child processes."); +} } // namespace core } // namespace open3d diff --git a/cpp/pybind/core/tensor.cpp b/cpp/pybind/core/tensor.cpp index 56e1aaa2f2c..28e20081f06 100644 --- a/cpp/pybind/core/tensor.cpp +++ b/cpp/pybind/core/tensor.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -250,11 +250,14 @@ static void BindTensorFullCreation(py::module& m, py::class_& tensor) { "device"_a = py::none()); } -void pybind_core_tensor(py::module& m) { +void pybind_core_tensor_declarations(py::module& m) { py::class_ tensor( m, "Tensor", "A Tensor is a view of a data Blob with shape, stride, data_ptr."); - + m.attr("capsule") = py::module_::import("typing").attr("Any"); +} +void pybind_core_tensor_definitions(py::module& m) { + auto tensor = static_cast>(m.attr("Tensor")); // o3c.Tensor(np.array([[0, 1, 2], [3, 4, 5]]), dtype=None, device=None). tensor.def(py::init([](const py::array& np_array, utility::optional dtype, diff --git a/cpp/pybind/core/tensor_accessor.cpp b/cpp/pybind/core/tensor_accessor.cpp index 01825ca8662..15b028bb78c 100644 --- a/cpp/pybind/core/tensor_accessor.cpp +++ b/cpp/pybind/core/tensor_accessor.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/pybind/core/tensor_converter.cpp b/cpp/pybind/core/tensor_converter.cpp index 018d857e5ed..ea3e2ff4f45 100644 --- a/cpp/pybind/core/tensor_converter.cpp +++ b/cpp/pybind/core/tensor_converter.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -106,10 +106,10 @@ Tensor PyArrayToTensor(py::array array, bool inplace) { Dtype dtype = pybind_utils::ArrayFormatToDtype(info.format, info.itemsize); Device device("CPU:0"); - array.inc_ref(); - std::function deleter = [array](void*) -> void { + auto shared_array = std::make_shared(array); + std::function deleter = [shared_array](void*) mutable -> void { py::gil_scoped_acquire acquire; - array.dec_ref(); + shared_array.reset(); }; auto blob = std::make_shared(device, info.ptr, deleter); Tensor t_inplace(shape, strides, info.ptr, dtype, blob); diff --git a/cpp/pybind/core/tensor_converter.h b/cpp/pybind/core/tensor_converter.h index 975910e56f5..cf255925830 100644 --- a/cpp/pybind/core/tensor_converter.h +++ b/cpp/pybind/core/tensor_converter.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/pybind/core/tensor_function.cpp b/cpp/pybind/core/tensor_function.cpp index 78a6da686a1..0259c564062 100644 --- a/cpp/pybind/core/tensor_function.cpp +++ b/cpp/pybind/core/tensor_function.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -13,7 +13,7 @@ namespace open3d { namespace core { -void pybind_core_tensor_function(py::module& m) { +void pybind_core_tensor_function_definitions(py::module& m) { m.def( "concatenate", [](const std::vector& tensors, @@ -27,7 +27,7 @@ void pybind_core_tensor_function(py::module& m) { axis into a new tensor. All the tensors must have same data-type, device, and number of dimensions. All dimensions must be the same, except the dimension along the axis the tensors are to be concatenated. -Using Concatenate for a single tensor, the tensor is split along its first +Using Concatenate for a single tensor, the tensor is split along its first dimension (length), and concatenated along the axis. This is the same as NumPy's semantics: @@ -59,17 +59,17 @@ This is the same as NumPy's semantics: } return core::Append(self, values); }, - R"(Appends the `values` tensor to the `self` tensor, along the + R"(Appends the `values` tensor to the `self` tensor, along the given axis and returns a new tensor. Both the tensors must have same data-type device, and number of dimensions. All dimensions must be the same, except the -dimension along the axis the tensors are to be appended. +dimension along the axis the tensors are to be appended. This is the same as NumPy's semantics: - https://numpy.org/doc/stable/reference/generated/numpy.append.html Returns: - A copy of the `self` tensor with `values` appended to axis. Note that - append does not occur in-place: a new array is allocated and filled. + A copy of the `self` tensor with `values` appended to axis. Note that + append does not occur in-place: a new array is allocated and filled. If axis is null, out is a flattened tensor. Example: @@ -78,20 +78,20 @@ This is the same as NumPy's semantics: [2 3], [4 5]] Tensor[shape={3, 2}, stride={2, 1}, Int64, CPU:0, 0x55555abc6b00] - + >>> o3d.core.append([[0, 1], [2, 3]], [[4, 5]]) [0 1 2 3 4 5] Tensor[shape={6}, stride={1}, Int64, CPU:0, 0x55555abc6b70])", "self"_a, "values"_a, "axis"_a = py::none()); m.def("maximum", &core::Maximum, - R"(Computes the element-wise maximum of input and other. The tensors + R"(Computes the element-wise maximum of input and other. The tensors must have same data type and device. If input.GetShape() != other.GetShape(), then they will be broadcasted to a common shape (which becomes the shape of the output).)", "input"_a, "other"_a); m.def("minimum", &core::Minimum, - R"(Computes the element-wise minimum of input and other. The tensors + R"(Computes the element-wise minimum of input and other. The tensors must have same data type and device. If input.GetShape() != other.GetShape(), then they will be broadcasted to a common shape (which becomes the shape of the output).)", diff --git a/cpp/pybind/core/tensor_type_caster.cpp b/cpp/pybind/core/tensor_type_caster.cpp index 2fb4ff99d67..cb69fddfef0 100644 --- a/cpp/pybind/core/tensor_type_caster.cpp +++ b/cpp/pybind/core/tensor_type_caster.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/pybind/core/tensor_type_caster.h b/cpp/pybind/core/tensor_type_caster.h index 6cc50935957..19455769f2f 100644 --- a/cpp/pybind/core/tensor_type_caster.h +++ b/cpp/pybind/core/tensor_type_caster.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/pybind/data/dataset.cpp b/cpp/pybind/data/dataset.cpp index 6526088fc5c..ce2b21ee273 100644 --- a/cpp/pybind/data/dataset.cpp +++ b/cpp/pybind/data/dataset.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -35,7 +35,7 @@ void pybind_data_classes(py::module& m) { m, "DataDescriptor", "DataDescriptor is a class that describes a data file. It contains " "the URL mirrors to download the file, the MD5 hash of the file, " - "and wether to extract the file."); + "and whether to extract the file."); data_descriptor .def(py::init([](const std::vector& urls, const std::string& md5, diff --git a/cpp/pybind/data/dataset.h b/cpp/pybind/data/dataset.h index 57b1183a255..b5323357bb7 100644 --- a/cpp/pybind/data/dataset.h +++ b/cpp/pybind/data/dataset.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/pybind/docstring.cpp b/cpp/pybind/docstring.cpp index f6ed0d1a4b3..fce26d58688 100644 --- a/cpp/pybind/docstring.cpp +++ b/cpp/pybind/docstring.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -201,14 +201,24 @@ std::string FunctionDoc::ToGoogleDocString() const { for (size_t i = 0; i < overload.argument_docs_.size(); ++i) { const ArgumentDoc& argument_doc = overload.argument_docs_[i]; rc << argument_doc.name_; + if (argument_doc.type_ != "") { + rc << ": " << argument_doc.type_; + } if (argument_doc.default_ != "") { - rc << "=" << argument_doc.default_; + rc << " = " << argument_doc.default_; } if (i != overload.argument_docs_.size() - 1) { rc << ", "; } } - rc << ")" << std::endl; + rc << ")"; + + // Return type + if (overload.return_doc_.type_ != "") { + rc << " -> " << overload.return_doc_.type_; + } + + rc << std::endl; // Summary line, strictly speaking this shall be at the very front. // However from a compiled Python module we need the function signature @@ -347,6 +357,12 @@ std::vector FunctionDoc::GetArgumentTokens( str.replace(parenthesis_pos + 1, 0, ", "); } + // Ignore everything after last argument (right before ") ->") + // Otherwise false argument matches might be found in docstrings + std::size_t arrow_pos = str.rfind(") -> "); + if (arrow_pos == std::string::npos) return {}; + str.resize(arrow_pos); + // Get start positions std::regex pattern("(, [A-Za-z_][A-Za-z\\d_]*:)"); std::smatch res; @@ -366,12 +382,7 @@ std::vector FunctionDoc::GetArgumentTokens( for (size_t i = 0; i + 1 < argument_start_positions.size(); ++i) { argument_end_positions.push_back(argument_start_positions[i + 1] - 2); } - std::size_t arrow_pos = str.rfind(") -> "); - if (arrow_pos == std::string::npos) { - return {}; - } else { - argument_end_positions.push_back(arrow_pos); - } + argument_end_positions.push_back(arrow_pos); std::vector argument_tokens; for (size_t i = 0; i < argument_start_positions.size(); ++i) { diff --git a/cpp/pybind/docstring.h b/cpp/pybind/docstring.h index 3b6d29043e1..6a91681097a 100644 --- a/cpp/pybind/docstring.h +++ b/cpp/pybind/docstring.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/pybind/generate_tf_ops_wrapper.py b/cpp/pybind/generate_tf_ops_wrapper.py index 68fd76cda08..5883b45f4ab 100644 --- a/cpp/pybind/generate_tf_ops_wrapper.py +++ b/cpp/pybind/generate_tf_ops_wrapper.py @@ -1,29 +1,9 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# The MIT License (MIT) -# -# Copyright (c) 2018-2023 www.open3d.org -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. +# Copyright (c) 2018-2024 www.open3d.org +# SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- - """This script inspects the open3d_tf_ops library and generates function wrappers""" import os import sys diff --git a/cpp/pybind/generate_torch_ops_wrapper.py b/cpp/pybind/generate_torch_ops_wrapper.py index 38b381d7e28..bda52b8fc83 100644 --- a/cpp/pybind/generate_torch_ops_wrapper.py +++ b/cpp/pybind/generate_torch_ops_wrapper.py @@ -1,27 +1,8 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# The MIT License (MIT) -# -# Copyright (c) 2018-2023 www.open3d.org -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. +# Copyright (c) 2018-2024 www.open3d.org +# SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """This script inspects the open3d_torch_ops library and generates function wrappers""" import os diff --git a/cpp/pybind/geometry/boundingvolume.cpp b/cpp/pybind/geometry/boundingvolume.cpp index 719e4edfa55..3501bebd400 100644 --- a/cpp/pybind/geometry/boundingvolume.cpp +++ b/cpp/pybind/geometry/boundingvolume.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -16,12 +16,26 @@ namespace open3d { namespace geometry { -void pybind_boundingvolume(py::module &m) { +void pybind_boundingvolume_declarations(py::module &m) { py::class_, std::shared_ptr, Geometry3D> oriented_bounding_box(m, "OrientedBoundingBox", "Class that defines an oriented box that can " "be computed from 3D geometries."); + py::class_, + std::shared_ptr, Geometry3D> + axis_aligned_bounding_box(m, "AxisAlignedBoundingBox", + "Class that defines an axis_aligned box " + "that can be computed from 3D " + "geometries, The axis aligned bounding " + "box uses the coordinate axes for " + "bounding box generation."); +} +void pybind_boundingvolume_definitions(py::module &m) { + auto oriented_bounding_box = static_cast< + py::class_, + std::shared_ptr, Geometry3D>>( + m.attr("OrientedBoundingBox")); py::detail::bind_default_constructor( oriented_bounding_box); py::detail::bind_copy_functions(oriented_bounding_box); @@ -62,13 +76,34 @@ The returned bounding box is an approximation to the minimal bounding box. Args: points (open3d.utility.Vector3dVector): Input points. - robust (bool): If set to true uses a more robust method which works in + robust (bool): If set to true uses a more robust method which works in degenerate cases but introduces noise to the points coordinates. Returns: open3d.geometry.OrientedBoundingBox: The oriented bounding box. The bounding box is oriented such that the axes are ordered with respect to the principal components. +)doc") + .def_static("create_from_points_minimal", + &OrientedBoundingBox::CreateFromPointsMinimal, + "points"_a, "robust"_a = false, + R"doc( +Creates the oriented bounding box with the smallest volume. + +The algorithm makes use of the fact that at least one edge of +the convex hull must be collinear with an edge of the minimum +bounding box: for each triangle in the convex hull, calculate +the minimal axis aligned box in the frame of that triangle. +at the end, return the box with the smallest volume + +Args: + points (open3d.utility.Vector3dVector): Input points. + robust (bool): If set to true uses a more robust method which works in + degenerate cases but introduces noise to the points coordinates. + +Returns: + open3d.geometry.OrientedBoundingBox: The oriented bounding box. The + bounding box is oriented such that its volume is minimized. )doc") .def("volume", &OrientedBoundingBox::Volume, "Returns the volume of the bounding box.") @@ -93,14 +128,10 @@ The returned bounding box is an approximation to the minimal bounding box. "AxisAlignedBoundingBox object from which OrientedBoundingBox is " "created."}}); - py::class_, - std::shared_ptr, Geometry3D> - axis_aligned_bounding_box(m, "AxisAlignedBoundingBox", - "Class that defines an axis_aligned box " - "that can be computed from 3D " - "geometries, The axis aligned bounding " - "box uses the coordinate axes for " - "bounding box generation."); + auto axis_aligned_bounding_box = static_cast, + std::shared_ptr, Geometry3D>>( + m.attr("AxisAlignedBoundingBox")); py::detail::bind_default_constructor( axis_aligned_bounding_box); py::detail::bind_copy_functions( diff --git a/cpp/pybind/geometry/geometry.cpp b/cpp/pybind/geometry/geometry.cpp index 8158c0de25c..ce1c21fb7c5 100644 --- a/cpp/pybind/geometry/geometry.cpp +++ b/cpp/pybind/geometry/geometry.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -14,7 +14,42 @@ namespace open3d { namespace geometry { -void pybind_geometry_classes(py::module &m) { +void pybind_geometry_classes_declarations(py::module &m) { + py::class_, std::shared_ptr> + geometry(m, "Geometry", "The base geometry class."); + py::enum_ geometry_type(geometry, "Type", + py::arithmetic()); + // Trick to write docs without listing the members in the enum class again. + geometry_type.attr("__doc__") = docstring::static_property( + py::cpp_function([](py::handle arg) -> std::string { + return "Enum class for Geometry types."; + }), + py::none(), py::none(), ""); + + geometry_type.value("Unspecified", Geometry::GeometryType::Unspecified) + .value("PointCloud", Geometry::GeometryType::PointCloud) + .value("VoxelGrid", Geometry::GeometryType::VoxelGrid) + .value("LineSet", Geometry::GeometryType::LineSet) + .value("TriangleMesh", Geometry::GeometryType::TriangleMesh) + .value("HalfEdgeTriangleMesh", + Geometry::GeometryType::HalfEdgeTriangleMesh) + .value("Image", Geometry::GeometryType::Image) + .value("RGBDImage", Geometry::GeometryType::RGBDImage) + .value("TetraMesh", Geometry::GeometryType::TetraMesh) + .export_values(); + py::class_, + std::shared_ptr, Geometry> + geometry3d(m, "Geometry3D", + "The base geometry class for 3D geometries."); + py::class_, + std::shared_ptr, Geometry> + geometry2d(m, "Geometry2D", + "The base geometry class for 2D geometries."); + + m.attr("m") = py::module_::import("typing").attr("TypeVar")("m"); + m.attr("n") = py::module_::import("typing").attr("TypeVar")("n"); +} +void pybind_geometry_classes_definitions(py::module &m) { // open3d.geometry functions m.def("get_rotation_matrix_from_xyz", &Geometry3D::GetRotationMatrixFromXYZ, "rotation"_a); @@ -34,8 +69,9 @@ void pybind_geometry_classes(py::module &m) { &Geometry3D::GetRotationMatrixFromQuaternion, "rotation"_a); // open3d.geometry.Geometry - py::class_, std::shared_ptr> - geometry(m, "Geometry", "The base geometry class."); + auto geometry = static_cast, + std::shared_ptr>>( + m.attr("Geometry")); geometry.def("clear", &Geometry::Clear, "Clear all elements in the geometry.") .def("is_empty", &Geometry::IsEmpty, @@ -48,33 +84,11 @@ void pybind_geometry_classes(py::module &m) { docstring::ClassMethodDocInject(m, "Geometry", "is_empty"); docstring::ClassMethodDocInject(m, "Geometry", "get_geometry_type"); docstring::ClassMethodDocInject(m, "Geometry", "dimension"); - - // open3d.geometry.Geometry.Type - py::enum_ geometry_type(geometry, "Type", - py::arithmetic()); - // Trick to write docs without listing the members in the enum class again. - geometry_type.attr("__doc__") = docstring::static_property( - py::cpp_function([](py::handle arg) -> std::string { - return "Enum class for Geometry types."; - }), - py::none(), py::none(), ""); - - geometry_type.value("Unspecified", Geometry::GeometryType::Unspecified) - .value("PointCloud", Geometry::GeometryType::PointCloud) - .value("VoxelGrid", Geometry::GeometryType::VoxelGrid) - .value("LineSet", Geometry::GeometryType::LineSet) - .value("TriangleMesh", Geometry::GeometryType::TriangleMesh) - .value("HalfEdgeTriangleMesh", - Geometry::GeometryType::HalfEdgeTriangleMesh) - .value("Image", Geometry::GeometryType::Image) - .value("RGBDImage", Geometry::GeometryType::RGBDImage) - .value("TetraMesh", Geometry::GeometryType::TetraMesh) - .export_values(); - - py::class_, - std::shared_ptr, Geometry> - geometry3d(m, "Geometry3D", - "The base geometry class for 3D geometries."); + // open3d.geometry.Geometry3D + auto geometry3d = + static_cast, + std::shared_ptr, Geometry>>( + m.attr("Geometry3D")); geometry3d .def("get_min_bound", &Geometry3D::GetMinBound, "Returns min bounds for geometry coordinates.") @@ -94,7 +108,7 @@ Computes the oriented bounding box based on the PCA of the convex hull. The returned bounding box is an approximation to the minimal bounding box. Args: - robust (bool): If set to true uses a more robust method which works in + robust (bool): If set to true uses a more robust method which works in degenerate cases but introduces noise to the points coordinates. Returns: @@ -192,10 +206,10 @@ at the end, return the box with the smallest volume {"center", "Rotation center used for transformation."}}); // open3d.geometry.Geometry2D - py::class_, - std::shared_ptr, Geometry> - geometry2d(m, "Geometry2D", - "The base geometry class for 2D geometries."); + auto geometry2d = + static_cast, + std::shared_ptr, Geometry>>( + m.attr("Geometry2D")); geometry2d .def("get_min_bound", &Geometry2D::GetMinBound, "Returns min bounds for geometry coordinates.") @@ -205,27 +219,38 @@ at the end, return the box with the smallest volume docstring::ClassMethodDocInject(m, "Geometry2D", "get_max_bound"); } -void pybind_geometry(py::module &m) { - py::module m_submodule = m.def_submodule("geometry"); - pybind_geometry_classes(m_submodule); - pybind_kdtreeflann(m_submodule); - pybind_pointcloud(m_submodule); - pybind_keypoint(m_submodule); - pybind_voxelgrid(m_submodule); - pybind_lineset(m_submodule); - pybind_meshbase(m_submodule); - pybind_trianglemesh(m_submodule); - pybind_halfedgetrianglemesh(m_submodule); - pybind_image(m_submodule); - pybind_tetramesh(m_submodule); - pybind_pointcloud_methods(m_submodule); - pybind_voxelgrid_methods(m_submodule); - pybind_meshbase_methods(m_submodule); - pybind_lineset_methods(m_submodule); - pybind_image_methods(m_submodule); - pybind_octree_methods(m_submodule); - pybind_octree(m_submodule); - pybind_boundingvolume(m_submodule); +void pybind_geometry_declarations(py::module &m) { + py::module m_geometry = m.def_submodule("geometry"); + pybind_geometry_classes_declarations(m_geometry); + pybind_kdtreeflann_declarations(m_geometry); + pybind_pointcloud_declarations(m_geometry); + pybind_keypoint_declarations(m_geometry); + pybind_voxelgrid_declarations(m_geometry); + pybind_lineset_declarations(m_geometry); + pybind_meshbase_declarations(m_geometry); + pybind_trianglemesh_declarations(m_geometry); + pybind_halfedgetrianglemesh_declarations(m_geometry); + pybind_image_declarations(m_geometry); + pybind_tetramesh_declarations(m_geometry); + pybind_octree_declarations(m_geometry); + pybind_boundingvolume_declarations(m_geometry); +} + +void pybind_geometry_definitions(py::module &m) { + auto m_geometry = static_cast(m.attr("geometry")); + pybind_geometry_classes_definitions(m_geometry); + pybind_kdtreeflann_definitions(m_geometry); + pybind_pointcloud_definitions(m_geometry); + pybind_keypoint_definitions(m_geometry); + pybind_voxelgrid_definitions(m_geometry); + pybind_lineset_definitions(m_geometry); + pybind_meshbase_definitions(m_geometry); + pybind_trianglemesh_definitions(m_geometry); + pybind_halfedgetrianglemesh_definitions(m_geometry); + pybind_image_definitions(m_geometry); + pybind_tetramesh_definitions(m_geometry); + pybind_octree_definitions(m_geometry); + pybind_boundingvolume_definitions(m_geometry); } } // namespace geometry diff --git a/cpp/pybind/geometry/geometry.h b/cpp/pybind/geometry/geometry.h index 41a9e31cd01..99733368a44 100644 --- a/cpp/pybind/geometry/geometry.h +++ b/cpp/pybind/geometry/geometry.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -12,27 +12,33 @@ namespace open3d { namespace geometry { -void pybind_geometry(py::module &m); +void pybind_geometry_declarations(py::module &m); +void pybind_kdtreeflann_declarations(py::module &m); +void pybind_pointcloud_declarations(py::module &m); +void pybind_keypoint_declarations(py::module &m); +void pybind_voxelgrid_declarations(py::module &m); +void pybind_lineset_declarations(py::module &m); +void pybind_meshbase_declarations(py::module &m); +void pybind_trianglemesh_declarations(py::module &m); +void pybind_halfedgetrianglemesh_declarations(py::module &m); +void pybind_image_declarations(py::module &m); +void pybind_tetramesh_declarations(py::module &m); +void pybind_octree_declarations(py::module &m); +void pybind_boundingvolume_declarations(py::module &m); -void pybind_pointcloud(py::module &m); -void pybind_keypoint(py::module &m); -void pybind_voxelgrid(py::module &m); -void pybind_lineset(py::module &m); -void pybind_meshbase(py::module &m); -void pybind_trianglemesh(py::module &m); -void pybind_halfedgetrianglemesh(py::module &m); -void pybind_image(py::module &m); -void pybind_tetramesh(py::module &m); -void pybind_kdtreeflann(py::module &m); -void pybind_pointcloud_methods(py::module &m); -void pybind_voxelgrid_methods(py::module &m); -void pybind_meshbase_methods(py::module &m); -void pybind_trianglemesh_methods(py::module &m); -void pybind_lineset_methods(py::module &m); -void pybind_image_methods(py::module &m); -void pybind_octree_methods(py::module &m); -void pybind_octree(py::module &m); -void pybind_boundingvolume(py::module &m); +void pybind_geometry_definitions(py::module &m); +void pybind_kdtreeflann_definitions(py::module &m); +void pybind_pointcloud_definitions(py::module &m); +void pybind_keypoint_definitions(py::module &m); +void pybind_voxelgrid_definitions(py::module &m); +void pybind_lineset_definitions(py::module &m); +void pybind_meshbase_definitions(py::module &m); +void pybind_trianglemesh_definitions(py::module &m); +void pybind_halfedgetrianglemesh_definitions(py::module &m); +void pybind_image_definitions(py::module &m); +void pybind_tetramesh_definitions(py::module &m); +void pybind_octree_definitions(py::module &m); +void pybind_boundingvolume_definitions(py::module &m); } // namespace geometry } // namespace open3d diff --git a/cpp/pybind/geometry/geometry_trampoline.h b/cpp/pybind/geometry/geometry_trampoline.h index f81a44f6d43..84afa97efbf 100644 --- a/cpp/pybind/geometry/geometry_trampoline.h +++ b/cpp/pybind/geometry/geometry_trampoline.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/pybind/geometry/halfedgetrianglemesh.cpp b/cpp/pybind/geometry/halfedgetrianglemesh.cpp index 437c4f12dfd..f25b9af893c 100644 --- a/cpp/pybind/geometry/halfedgetrianglemesh.cpp +++ b/cpp/pybind/geometry/halfedgetrianglemesh.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -16,11 +16,24 @@ namespace open3d { namespace geometry { -void pybind_half_edge(py::module &m) { +void pybind_half_edge(py::module &m) {} + +void pybind_halfedgetrianglemesh_declarations(py::module &m) { py::class_ half_edge( m, "HalfEdge", "HalfEdge class contains vertex, triangle info about a half edge, " "as well as relations of next and twin half edge."); + py::class_, + std::shared_ptr, MeshBase> + half_edge_triangle_mesh( + m, "HalfEdgeTriangleMesh", + "HalfEdgeTriangleMesh inherits TriangleMesh class with the " + "addition of HalfEdge data structure for each half edge in " + "the mesh as well as related functions."); +} +void pybind_halfedgetrianglemesh_definitions(py::module &m) { + auto half_edge = static_cast>( + m.attr("HalfEdge")); py::detail::bind_default_constructor( half_edge); py::detail::bind_copy_functions(half_edge); @@ -52,19 +65,12 @@ void pybind_half_edge(py::module &m) { "triangle_index", &HalfEdgeTriangleMesh::HalfEdge::triangle_index_, "int: Index of the triangle containing this half edge"); -} - -void pybind_halfedgetrianglemesh(py::module &m) { - pybind_half_edge(m); // open3d.geometry.HalfEdgeTriangleMesh - py::class_, - std::shared_ptr, MeshBase> - half_edge_triangle_mesh( - m, "HalfEdgeTriangleMesh", - "HalfEdgeTriangleMesh inherits TriangleMesh class with the " - "addition of HalfEdge data structure for each half edge in " - "the mesh as well as related functions."); + auto half_edge_triangle_mesh = static_cast< + py::class_, + std::shared_ptr, MeshBase>>( + m.attr("HalfEdgeTriangleMesh")); py::detail::bind_default_constructor( half_edge_triangle_mesh); py::detail::bind_copy_functions( diff --git a/cpp/pybind/geometry/image.cpp b/cpp/pybind/geometry/image.cpp index 70e63184e64..c53336b8068 100644 --- a/cpp/pybind/geometry/image.cpp +++ b/cpp/pybind/geometry/image.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -37,7 +37,7 @@ static const std::unordered_map "When ``True``, image in the pyramid will first be filtered " "by a 3x3 Gaussian kernel before downsampling."}}; -void pybind_image(py::module &m) { +void pybind_image_declarations(py::module &m) { py::enum_ image_filter_type(m, "ImageFilterType"); image_filter_type.value("Gaussian3", Image::FilterType::Gaussian3) .value("Gaussian5", Image::FilterType::Gaussian5) @@ -50,11 +50,22 @@ void pybind_image(py::module &m) { return "Enum class for Image filter types."; }), py::none(), py::none(), ""); - py::class_, std::shared_ptr, Geometry2D> image(m, "Image", py::buffer_protocol(), "The image class stores image with customizable width, " "height, num of channels and bytes per channel."); + py::class_, std::shared_ptr, + Geometry2D> + rgbd_image(m, "RGBDImage", + "RGBDImage is for a pair of registered color and depth " + "images, viewed from the same view, of the same " + "resolution. If you have other format, convert it " + "first."); +} +void pybind_image_definitions(py::module &m) { + auto image = static_cast, + std::shared_ptr, Geometry2D>>( + m.attr("Image")); py::detail::bind_default_constructor(image); py::detail::bind_copy_functions(image); image.def(py::init([](py::buffer b) { @@ -204,13 +215,10 @@ void pybind_image(py::module &m) { docstring::ClassMethodDocInject(m, "Image", "filter_pyramid", map_shared_argument_docstrings); - py::class_, std::shared_ptr, - Geometry2D> - rgbd_image(m, "RGBDImage", - "RGBDImage is for a pair of registered color and depth " - "images, viewed from the same view, of the same " - "resolution. If you have other format, convert it " - "first."); + auto rgbd_image = + static_cast, + std::shared_ptr, Geometry2D>>( + m.attr("RGBDImage")); py::detail::bind_default_constructor(rgbd_image); rgbd_image .def_readwrite("color", &RGBDImage::color_, @@ -275,7 +283,5 @@ void pybind_image(py::module &m) { map_shared_argument_docstrings); } -void pybind_image_methods(py::module &m) {} - } // namespace geometry } // namespace open3d diff --git a/cpp/pybind/geometry/kdtreeflann.cpp b/cpp/pybind/geometry/kdtreeflann.cpp index 785aa2a09f9..23e55e11861 100644 --- a/cpp/pybind/geometry/kdtreeflann.cpp +++ b/cpp/pybind/geometry/kdtreeflann.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -14,15 +14,9 @@ namespace open3d { namespace geometry { -void pybind_kdtreeflann(py::module &m) { - // open3d.geometry.KDTreeSearchParam +void pybind_kdtreeflann_declarations(py::module &m) { py::class_ kdtreesearchparam( m, "KDTreeSearchParam", "Base class for KDTree search parameters."); - kdtreesearchparam.def("get_search_type", &KDTreeSearchParam::GetSearchType, - "Get the search type (KNN, Radius, Hybrid) for the " - "search parameter."); - docstring::ClassMethodDocInject(m, "KDTreeSearchParam", "get_search_type"); - // open3d.geometry.KDTreeSearchParam.Type py::enum_ kdtree_search_param_type( kdtreesearchparam, "Type", py::arithmetic()); @@ -36,50 +30,70 @@ void pybind_kdtreeflann(py::module &m) { return "Enum class for Geometry types."; }), py::none(), py::none(), ""); - - // open3d.geometry.KDTreeSearchParamKNN py::class_ kdtreesearchparam_knn( m, "KDTreeSearchParamKNN", kdtreesearchparam, "KDTree search parameters for pure KNN search."); + py::class_ kdtreesearchparam_radius( + m, "KDTreeSearchParamRadius", kdtreesearchparam, + "KDTree search parameters for pure radius search."); + py::class_ kdtreesearchparam_hybrid( + m, "KDTreeSearchParamHybrid", kdtreesearchparam, + "KDTree search parameters for hybrid KNN and radius search."); + py::class_> kdtreeflann( + m, "KDTreeFlann", "KDTree with FLANN for nearest neighbor search."); +} + +void pybind_kdtreeflann_definitions(py::module &m) { + // open3d.geometry.KDTreeSearchParam + auto kdtreesearchparam = static_cast>( + m.attr("KDTreeSearchParam")); + kdtreesearchparam.def("get_search_type", &KDTreeSearchParam::GetSearchType, + "Get the search type (KNN, Radius, Hybrid) for the " + "search parameter."); + docstring::ClassMethodDocInject(m, "KDTreeSearchParam", "get_search_type"); + + // open3d.geometry.KDTreeSearchParamKNN + auto kdtreesearchparam_knn = static_cast>( + m.attr("KDTreeSearchParamKNN")); kdtreesearchparam_knn.def(py::init(), "knn"_a = 30) .def("__repr__", [](const KDTreeSearchParamKNN ¶m) { - return std::string( - "KDTreeSearchParamKNN with knn " - "= ") + - std::to_string(param.knn_); + return fmt::format( + "KDTreeSearchParamKNN(" + "knn={})", + param.knn_); }) .def_readwrite("knn", &KDTreeSearchParamKNN::knn_, "Number of the neighbors that will be searched."); // open3d.geometry.KDTreeSearchParamRadius - py::class_ kdtreesearchparam_radius( - m, "KDTreeSearchParamRadius", kdtreesearchparam, - "KDTree search parameters for pure radius search."); + auto kdtreesearchparam_radius = + static_cast>( + m.attr("KDTreeSearchParamRadius")); kdtreesearchparam_radius.def(py::init(), "radius"_a) .def("__repr__", [](const KDTreeSearchParamRadius ¶m) { - return std::string( - "KDTreeSearchParamRadius with " - "radius = ") + - std::to_string(param.radius_); + return fmt::format( + "KDTreeSearchParamRadius(" + "radius={})", + param.radius_); }) .def_readwrite("radius", &KDTreeSearchParamRadius::radius_, "Search radius."); // open3d.geometry.KDTreeSearchParamHybrid - py::class_ kdtreesearchparam_hybrid( - m, "KDTreeSearchParamHybrid", kdtreesearchparam, - "KDTree search parameters for hybrid KNN and radius search."); + auto kdtreesearchparam_hybrid = + static_cast>( + m.attr("KDTreeSearchParamHybrid")); kdtreesearchparam_hybrid .def(py::init(), "radius"_a, "max_nn"_a) .def("__repr__", [](const KDTreeSearchParamHybrid ¶m) { - return std::string( - "KDTreeSearchParamHybrid with " - "radius = ") + - std::to_string(param.radius_) + - " and max_nn = " + std::to_string(param.max_nn_); + return fmt::format( + "KDTreeSearchParamHybrid(" + "radius={}, " + "max_nn={})", + param.radius_, param.max_nn_); }) .def_readwrite("radius", &KDTreeSearchParamHybrid::radius_, "Search radius.") @@ -88,6 +102,8 @@ void pybind_kdtreeflann(py::module &m) { "At maximum, ``max_nn`` neighbors will be searched."); // open3d.geometry.KDTreeFlann + auto kdtreeflann = + static_cast>(m.attr("KDTreeFlann")); static const std::unordered_map map_kd_tree_flann_method_docs = { {"query", "The input query point."}, @@ -97,8 +113,6 @@ void pybind_kdtreeflann(py::module &m) { {"knn", "``knn`` neighbors will be searched."}, {"feature", "Feature data."}, {"data", "Matrix data."}}; - py::class_> kdtreeflann( - m, "KDTreeFlann", "KDTree with FLANN for nearest neighbor search."); kdtreeflann.def(py::init<>()) .def(py::init(), "data"_a) .def("set_matrix_data", &KDTreeFlann::SetMatrixData, diff --git a/cpp/pybind/geometry/keypoint.cpp b/cpp/pybind/geometry/keypoint.cpp index a4253670255..117a2eeefde 100644 --- a/cpp/pybind/geometry/keypoint.cpp +++ b/cpp/pybind/geometry/keypoint.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // @author Ignacio Vizzo [ivizzo@uni-bonn.de] @@ -19,17 +19,21 @@ namespace open3d { namespace geometry { -void pybind_keypoint_methods(py::module &m) { - m.def("compute_iss_keypoints", &keypoint::ComputeISSKeypoints, - "Function that computes the ISS keypoints from an input point " - "cloud. This implements the keypoint detection modules " - "proposed in Yu Zhong, 'Intrinsic Shape Signatures: A Shape " - "Descriptor for 3D Object Recognition', 2009.", - "input"_a, "salient_radius"_a = 0.0, "non_max_radius"_a = 0.0, - "gamma_21"_a = 0.975, "gamma_32"_a = 0.975, "min_neighbors"_a = 5); - +void pybind_keypoint_declarations(py::module &m) { + py::module m_keypoint = m.def_submodule("keypoint", "Keypoint Detectors."); +} +void pybind_keypoint_definitions(py::module &m) { + auto m_keypoint = static_cast(m.attr("keypoint")); + m_keypoint.def( + "compute_iss_keypoints", &keypoint::ComputeISSKeypoints, + "Function that computes the ISS keypoints from an input point " + "cloud. This implements the keypoint detection modules " + "proposed in Yu Zhong, 'Intrinsic Shape Signatures: A Shape " + "Descriptor for 3D Object Recognition', 2009.", + "input"_a, "salient_radius"_a = 0.0, "non_max_radius"_a = 0.0, + "gamma_21"_a = 0.975, "gamma_32"_a = 0.975, "min_neighbors"_a = 5); docstring::FunctionDocInject( - m, "compute_iss_keypoints", + m_keypoint, "compute_iss_keypoints", {{"input", "The Input point cloud."}, {"salient_radius", "The radius of the spherical neighborhood used to detect " @@ -49,10 +53,5 @@ void pybind_keypoint_methods(py::module &m) { "keypoint"}}); } -void pybind_keypoint(py::module &m) { - py::module m_submodule = m.def_submodule("keypoint", "Keypoint Detectors."); - pybind_keypoint_methods(m_submodule); -} - } // namespace geometry } // namespace open3d diff --git a/cpp/pybind/geometry/lineset.cpp b/cpp/pybind/geometry/lineset.cpp index 41e47a1c7ca..637bdc0ea36 100644 --- a/cpp/pybind/geometry/lineset.cpp +++ b/cpp/pybind/geometry/lineset.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -16,13 +16,19 @@ namespace open3d { namespace geometry { -void pybind_lineset(py::module &m) { +void pybind_lineset_declarations(py::module &m) { py::class_, std::shared_ptr, Geometry3D> lineset(m, "LineSet", "LineSet define a sets of lines in 3D. A typical " "application is to display the point cloud correspondence " "pairs."); +} +void pybind_lineset_definitions(py::module &m) { + auto lineset = + static_cast, + std::shared_ptr, Geometry3D>>( + m.attr("LineSet")); py::detail::bind_default_constructor(lineset); py::detail::bind_copy_functions(lineset); lineset.def(py::init &, @@ -125,7 +131,5 @@ void pybind_lineset(py::module &m) { {{"mesh", "The input tetra mesh."}}); } -void pybind_lineset_methods(py::module &m) {} - } // namespace geometry } // namespace open3d diff --git a/cpp/pybind/geometry/meshbase.cpp b/cpp/pybind/geometry/meshbase.cpp index cbc71520e4f..1f7657202df 100644 --- a/cpp/pybind/geometry/meshbase.cpp +++ b/cpp/pybind/geometry/meshbase.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -15,16 +15,13 @@ namespace open3d { namespace geometry { -void pybind_meshbase(py::module &m) { +void pybind_meshbase_declarations(py::module &m) { py::class_, std::shared_ptr, Geometry3D> meshbase(m, "MeshBase", "MeshBase class. Triangle mesh contains vertices. " "Optionally, the mesh " "may also contain vertex normals and vertex colors."); - py::detail::bind_default_constructor(meshbase); - py::detail::bind_copy_functions(meshbase); - py::enum_(m, "SimplificationContraction") .value("Average", MeshBase::SimplificationContraction::Average, @@ -33,7 +30,6 @@ void pybind_meshbase(py::module &m) { "The vertex positions are computed by minimizing the " "distance to the adjacent triangle planes.") .export_values(); - py::enum_(m, "FilterScope") .value("All", MeshBase::FilterScope::All, "All properties (color, normal, vertex position) are " @@ -45,7 +41,6 @@ void pybind_meshbase(py::module &m) { .value("Vertex", MeshBase::FilterScope::Vertex, "Only the vertex positions are filtered.") .export_values(); - py::enum_( m, "DeformAsRigidAsPossibleEnergy") .value("Spokes", MeshBase::DeformAsRigidAsPossibleEnergy::Spokes, @@ -55,6 +50,15 @@ void pybind_meshbase(py::module &m) { MeshBase::DeformAsRigidAsPossibleEnergy::Smoothed, "adds a rotation smoothing term to the rotations.") .export_values(); +} + +void pybind_meshbase_definitions(py::module &m) { + auto meshbase = + static_cast, + std::shared_ptr, Geometry3D>>( + m.attr("MeshBase")); + py::detail::bind_default_constructor(meshbase); + py::detail::bind_copy_functions(meshbase); meshbase.def("__repr__", [](const MeshBase &mesh) { @@ -101,7 +105,5 @@ void pybind_meshbase(py::module &m) { docstring::ClassMethodDocInject(m, "MeshBase", "compute_convex_hull"); } -void pybind_meshbase_methods(py::module &m) {} - } // namespace geometry } // namespace open3d diff --git a/cpp/pybind/geometry/octree.cpp b/cpp/pybind/geometry/octree.cpp index e9ebafae522..64001b7efab 100644 --- a/cpp/pybind/geometry/octree.cpp +++ b/cpp/pybind/geometry/octree.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -33,14 +33,52 @@ static const std::unordered_map "bigger than the original point cloud bounds to accommodate " "all points."}}; -void pybind_octree(py::module &m) { - // OctreeNodeInfo +void pybind_octree_declarations(py::module &m) { // Binds std::shared_ptr<...> to avoid non-allocated free in python code py::class_> octree_node_info(m, "OctreeNodeInfo", "OctreeNode's information. OctreeNodeInfo is " "computed on the fly, " "not stored with the Node."); + py::class_, + std::shared_ptr> + octree_node(m, "OctreeNode", "The base class for octree node."); + py::class_, + std::shared_ptr, OctreeNode> + octree_internal_node(m, "OctreeInternalNode", + "OctreeInternalNode class, containing " + "OctreeNode children."); + py::class_, + std::shared_ptr, OctreeInternalNode> + octree_internal_point_node( + m, "OctreeInternalPointNode", + "OctreeInternalPointNode class is an " + "OctreeInternalNode with a list of point " + "indices (from point cloud) belonging to " + "children of this node."); + py::class_, + std::shared_ptr, OctreeNode> + octree_leaf_node(m, "OctreeLeafNode", "OctreeLeafNode base class."); + py::class_, + std::shared_ptr, OctreeLeafNode> + octree_color_leaf_node(m, "OctreeColorLeafNode", + "OctreeColorLeafNode class is an " + "OctreeLeafNode containing color."); + py::class_, + std::shared_ptr, OctreeLeafNode> + octree_point_color_leaf_node(m, "OctreePointColorLeafNode", + "OctreePointColorLeafNode class is an " + "OctreeLeafNode containing color."); + py::class_, std::shared_ptr, + Geometry3D> + octree(m, "Octree", "Octree datastructure."); +} +void pybind_octree_definitions(py::module &m) { + // OctreeNodeInfo + auto octree_node_info = static_cast< + py::class_>>( + m.attr("OctreeNodeInfo")); octree_node_info.def(py::init([](const Eigen::Vector3d &origin, double size, size_t depth, size_t child_index) { return new OctreeNodeInfo(origin, size, depth, @@ -75,20 +113,20 @@ void pybind_octree(py::module &m) { docstring::ClassMethodDocInject(m, "OctreeNodeInfo", "__init__"); // OctreeNode - py::class_, - std::shared_ptr> - octree_node(m, "OctreeNode", "The base class for octree node."); + auto octree_node = + static_cast, + std::shared_ptr>>( + m.attr("OctreeNode")); octree_node.def("__repr__", [](const OctreeNode &octree_node) { return "OctreeNode instance."; }); docstring::ClassMethodDocInject(m, "OctreeNode", "__init__"); // OctreeInternalNode - py::class_, - std::shared_ptr, OctreeNode> - octree_internal_node(m, "OctreeInternalNode", - "OctreeInternalNode class, containing " - "OctreeNode children."); + auto octree_internal_node = static_cast< + py::class_, + std::shared_ptr, OctreeNode>>( + m.attr("OctreeInternalNode")); octree_internal_node .def("__repr__", [](const OctreeInternalNode &internal_node) { @@ -122,14 +160,10 @@ void pybind_octree(py::module &m) { docstring::ClassMethodDocInject(m, "OctreeInternalNode", "__init__"); // OctreeInternalPointNode - py::class_, - std::shared_ptr, OctreeInternalNode> - octree_internal_point_node( - m, "OctreeInternalPointNode", - "OctreeInternalPointNode class is an " - "OctreeInternalNode with a list of point " - "indices (from point cloud) belonging to " - "children of this node."); + auto octree_internal_point_node = static_cast, + std::shared_ptr, OctreeInternalNode>>( + m.attr("OctreeInternalPointNode")); octree_internal_point_node .def("__repr__", [](const OctreeInternalPointNode &internal_point_node) { @@ -172,9 +206,10 @@ void pybind_octree(py::module &m) { docstring::ClassMethodDocInject(m, "OctreeInternalPointNode", "__init__"); // OctreeLeafNode - py::class_, - std::shared_ptr, OctreeNode> - octree_leaf_node(m, "OctreeLeafNode", "OctreeLeafNode base class."); + auto octree_leaf_node = static_cast< + py::class_, + std::shared_ptr, OctreeNode>>( + m.attr("OctreeLeafNode")); octree_leaf_node .def("__repr__", [](const OctreeLeafNode &leaf_node) { @@ -189,11 +224,10 @@ void pybind_octree(py::module &m) { docstring::ClassMethodDocInject(m, "OctreeLeafNode", "__init__"); // OctreeColorLeafNode - py::class_, - std::shared_ptr, OctreeLeafNode> - octree_color_leaf_node(m, "OctreeColorLeafNode", - "OctreeColorLeafNode class is an " - "OctreeLeafNode containing color."); + auto octree_color_leaf_node = static_cast, + std::shared_ptr, OctreeLeafNode>>( + m.attr("OctreeColorLeafNode")); octree_color_leaf_node .def("__repr__", [](const OctreeColorLeafNode &color_leaf_node) { @@ -223,12 +257,12 @@ void pybind_octree(py::module &m) { octree_color_leaf_node); // OctreePointColorLeafNode - py::class_, - std::shared_ptr, OctreeLeafNode> - octree_point_color_leaf_node(m, "OctreePointColorLeafNode", - "OctreePointColorLeafNode class is an " - "OctreeLeafNode containing color."); + auto octree_point_color_leaf_node = + static_cast, + std::shared_ptr, + OctreeLeafNode>>( + m.attr("OctreePointColorLeafNode")); octree_point_color_leaf_node .def("__repr__", [](const OctreePointColorLeafNode &color_leaf_node) { @@ -264,9 +298,9 @@ void pybind_octree(py::module &m) { octree_point_color_leaf_node); // Octree - py::class_, std::shared_ptr, - Geometry3D> - octree(m, "Octree", "Octree datastructure."); + auto octree = static_cast, + std::shared_ptr, Geometry3D>>( + m.attr("Octree")); py::detail::bind_default_constructor(octree); py::detail::bind_copy_functions(octree); octree.def(py::init([](size_t max_depth) { return new Octree(max_depth); }), @@ -344,7 +378,5 @@ void pybind_octree(py::module &m) { {{"voxel_grid", "geometry.VoxelGrid: The source voxel grid."}}); } -void pybind_octree_methods(py::module &m) {} - } // namespace geometry } // namespace open3d diff --git a/cpp/pybind/geometry/octree.h b/cpp/pybind/geometry/octree.h index 4dbe5cd44aa..5d488fbdfd1 100644 --- a/cpp/pybind/geometry/octree.h +++ b/cpp/pybind/geometry/octree.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/pybind/geometry/pointcloud.cpp b/cpp/pybind/geometry/pointcloud.cpp index 2af8319e93d..2dbb4c741d3 100644 --- a/cpp/pybind/geometry/pointcloud.cpp +++ b/cpp/pybind/geometry/pointcloud.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -19,13 +19,20 @@ namespace open3d { namespace geometry { -void pybind_pointcloud(py::module &m) { +void pybind_pointcloud_declarations(py::module &m) { py::class_, std::shared_ptr, Geometry3D> pointcloud(m, "PointCloud", "PointCloud class. A point cloud consists of point " "coordinates, and optionally point colors and point " "normals."); +} + +void pybind_pointcloud_definitions(py::module &m) { + auto pointcloud = + static_cast, + std::shared_ptr, Geometry3D>>( + m.attr("PointCloud")); py::detail::bind_default_constructor(pointcloud); py::detail::bind_copy_functions(pointcloud); pointcloud @@ -83,7 +90,11 @@ void pybind_pointcloud(py::module &m) { "set of points has farthest distance. The sample is performed " "by selecting the farthest point from previous selected " "points iteratively.", - "num_samples"_a) + "num_samples"_a, + "Index to start downsampling from. Valid index is a " + "non-negative number less than number of points in the " + "input pointcloud.", + "start_index"_a = 0) .def("crop", (std::shared_ptr(PointCloud::*)( const AxisAlignedBoundingBox &, bool) const) & @@ -413,7 +424,5 @@ camera. Given depth value d at (u, v) image coordinate, the corresponding 3d poi {"extrnsic", "Extrinsic parameters of the camera."}}); } -void pybind_pointcloud_methods(py::module &m) {} - } // namespace geometry } // namespace open3d diff --git a/cpp/pybind/geometry/tetramesh.cpp b/cpp/pybind/geometry/tetramesh.cpp index 5ef8ce0d757..fd2077ac1d8 100644 --- a/cpp/pybind/geometry/tetramesh.cpp +++ b/cpp/pybind/geometry/tetramesh.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -15,16 +15,22 @@ namespace open3d { namespace geometry { -void pybind_tetramesh(py::module &m) { +void pybind_tetramesh_declarations(py::module &m) { py::class_, std::shared_ptr, MeshBase> trianglemesh(m, "TetraMesh", "TetraMesh class. Tetra mesh contains vertices " "and tetrahedra represented by the indices to the " "vertices."); - py::detail::bind_default_constructor(trianglemesh); - py::detail::bind_copy_functions(trianglemesh); - trianglemesh +} +void pybind_tetramesh_definitions(py::module &m) { + auto tetramesh = + static_cast, + std::shared_ptr, MeshBase>>( + m.attr("TetraMesh")); + py::detail::bind_default_constructor(tetramesh); + py::detail::bind_copy_functions(tetramesh); + tetramesh .def(py::init &, const std::vector &>(), @@ -95,7 +101,5 @@ void pybind_tetramesh(py::module &m) { {{"point_cloud", "A PointCloud."}}); } -void pybind_tetramesh_methods(py::module &m) {} - } // namespace geometry } // namespace open3d diff --git a/cpp/pybind/geometry/trianglemesh.cpp b/cpp/pybind/geometry/trianglemesh.cpp index 311aa311b86..452736626d2 100644 --- a/cpp/pybind/geometry/trianglemesh.cpp +++ b/cpp/pybind/geometry/trianglemesh.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -16,7 +16,7 @@ namespace open3d { namespace geometry { -void pybind_trianglemesh(py::module &m) { +void pybind_trianglemesh_declarations(py::module &m) { py::class_, std::shared_ptr, MeshBase> trianglemesh(m, "TriangleMesh", @@ -24,6 +24,12 @@ void pybind_trianglemesh(py::module &m) { "and triangles represented by the indices to the " "vertices. Optionally, the mesh may also contain " "triangle normals, vertex normals and vertex colors."); +} +void pybind_trianglemesh_definitions(py::module &m) { + auto trianglemesh = + static_cast, + std::shared_ptr, MeshBase>>( + m.attr("TriangleMesh")); py::detail::bind_default_constructor(trianglemesh); py::detail::bind_copy_functions(trianglemesh); trianglemesh @@ -104,7 +110,8 @@ void pybind_trianglemesh(py::module &m) { ":math:`v_o = v_i x strength (v_i * |N| - \\sum_{n \\in N} " "v_n)`", "number_of_iterations"_a = 1, "strength"_a = 1, - "filter_scope"_a = MeshBase::FilterScope::All) + py::arg_v("filter_scope", MeshBase::FilterScope::All, + "FilterScope.All")) .def("filter_smooth_simple", &TriangleMesh::FilterSmoothSimple, "Function to smooth triangle mesh with simple neighbour " "average. :math:`v_o = \\frac{v_i + \\sum_{n \\in N} " @@ -112,7 +119,8 @@ void pybind_trianglemesh(py::module &m) { ":math:`v_o` the output value, and :math:`N` is the set of " "adjacent neighbours.", "number_of_iterations"_a = 1, - "filter_scope"_a = MeshBase::FilterScope::All) + py::arg_v("filter_scope", MeshBase::FilterScope::All, + "FilterScope.All")) .def("filter_smooth_laplacian", &TriangleMesh::FilterSmoothLaplacian, "Function to smooth triangle mesh using Laplacian. :math:`v_o " @@ -123,7 +131,8 @@ void pybind_trianglemesh(py::module &m) { "inverse distance (closer neighbours have higher weight), and " "lambda_filter is the smoothing parameter.", "number_of_iterations"_a = 1, "lambda_filter"_a = 0.5, - "filter_scope"_a = MeshBase::FilterScope::All) + py::arg_v("filter_scope", MeshBase::FilterScope::All, + "FilterScope.All")) .def("filter_smooth_taubin", &TriangleMesh::FilterSmoothTaubin, "Function to smooth triangle mesh using method of Taubin, " "\"Curve and Surface Smoothing Without Shrinkage\", 1995. " @@ -133,7 +142,9 @@ void pybind_trianglemesh(py::module &m) { "parameter mu as smoothing parameter. This method avoids " "shrinkage of the triangle mesh.", "number_of_iterations"_a = 1, "lambda_filter"_a = 0.5, - "mu"_a = -0.53, "filter_scope"_a = MeshBase::FilterScope::All) + "mu"_a = -0.53, + py::arg_v("filter_scope", MeshBase::FilterScope::All, + "FilterScope.All")) .def("has_vertices", &TriangleMesh::HasVertices, "Returns ``True`` if the mesh contains vertices.") .def("has_triangles", &TriangleMesh::HasTriangles, @@ -244,7 +255,9 @@ void pybind_trianglemesh(py::module &m) { &TriangleMesh::SimplifyVertexClustering, "Function to simplify mesh using vertex clustering.", "voxel_size"_a, - "contraction"_a = MeshBase::SimplificationContraction::Average) + py::arg_v("contraction", + MeshBase::SimplificationContraction::Average, + "SimplificationContraction.Average")) .def("simplify_quadric_decimation", &TriangleMesh::SimplifyQuadricDecimation, "Function to simplify mesh using Quadric Error Metric " @@ -292,7 +305,9 @@ void pybind_trianglemesh(py::module &m) { "'As-Rigid-As-Possible Surface Modeling', 2007", "constraint_vertex_indices"_a, "constraint_vertex_positions"_a, "max_iter"_a, - "energy"_a = MeshBase::DeformAsRigidAsPossibleEnergy::Spokes, + py::arg_v("energy", + MeshBase::DeformAsRigidAsPossibleEnergy::Spokes, + "DeformAsRigidAsPossibleEnergy.Spokes"), "smoothed_alpha"_a = 0.01) .def_static( "create_from_point_cloud_alpha_shape", @@ -779,7 +794,5 @@ void pybind_trianglemesh(py::module &m) { {"scale", "Scale the complete Mobius strip."}}); } -void pybind_trianglemesh_methods(py::module &m) {} - } // namespace geometry } // namespace open3d diff --git a/cpp/pybind/geometry/voxelgrid.cpp b/cpp/pybind/geometry/voxelgrid.cpp index a50efa8c17b..8cf66ce8a95 100644 --- a/cpp/pybind/geometry/voxelgrid.cpp +++ b/cpp/pybind/geometry/voxelgrid.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -20,9 +20,18 @@ namespace open3d { namespace geometry { -void pybind_voxelgrid(py::module &m) { +void pybind_voxelgrid_declarations(py::module &m) { py::class_> voxel( m, "Voxel", "Base Voxel class, containing grid id and color"); + py::class_, std::shared_ptr, + Geometry3D> + voxelgrid(m, "VoxelGrid", + "VoxelGrid is a collection of voxels which are aligned " + "in grid."); +} +void pybind_voxelgrid_definitions(py::module &m) { + auto voxel = static_cast>>( + m.attr("Voxel")); py::detail::bind_default_constructor(voxel); py::detail::bind_copy_functions(voxel); voxel.def("__repr__", @@ -50,12 +59,10 @@ void pybind_voxelgrid(py::module &m) { .def_readwrite( "color", &Voxel::color_, "Float64 numpy array of shape (3,): Color of the voxel."); - - py::class_, std::shared_ptr, - Geometry3D> - voxelgrid(m, "VoxelGrid", - "VoxelGrid is a collection of voxels which are aligned " - "in grid."); + auto voxelgrid = + static_cast, + std::shared_ptr, Geometry3D>>( + m.attr("VoxelGrid")); py::detail::bind_default_constructor(voxelgrid); py::detail::bind_copy_functions(voxelgrid); voxelgrid @@ -230,7 +237,5 @@ void pybind_voxelgrid(py::module &m) { "Maximum boundary point for the VoxelGrid to create."}}); } -void pybind_voxelgrid_methods(py::module &m) {} - } // namespace geometry } // namespace open3d diff --git a/cpp/pybind/io/class_io.cpp b/cpp/pybind/io/class_io.cpp index 2ba0f6fad88..e422af14654 100644 --- a/cpp/pybind/io/class_io.cpp +++ b/cpp/pybind/io/class_io.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -83,7 +83,7 @@ static const std::unordered_map "If set to true a progress bar is visualized in the console"}, }; -void pybind_class_io(py::module &m_io) { +void pybind_class_io_declarations(py::module &m_io) { py::enum_ geom_type(m_io, "FileGeometry", py::arithmetic()); // Trick to write docs without listing the members in the enum class again. geom_type.attr("__doc__") = docstring::static_property( @@ -96,6 +96,8 @@ void pybind_class_io(py::module &m_io) { .value("CONTAINS_LINES", FileGeometry::CONTAINS_LINES) .value("CONTAINS_TRIANGLES", FileGeometry::CONTAINS_TRIANGLES) .export_values(); +} +void pybind_class_io_definitions(py::module &m_io) { m_io.def( "read_file_geometry_type", &ReadFileGeometryType, "Returns the type of geometry of the file. This is a faster way of " diff --git a/cpp/pybind/io/io.cpp b/cpp/pybind/io/io.cpp index 63afc83e85a..fd6efd919de 100644 --- a/cpp/pybind/io/io.cpp +++ b/cpp/pybind/io/io.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -12,12 +12,21 @@ namespace open3d { namespace io { -void pybind_io(py::module &m) { +void pybind_io_declarations(py::module &m) { py::module m_io = m.def_submodule("io"); - pybind_class_io(m_io); - pybind_rpc(m_io); + pybind_class_io_declarations(m_io); + pybind_rpc_declarations(m_io); #ifdef BUILD_AZURE_KINECT - pybind_sensor(m_io); + pybind_sensor_declarations(m_io); +#endif +} + +void pybind_io_definitions(py::module &m) { + auto m_io = static_cast(m.attr("io")); + pybind_class_io_definitions(m_io); + pybind_rpc_definitions(m_io); +#ifdef BUILD_AZURE_KINECT + pybind_sensor_definitions(m_io); #endif } diff --git a/cpp/pybind/io/io.h b/cpp/pybind/io/io.h index 6d54dfeada1..bf8720a8e98 100644 --- a/cpp/pybind/io/io.h +++ b/cpp/pybind/io/io.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -12,14 +12,18 @@ namespace open3d { namespace io { -void pybind_io(py::module& m); - -void pybind_class_io(py::module& m); - -void pybind_rpc(py::module& m); +void pybind_io_declarations(py::module& m); +void pybind_class_io_declarations(py::module& m); +void pybind_rpc_declarations(py::module& m); +#ifdef BUILD_AZURE_KINECT +void pybind_sensor_declarations(py::module& m); +#endif +void pybind_io_definitions(py::module& m); +void pybind_class_io_definitions(py::module& m); +void pybind_rpc_definitions(py::module& m); #ifdef BUILD_AZURE_KINECT -void pybind_sensor(py::module& m); +void pybind_sensor_definitions(py::module& m); #endif } // namespace io diff --git a/cpp/pybind/io/rpc.cpp b/cpp/pybind/io/rpc.cpp index 8d04d1265c9..9871e4ec968 100644 --- a/cpp/pybind/io/rpc.cpp +++ b/cpp/pybind/io/rpc.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -18,47 +18,58 @@ namespace open3d { namespace io { -void pybind_rpc(py::module& m_io) { - py::module m = m_io.def_submodule("rpc"); - - // this is to cleanly shutdown the zeromq context on windows. - auto atexit = py::module::import("atexit"); - atexit.attr("register")( - py::cpp_function([]() { rpc::DestroyZMQContext(); })); - +void pybind_rpc_declarations(py::module& m_io) { + py::module m_rpc = m_io.def_submodule("rpc"); py::class_>( - m, "_ConnectionBase"); - + m_rpc, "_ConnectionBase"); py::class_, - rpc::ConnectionBase>(m, "Connection", R"doc( + rpc::ConnectionBase>(m_rpc, "Connection", R"doc( The default connection class which uses a ZeroMQ socket. -)doc") - .def(py::init([](std::string address, int connect_timeout, - int timeout) { - return std::shared_ptr( - new rpc::Connection(address, connect_timeout, - timeout)); - }), - "Creates a connection object", - "address"_a = "tcp://127.0.0.1:51454", - "connect_timeout"_a = 5000, "timeout"_a = 10000); - +)doc"); py::class_, - rpc::ConnectionBase>(m, "BufferConnection", R"doc( + rpc::ConnectionBase>(m_rpc, "BufferConnection", R"doc( A connection writing to a memory buffer. -)doc") - .def(py::init<>()) +)doc"); + py::class_>( + m_rpc, "_DummyReceiver", + "Dummy receiver for the server side receiving requests from a " + "client."); +} +void pybind_rpc_definitions(py::module& m_io) { + auto m_rpc = static_cast(m_io.attr("rpc")); + // this is to cleanly shutdown the zeromq context on windows. + auto atexit = py::module::import("atexit"); + atexit.attr("register")( + py::cpp_function([]() { rpc::DestroyZMQContext(); })); + auto connection = static_cast< + py::class_, + rpc::ConnectionBase>>(m_rpc.attr("Connection")); + connection.def( + py::init([](std::string address, int connect_timeout, int timeout) { + return std::shared_ptr( + new rpc::Connection(address, connect_timeout, timeout)); + }), + "Creates a connection object", + "address"_a = "tcp://127.0.0.1:51454", "connect_timeout"_a = 5000, + "timeout"_a = 10000); + + auto buffer_connection = + static_cast, + rpc::ConnectionBase>>( + m_rpc.attr("BufferConnection")); + buffer_connection.def(py::init<>()) .def( "get_buffer", [](const rpc::BufferConnection& self) { return py::bytes(self.buffer().str()); }, "Returns a copy of the buffer."); - - py::class_>( - m, "_DummyReceiver", - "Dummy receiver for the server side receiving requests from a " - "client.") + auto dummy_receiver = + static_cast>>( + m_rpc.attr("_DummyReceiver")); + dummy_receiver .def(py::init([](std::string address, int timeout) { return std::shared_ptr( new rpc::DummyReceiver(address, timeout)); @@ -73,15 +84,15 @@ A connection writing to a memory buffer. "function blocks until the mainloop is done with processing " "messages that have already been received."); - m.def("destroy_zmq_context", &rpc::DestroyZMQContext, - "Destroys the ZMQ context."); + m_rpc.def("destroy_zmq_context", &rpc::DestroyZMQContext, + "Destroys the ZMQ context."); - m.def("set_point_cloud", &rpc::SetPointCloud, "pcd"_a, "path"_a = "", - "time"_a = 0, "layer"_a = "", - "connection"_a = std::shared_ptr(), - "Sends a point cloud message to a viewer."); + m_rpc.def("set_point_cloud", &rpc::SetPointCloud, "pcd"_a, "path"_a = "", + "time"_a = 0, "layer"_a = "", + "connection"_a = std::shared_ptr(), + "Sends a point cloud message to a viewer."); docstring::FunctionDocInject( - m, "set_point_cloud", + m_rpc, "set_point_cloud", { {"pcd", "Point cloud object."}, {"path", "A path descriptor, e.g., 'mygroup/points'."}, @@ -92,14 +103,14 @@ A connection writing to a memory buffer. "the connection."}, }); - m.def("set_triangle_mesh", - py::overload_cast>( - &rpc::SetTriangleMesh), - "mesh"_a, "path"_a = "", "time"_a = 0, "layer"_a = "", - "connection"_a = std::shared_ptr(), - R"doc(Sends a triangle mesh to a viewer. + m_rpc.def("set_triangle_mesh", + py::overload_cast>( + &rpc::SetTriangleMesh), + "mesh"_a, "path"_a = "", "time"_a = 0, "layer"_a = "", + "connection"_a = std::shared_ptr(), + R"doc(Sends a triangle mesh to a viewer. Args: mesh (o3d.geometry.TriangleMesh): The triangle mesh. path (str): The path in the scene graph. @@ -111,14 +122,14 @@ A connection writing to a memory buffer. Returns True if the data was successfully received. )doc"); - m.def("set_triangle_mesh", - py::overload_cast>( - &rpc::SetTriangleMesh), - "mesh"_a, "path"_a = "", "time"_a = 0, "layer"_a = "", - "connection"_a = std::shared_ptr(), - R"doc(Sends a triangle mesh to a viewer. + m_rpc.def("set_triangle_mesh", + py::overload_cast>( + &rpc::SetTriangleMesh), + "mesh"_a, "path"_a = "", "time"_a = 0, "layer"_a = "", + "connection"_a = std::shared_ptr(), + R"doc(Sends a triangle mesh to a viewer. Args: mesh (o3d.t.geometry.TriangleMesh): The triangle mesh. path (str): The path in the scene graph. @@ -130,23 +141,23 @@ A connection writing to a memory buffer. Returns True if the data was successfully received. )doc"); - m.def("set_mesh_data", &rpc::SetMeshData, "path"_a = "", "time"_a = 0, - "layer"_a = "", "vertices"_a = core::Tensor({0}, core::Float32), - "vertex_attributes"_a = std::map(), - "faces"_a = core::Tensor({0}, core::Int32), - "face_attributes"_a = std::map(), - "lines"_a = core::Tensor({0}, core::Int32), - "line_attributes"_a = std::map(), - "material"_a = "", - "material_scalar_attributes"_a = std::map(), - "material_vector_attributes"_a = - std::map(), - "texture_maps"_a = std::map(), - "o3d_type"_a = "", - "connection"_a = std::shared_ptr(), - "Sends a set_mesh_data message."); + m_rpc.def("set_mesh_data", &rpc::SetMeshData, "path"_a = "", "time"_a = 0, + "layer"_a = "", "vertices"_a = core::Tensor({0}, core::Float32), + "vertex_attributes"_a = std::map(), + "faces"_a = core::Tensor({0}, core::Int32), + "face_attributes"_a = std::map(), + "lines"_a = core::Tensor({0}, core::Int32), + "line_attributes"_a = std::map(), + "material"_a = "", + "material_scalar_attributes"_a = std::map(), + "material_vector_attributes"_a = + std::map(), + "texture_maps"_a = std::map(), + "o3d_type"_a = "", + "connection"_a = std::shared_ptr(), + "Sends a set_mesh_data message."); docstring::FunctionDocInject( - m, "set_mesh_data", + m_rpc, "set_mesh_data", { {"path", "A path descriptor, e.g., 'mygroup/points'."}, {"time", "The time associated with this data."}, @@ -181,12 +192,12 @@ A connection writing to a memory buffer. "the connection."}, }); - m.def("set_legacy_camera", &rpc::SetLegacyCamera, "camera"_a, "path"_a = "", - "time"_a = 0, "layer"_a = "", - "connection"_a = std::shared_ptr(), - "Sends a PinholeCameraParameters object."); + m_rpc.def("set_legacy_camera", &rpc::SetLegacyCamera, "camera"_a, + "path"_a = "", "time"_a = 0, "layer"_a = "", + "connection"_a = std::shared_ptr(), + "Sends a PinholeCameraParameters object."); docstring::FunctionDocInject( - m, "set_legacy_camera", + m_rpc, "set_legacy_camera", { {"path", "A path descriptor, e.g., 'mygroup/camera'."}, {"time", "The time associated with this data."}, @@ -196,11 +207,11 @@ A connection writing to a memory buffer. "the connection."}, }); - m.def("set_time", &rpc::SetTime, "time"_a, - "connection"_a = std::shared_ptr(), - "Sets the time in the external visualizer."); + m_rpc.def("set_time", &rpc::SetTime, "time"_a, + "connection"_a = std::shared_ptr(), + "Sets the time in the external visualizer."); docstring::FunctionDocInject( - m, "set_time", + m_rpc, "set_time", { {"time", "The time value to set."}, {"connection", @@ -208,11 +219,11 @@ A connection writing to a memory buffer. "the connection."}, }); - m.def("set_active_camera", &rpc::SetActiveCamera, "path"_a, - "connection"_a = std::shared_ptr(), - "Sets the object with the specified path as the active camera."); + m_rpc.def("set_active_camera", &rpc::SetActiveCamera, "path"_a, + "connection"_a = std::shared_ptr(), + "Sets the object with the specified path as the active camera."); docstring::FunctionDocInject( - m, "set_active_camera", + m_rpc, "set_active_camera", { {"path", "A path descriptor, e.g., 'mygroup/camera'."}, {"connection", @@ -220,8 +231,8 @@ A connection writing to a memory buffer. "the connection."}, }); - m.def("data_buffer_to_meta_geometry", &rpc::DataBufferToMetaGeometry, - "data"_a, R"doc( + m_rpc.def("data_buffer_to_meta_geometry", &rpc::DataBufferToMetaGeometry, + "data"_a, R"doc( This function returns the geometry, the path and the time stored in a SetMeshData message. data must contain the Request header message followed by the SetMeshData message. The function returns None for the geometry if not diff --git a/cpp/pybind/io/sensor.cpp b/cpp/pybind/io/sensor.cpp index 3b07e0d10a5..9ee5dd0ebc8 100644 --- a/cpp/pybind/io/sensor.cpp +++ b/cpp/pybind/io/sensor.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -16,7 +16,19 @@ namespace open3d { namespace io { -void pybind_sensor(py::module &m) { +void pybind_sensor_declarations(py::module &m) { + py::class_ azure_kinect_sensor_config( + m, "AzureKinectSensorConfig", "AzureKinect sensor configuration."); + py::class_ azure_kinect_mkv_metadata( + m, "AzureKinectMKVMetadata", "AzureKinect mkv metadata."); + py::class_ azure_kinect_sensor(m, "AzureKinectSensor", + "AzureKinect sensor."); + py::class_ azure_kinect_recorder( + m, "AzureKinectRecorder", "AzureKinect recorder."); + py::class_ azure_kinect_mkv_reader( + m, "AzureKinectMKVReader", "AzureKinect mkv file reader."); +} +void pybind_sensor_definitions(py::module &m) { static const std::unordered_map map_shared_argument_docstrings = { {"sensor_index", "The selected device index."}, @@ -29,8 +41,9 @@ void pybind_sensor(py::module &m) { "visualizer."}}; // Class kinect config - py::class_ azure_kinect_sensor_config( - m, "AzureKinectSensorConfig", "AzureKinect sensor configuration."); + auto azure_kinect_sensor_config = + static_cast>( + m.attr("AzureKinectSensorConfig")); py::detail::bind_default_constructor( azure_kinect_sensor_config); azure_kinect_sensor_config.def( @@ -39,9 +52,8 @@ void pybind_sensor(py::module &m) { return new AzureKinectSensorConfig(config); }), "config"_a); - - py::class_ azure_kinect_mkv_metadata( - m, "AzureKinectMKVMetadata", "AzureKinect mkv metadata."); + auto azure_kinect_mkv_metadata = static_cast>( + m.attr("AzureKinectMKVMetadata")); py::detail::bind_default_constructor( azure_kinect_mkv_metadata); azure_kinect_mkv_metadata @@ -53,9 +65,8 @@ void pybind_sensor(py::module &m) { "Length of the video (usec)"); // Class sensor - py::class_ azure_kinect_sensor(m, "AzureKinectSensor", - "AzureKinect sensor."); - + auto azure_kinect_sensor = static_cast>( + m.attr("AzureKinectSensor")); azure_kinect_sensor.def( py::init([](const AzureKinectSensorConfig &sensor_config) { return new AzureKinectSensor(sensor_config); @@ -78,9 +89,8 @@ void pybind_sensor(py::module &m) { map_shared_argument_docstrings); // Class recorder - py::class_ azure_kinect_recorder( - m, "AzureKinectRecorder", "AzureKinect recorder."); - + auto azure_kinect_recorder = static_cast>( + m.attr("AzureKinectRecorder")); azure_kinect_recorder.def( py::init([](const AzureKinectSensorConfig &sensor_config, size_t sensor_index) { @@ -113,8 +123,8 @@ void pybind_sensor(py::module &m) { map_shared_argument_docstrings); // Class mkv reader - py::class_ azure_kinect_mkv_reader( - m, "AzureKinectMKVReader", "AzureKinect mkv file reader."); + auto azure_kinect_mkv_reader = + static_cast>(m.attr("AzureKinectMKVReader")); azure_kinect_mkv_reader.def(py::init([]() { return MKVReader(); })); azure_kinect_mkv_reader .def("is_opened", &MKVReader::IsOpened, diff --git a/cpp/pybind/make_python_package.cmake b/cpp/pybind/make_python_package.cmake index dee6e394d36..01e0d5663f5 100644 --- a/cpp/pybind/make_python_package.cmake +++ b/cpp/pybind/make_python_package.cmake @@ -37,7 +37,11 @@ endforeach() foreach(PYTHON_EXTRA_LIB ${PYTHON_EXTRA_LIBRARIES}) get_filename_component(PYTHON_EXTRA_LIB_REAL ${PYTHON_EXTRA_LIB} REALPATH) get_filename_component(SO_VER_NAME ${PYTHON_EXTRA_LIB_REAL} NAME) - string(REGEX REPLACE "\\.so\\.1\\..*" ".so.1" SO_1_NAME ${SO_VER_NAME}) + if (APPLE) + string(REGEX REPLACE "\\.([0-9]+)\\..*.dylib" ".\\1.dylib" SO_1_NAME ${SO_VER_NAME}) + elseif (UNIX) + string(REGEX REPLACE "\\.so\\.([0-9]+)\\..*" ".so.\\1" SO_1_NAME ${SO_VER_NAME}) + endif() configure_file(${PYTHON_EXTRA_LIB_REAL} ${PYTHON_PACKAGE_DST_DIR}/open3d/${SO_1_NAME} COPYONLY) endforeach() diff --git a/cpp/pybind/ml/contrib/contrib.cpp b/cpp/pybind/ml/contrib/contrib.cpp index 9ed422ee12d..70b0a83d610 100644 --- a/cpp/pybind/ml/contrib/contrib.cpp +++ b/cpp/pybind/ml/contrib/contrib.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -15,11 +15,13 @@ namespace open3d { namespace ml { namespace contrib { -void pybind_contrib(py::module& m) { +void pybind_contrib_declarations(py::module& m) { py::module m_contrib = m.def_submodule("contrib"); - - pybind_contrib_subsample(m_contrib); - pybind_contrib_iou(m_contrib); +} +void pybind_contrib_definitions(py::module& m) { + auto m_contrib = static_cast(m.attr("contrib")); + pybind_contrib_subsample_definitions(m_contrib); + pybind_contrib_iou_definitions(m_contrib); } } // namespace contrib diff --git a/cpp/pybind/ml/contrib/contrib.h b/cpp/pybind/ml/contrib/contrib.h index 9caff96487b..453218485d5 100644 --- a/cpp/pybind/ml/contrib/contrib.h +++ b/cpp/pybind/ml/contrib/contrib.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -14,9 +14,11 @@ namespace open3d { namespace ml { namespace contrib { -void pybind_contrib(py::module &m); -void pybind_contrib_subsample(py::module &m_contrib); -void pybind_contrib_iou(py::module &m_contrib); +void pybind_contrib_declarations(py::module &m); + +void pybind_contrib_definitions(py::module &m); +void pybind_contrib_subsample_definitions(py::module &m_contrib); +void pybind_contrib_iou_definitions(py::module &m_contrib); } // namespace contrib } // namespace ml diff --git a/cpp/pybind/ml/contrib/contrib_subsample.cpp b/cpp/pybind/ml/contrib/contrib_subsample.cpp index b7946a69451..982ba2489f8 100644 --- a/cpp/pybind/ml/contrib/contrib_subsample.cpp +++ b/cpp/pybind/ml/contrib/contrib_subsample.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -343,7 +343,7 @@ const py::object Subsample(py::array points, } } -void pybind_contrib_subsample(py::module& m_contrib) { +void pybind_contrib_subsample_definitions(py::module& m_contrib) { m_contrib.def("subsample", &Subsample, "points"_a, "features"_a = py::none(), "classes"_a = py::none(), "sampleDl"_a = 0.1, "verbose"_a = 0); diff --git a/cpp/pybind/ml/contrib/iou.cpp b/cpp/pybind/ml/contrib/iou.cpp index 1f14af19814..0b590d2e2d5 100644 --- a/cpp/pybind/ml/contrib/iou.cpp +++ b/cpp/pybind/ml/contrib/iou.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -117,7 +117,7 @@ py::array Iou3dCUDA(py::array boxes_a, py::array boxes_b) { } #endif -void pybind_contrib_iou(py::module& m_contrib) { +void pybind_contrib_iou_definitions(py::module& m_contrib) { m_contrib.def("iou_bev_cpu", &IouBevCPU, "boxes_a"_a, "boxes_b"_a); m_contrib.def("iou_3d_cpu", &Iou3dCPU, "boxes_a"_a, "boxes_b"_a); diff --git a/cpp/pybind/ml/ml.cpp b/cpp/pybind/ml/ml.cpp index de71caf71b0..731a70da6d9 100644 --- a/cpp/pybind/ml/ml.cpp +++ b/cpp/pybind/ml/ml.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -13,9 +13,14 @@ namespace open3d { namespace ml { -void pybind_ml(py::module &m) { +void pybind_ml_declarations(py::module &m) { py::module m_ml = m.def_submodule("ml"); - contrib::pybind_contrib(m_ml); + contrib::pybind_contrib_declarations(m_ml); +} + +void pybind_ml_definitions(py::module &m) { + auto m_ml = static_cast(m.attr("ml")); + contrib::pybind_contrib_definitions(m_ml); } } // namespace ml diff --git a/cpp/pybind/ml/ml.h b/cpp/pybind/ml/ml.h index 3cbbc0e6a8e..f7617964c8c 100644 --- a/cpp/pybind/ml/ml.h +++ b/cpp/pybind/ml/ml.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -12,7 +12,8 @@ namespace open3d { namespace ml { -void pybind_ml(py::module& m); +void pybind_ml_declarations(py::module& m); +void pybind_ml_definitions(py::module& m); } // namespace ml } // namespace open3d diff --git a/cpp/pybind/open3d_pybind.cpp b/cpp/pybind/open3d_pybind.cpp index a6b71969804..148a6d81f27 100644 --- a/cpp/pybind/open3d_pybind.cpp +++ b/cpp/pybind/open3d_pybind.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -38,17 +38,26 @@ PYBIND11_MODULE(pybind, m) { // The binding order matters: if a class haven't been binded, binding the // user of this class will result in "could not convert default argument // into a Python object" error. - utility::pybind_utility(m); - - camera::pybind_camera(m); - core::pybind_core(m); + utility::pybind_utility_declarations(m); + camera::pybind_camera_declarations(m); + core::pybind_core_declarations(m); data::pybind_data(m); - geometry::pybind_geometry(m); - t::pybind_t(m); - ml::pybind_ml(m); - io::pybind_io(m); - pipelines::pybind_pipelines(m); - visualization::pybind_visualization(m); + geometry::pybind_geometry_declarations(m); + t::pybind_t_declarations(m); + ml::pybind_ml_declarations(m); + io::pybind_io_declarations(m); + pipelines::pybind_pipelines_declarations(m); + visualization::pybind_visualization_declarations(m); + + utility::pybind_utility_definitions(m); + camera::pybind_camera_definitions(m); + core::pybind_core_definitions(m); + geometry::pybind_geometry_definitions(m); + t::pybind_t_definitions(m); + ml::pybind_ml_definitions(m); + io::pybind_io_definitions(m); + pipelines::pybind_pipelines_definitions(m); + visualization::pybind_visualization_definitions(m); // pybind11 will internally manage the lifetime of default arguments for // function bindings. Since these objects will live longer than the memory diff --git a/cpp/pybind/open3d_pybind.h b/cpp/pybind/open3d_pybind.h index 0d6caaa4b02..f432092096a 100644 --- a/cpp/pybind/open3d_pybind.h +++ b/cpp/pybind/open3d_pybind.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/pybind/pipelines/color_map/color_map.cpp b/cpp/pybind/pipelines/color_map/color_map.cpp index 141d0bdab28..06217165c46 100644 --- a/cpp/pybind/pipelines/color_map/color_map.cpp +++ b/cpp/pybind/pipelines/color_map/color_map.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -19,7 +19,19 @@ namespace open3d { namespace pipelines { namespace color_map { -void pybind_color_map_options(py::module &m) { +void pybind_color_map_declarations(py::module &m) { + py::module m_color_map = + m.def_submodule("color_map", "Color map optimization pipeline"); + py::class_ + rigid_optimizer_option(m_color_map, "RigidOptimizerOption", + "Rigid optimizer option class."); + py::class_ + non_rigid_optimizer_option(m_color_map, "NonRigidOptimizerOption", + "Non Rigid optimizer option class."); +} + +void pybind_color_map_definitions(py::module &m) { + auto m_color_map = static_cast(m.attr("color_map")); static std::unordered_map colormap_docstrings = { {"non_rigid_camera_coordinate", "bool: (Default ``False``) Set to ``True`` to enable non-rigid " @@ -86,10 +98,9 @@ void pybind_color_map_options(py::module &m) { "If specified, the intermediate results will be stored in in the " "debug output dir. Existing files will be overwritten if the " "names are the same."}}; - - py::class_ - rigid_optimizer_option(m, "RigidOptimizerOption", - "Rigid optimizer option class."); + auto rigid_optimizer_option = + static_cast>( + m_color_map.attr("RigidOptimizerOption")); rigid_optimizer_option.def( py::init([](int maximum_iteration, double maximum_allowable_depth, double depth_threshold_for_visibility_check, @@ -120,12 +131,11 @@ void pybind_color_map_options(py::module &m) { "image_boundary_margin"_a = 10, "invisible_vertex_color_knn"_a = 3, "debug_output_dir"_a = ""); - docstring::ClassMethodDocInject(m, "RigidOptimizerOption", "__init__", - colormap_docstrings); - - py::class_ - non_rigid_optimizer_option(m, "NonRigidOptimizerOption", - "Non Rigid optimizer option class."); + docstring::ClassMethodDocInject(m_color_map, "RigidOptimizerOption", + "__init__", colormap_docstrings); + auto non_rigid_optimizer_option = static_cast< + py::class_>( + m_color_map.attr("NonRigidOptimizerOption")); non_rigid_optimizer_option.def( py::init([](int number_of_vertical_anchors, double non_rigid_anchor_point_weight, @@ -164,23 +174,14 @@ void pybind_color_map_options(py::module &m) { "image_boundary_margin"_a = 10, "invisible_vertex_color_knn"_a = 3, "debug_output_dir"_a = ""); - docstring::ClassMethodDocInject(m, "NonRigidOptimizerOption", "__init__", - colormap_docstrings); -} - -void pybind_color_map_classes(py::module &m) { - m.def("run_rigid_optimizer", &pipelines::color_map::RunRigidOptimizer, - "Run rigid optimization."); - m.def("run_non_rigid_optimizer", - &pipelines::color_map::RunNonRigidOptimizer, - "Run non-rigid optimization."); -} - -void pybind_color_map(py::module &m) { - py::module m_submodule = - m.def_submodule("color_map", "Color map optimization pipeline"); - pybind_color_map_options(m_submodule); - pybind_color_map_classes(m_submodule); + docstring::ClassMethodDocInject(m_color_map, "NonRigidOptimizerOption", + "__init__", colormap_docstrings); + m_color_map.def("run_rigid_optimizer", + &pipelines::color_map::RunRigidOptimizer, + "Run rigid optimization."); + m_color_map.def("run_non_rigid_optimizer", + &pipelines::color_map::RunNonRigidOptimizer, + "Run non-rigid optimization."); } } // namespace color_map diff --git a/cpp/pybind/pipelines/color_map/color_map.h b/cpp/pybind/pipelines/color_map/color_map.h index 12bffb93c91..b897c65e281 100644 --- a/cpp/pybind/pipelines/color_map/color_map.h +++ b/cpp/pybind/pipelines/color_map/color_map.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -13,8 +13,9 @@ namespace open3d { namespace pipelines { namespace color_map { -void pybind_color_map(py::module &m); +void pybind_color_map_declarations(py::module &m); +void pybind_color_map_definitions(py::module &m); -} +} // namespace color_map } // namespace pipelines } // namespace open3d diff --git a/cpp/pybind/pipelines/integration/integration.cpp b/cpp/pybind/pipelines/integration/integration.cpp index d0482bcc8fe..ded304ce64f 100644 --- a/cpp/pybind/pipelines/integration/integration.cpp +++ b/cpp/pybind/pipelines/integration/integration.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -38,10 +38,12 @@ class PyTSDFVolume : public TSDFVolumeBase { } }; -void pybind_integration_classes(py::module &m) { +void pybind_integration_declarations(py::module &m) { + py::module m_integration = + m.def_submodule("integration", "Integration pipeline."); // open3d.integration.TSDFVolumeColorType py::enum_ tsdf_volume_color_type( - m, "TSDFVolumeColorType", py::arithmetic()); + m_integration, "TSDFVolumeColorType", py::arithmetic()); tsdf_volume_color_type.value("NoColor", TSDFVolumeColorType::NoColor) .value("RGB8", TSDFVolumeColorType::RGB8) .value("Gray32", TSDFVolumeColorType::Gray32) @@ -52,10 +54,8 @@ void pybind_integration_classes(py::module &m) { return "Enum class for TSDFVolumeColorType."; }), py::none(), py::none(), ""); - - // open3d.integration.TSDFVolume py::class_> tsdfvolume( - m, "TSDFVolume", R"(Base class of the Truncated + m_integration, "TSDFVolume", R"(Base class of the Truncated Signed Distance Function (TSDF) volume This volume is usually used to integrate surface data (e.g., a series of RGB-D images) into a Mesh or PointCloud. The basic technique is presented in the following paper: @@ -65,6 +65,40 @@ A volumetric method for building complex models from range images B. Curless and M. Levoy In SIGGRAPH, 1996)"); + py::class_, TSDFVolume> + uniform_tsdfvolume( + m_integration, "UniformTSDFVolume", + "UniformTSDFVolume implements the classic TSDF " + "volume with uniform voxel grid (Curless and Levoy 1996)."); + py::class_, TSDFVolume> + scalable_tsdfvolume(m_integration, "ScalableTSDFVolume", R"(The +ScalableTSDFVolume implements a more memory efficient data structure for +volumetric integration. + +This implementation is based on the following repository: +https://github.com/qianyizh/ElasticReconstruction/tree/master/Integrate + +An observed depth pixel gives two types of information: (a) an approximation +of the nearby surface, and (b) empty space from the camera to the surface. +They induce two core concepts of volumetric integration: weighted average of +a truncated signed distance function (TSDF), and carving. The weighted +average of TSDF is great in addressing the Gaussian noise along surface +normal and producing a smooth surface output. The carving is great in +removing outlier structures like floating noise pixels and bumps along +structure edges. + +Ref: Dense Scene Reconstruction with Points of Interest + +Q.-Y. Zhou and V. Koltun + +In SIGGRAPH, 2013)"); +} +void pybind_integration_definitions(py::module &m) { + auto m_integration = static_cast(m.attr("integration")); + // open3d.integration.TSDFVolume + auto tsdfvolume = + static_cast>>( + m_integration.attr("TSDFVolume")); tsdfvolume .def("reset", &TSDFVolume::Reset, "Function to reset the TSDFVolume") @@ -83,21 +117,21 @@ In SIGGRAPH, 1996)"); .def_readwrite("color_type", &TSDFVolume::color_type_, "integration.TSDFVolumeColorType: Color type of the " "TSDF volume."); - docstring::ClassMethodDocInject(m, "TSDFVolume", "extract_point_cloud"); - docstring::ClassMethodDocInject(m, "TSDFVolume", "extract_triangle_mesh"); + docstring::ClassMethodDocInject(m_integration, "TSDFVolume", + "extract_point_cloud"); + docstring::ClassMethodDocInject(m_integration, "TSDFVolume", + "extract_triangle_mesh"); docstring::ClassMethodDocInject( - m, "TSDFVolume", "integrate", + m_integration, "TSDFVolume", "integrate", {{"image", "RGBD image."}, {"intrinsic", "Pinhole camera intrinsic parameters."}, {"extrinsic", "Extrinsic parameters."}}); - docstring::ClassMethodDocInject(m, "TSDFVolume", "reset"); + docstring::ClassMethodDocInject(m_integration, "TSDFVolume", "reset"); // open3d.integration.UniformTSDFVolume: open3d.integration.TSDFVolume - py::class_, TSDFVolume> - uniform_tsdfvolume( - m, "UniformTSDFVolume", - "UniformTSDFVolume implements the classic TSDF " - "volume with uniform voxel grid (Curless and Levoy 1996)."); + auto uniform_tsdfvolume = static_cast, TSDFVolume>>( + m_integration.attr("UniformTSDFVolume")); py::detail::bind_copy_functions(uniform_tsdfvolume); uniform_tsdfvolume .def(py::init([](double length, int resolution, double sdf_trunc, @@ -142,32 +176,13 @@ In SIGGRAPH, 1996)"); .def_readwrite("resolution", &UniformTSDFVolume::resolution_, "Resolution over the total length, where " "``voxel_length = length / resolution``"); - docstring::ClassMethodDocInject(m, "UniformTSDFVolume", + docstring::ClassMethodDocInject(m_integration, "UniformTSDFVolume", "extract_voxel_point_cloud"); // open3d.integration.ScalableTSDFVolume: open3d.integration.TSDFVolume - py::class_, TSDFVolume> - scalable_tsdfvolume(m, "ScalableTSDFVolume", R"(The -ScalableTSDFVolume implements a more memory efficient data structure for -volumetric integration. - -This implementation is based on the following repository: -https://github.com/qianyizh/ElasticReconstruction/tree/master/Integrate - -An observed depth pixel gives two types of information: (a) an approximation -of the nearby surface, and (b) empty space from the camera to the surface. -They induce two core concepts of volumetric integration: weighted average of -a truncated signed distance function (TSDF), and carving. The weighted -average of TSDF is great in addressing the Gaussian noise along surface -normal and producing a smooth surface output. The carving is great in -removing outlier structures like floating noise pixels and bumps along -structure edges. - -Ref: Dense Scene Reconstruction with Points of Interest - -Q.-Y. Zhou and V. Koltun - -In SIGGRAPH, 2013)"); + auto scalable_tsdfvolume = static_cast, TSDFVolume>>( + m_integration.attr("ScalableTSDFVolume")); py::detail::bind_copy_functions(scalable_tsdfvolume); scalable_tsdfvolume .def(py::init([](double voxel_length, double sdf_trunc, @@ -193,21 +208,10 @@ In SIGGRAPH, 2013)"); &ScalableTSDFVolume::ExtractVoxelPointCloud, "Debug function to extract the voxel data into a point " "cloud."); - docstring::ClassMethodDocInject(m, "ScalableTSDFVolume", + docstring::ClassMethodDocInject(m_integration, "ScalableTSDFVolume", "extract_voxel_point_cloud"); } -void pybind_integration_methods(py::module &m) { - // Currently empty -} - -void pybind_integration(py::module &m) { - py::module m_submodule = - m.def_submodule("integration", "Integration pipeline."); - pybind_integration_classes(m_submodule); - pybind_integration_methods(m_submodule); -} - } // namespace integration } // namespace pipelines } // namespace open3d diff --git a/cpp/pybind/pipelines/integration/integration.h b/cpp/pybind/pipelines/integration/integration.h index ed316740bb5..2b2c74b7fe2 100644 --- a/cpp/pybind/pipelines/integration/integration.h +++ b/cpp/pybind/pipelines/integration/integration.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -13,7 +13,8 @@ namespace open3d { namespace pipelines { namespace integration { -void pybind_integration(py::module &m); +void pybind_integration_declarations(py::module &m); +void pybind_integration_definitions(py::module &m); } // namespace integration } // namespace pipelines diff --git a/cpp/pybind/pipelines/odometry/odometry.cpp b/cpp/pybind/pipelines/odometry/odometry.cpp index 972a4452aad..08456a5255b 100644 --- a/cpp/pybind/pipelines/odometry/odometry.cpp +++ b/cpp/pybind/pipelines/odometry/odometry.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -41,10 +41,50 @@ class PyRGBDOdometryJacobian : public RGBDOdometryJacobianBase { } }; -void pybind_odometry_classes(py::module &m) { - // open3d.odometry.OdometryOption +void pybind_odometry_declarations(py::module &m) { + py::module m_odometry = m.def_submodule("odometry", "Odometry pipeline."); py::class_ odometry_option( - m, "OdometryOption", "Class that defines Odometry options."); + m_odometry, "OdometryOption", + "Class that defines Odometry options."); + py::class_> + jacobian( + m_odometry, "RGBDOdometryJacobian", + "Base class that computes Jacobian from two RGB-D images."); + py::class_, + RGBDOdometryJacobian> + jacobian_color(m_odometry, "RGBDOdometryJacobianFromColorTerm", + R"(Class to Compute Jacobian using color term. + +Energy: :math:`(I_p-I_q)^2.` + +Reference: + +F. Steinbrucker, J. Sturm, and D. Cremers. + +Real-time visual odometry from dense RGB-D images. + +In ICCV Workshops, 2011.)"); + py::class_, + RGBDOdometryJacobian> + jacobian_hybrid(m_odometry, "RGBDOdometryJacobianFromHybridTerm", + R"(Class to compute Jacobian using hybrid term + +Energy: :math:`(I_p-I_q)^2 + \lambda(D_p-D_q')^2` + +Reference: + +J. Park, Q.-Y. Zhou, and V. Koltun + +Anonymous submission.)"); +} +void pybind_odometry_definitions(py::module &m) { + auto m_odometry = static_cast(m.attr("odometry")); + // open3d.odometry.OdometryOption + auto odometry_option = static_cast>( + m_odometry.attr("OdometryOption")); odometry_option .def(py::init( [](std::vector iteration_number_per_pyramid_level, @@ -88,26 +128,22 @@ void pybind_odometry_classes(py::module &m) { c.iteration_number_per_pyramid_level_[i]) + ", "; str_iteration_number_per_pyramid_level_ += "] "; - return std::string("OdometryOption class.") + - /*std::string("\nodo_init = ") + - std::to_string(c.odo_init_) +*/ - std::string("\niteration_number_per_pyramid_level = ") + - str_iteration_number_per_pyramid_level_ + - std::string("\ndepth_diff_max = ") + - std::to_string(c.depth_diff_max_) + - std::string("\ndepth_min = ") + - std::to_string(c.depth_min_) + - std::string("\ndepth_max = ") + - std::to_string(c.depth_max_); + return fmt::format( + "OdometryOption(\n" + "iteration_number_per_pyramid_level={},\n" + "depth_diff_max={},\n" + "depth_min={},\n" + "depth_max={},\n" + ")", + str_iteration_number_per_pyramid_level_, + c.depth_diff_max_, c.depth_min_, c.depth_max_); }); // open3d.odometry.RGBDOdometryJacobian - py::class_> - jacobian( - m, "RGBDOdometryJacobian", - "Base class that computes Jacobian from two RGB-D images."); - + auto jacobian = static_cast< + py::class_>>( + m_odometry.attr("RGBDOdometryJacobian")); jacobian.def( "compute_jacobian_and_residual", &RGBDOdometryJacobian::ComputeJacobianAndResidual, @@ -121,21 +157,11 @@ void pybind_odometry_classes(py::module &m) { "corresps"_a); // open3d.odometry.RGBDOdometryJacobianFromColorTerm: RGBDOdometryJacobian - py::class_, - RGBDOdometryJacobian> - jacobian_color(m, "RGBDOdometryJacobianFromColorTerm", - R"(Class to Compute Jacobian using color term. - -Energy: :math:`(I_p-I_q)^2.` - -Reference: - -F. Steinbrucker, J. Sturm, and D. Cremers. - -Real-time visual odometry from dense RGB-D images. - -In ICCV Workshops, 2011.)"); + auto jacobian_color = static_cast, + RGBDOdometryJacobian>>( + m_odometry.attr("RGBDOdometryJacobianFromColorTerm")); py::detail::bind_default_constructor( jacobian_color); py::detail::bind_copy_functions( @@ -146,19 +172,11 @@ In ICCV Workshops, 2011.)"); }); // open3d.odometry.RGBDOdometryJacobianFromHybridTerm: RGBDOdometryJacobian - py::class_, - RGBDOdometryJacobian> - jacobian_hybrid(m, "RGBDOdometryJacobianFromHybridTerm", - R"(Class to compute Jacobian using hybrid term - -Energy: :math:`(I_p-I_q)^2 + \lambda(D_p-D_q')^2` - -Reference: - -J. Park, Q.-Y. Zhou, and V. Koltun - -Anonymous submission.)"); + auto jacobian_hybrid = static_cast, + RGBDOdometryJacobian>>( + m_odometry.attr("RGBDOdometryJacobianFromHybridTerm")); py::detail::bind_default_constructor( jacobian_hybrid); py::detail::bind_copy_functions( @@ -167,20 +185,18 @@ Anonymous submission.)"); "__repr__", [](const RGBDOdometryJacobianFromHybridTerm &te) { return std::string("RGBDOdometryJacobianFromHybridTerm"); }); -} - -void pybind_odometry_methods(py::module &m) { - m.def("compute_rgbd_odometry", &ComputeRGBDOdometry, - py::call_guard(), - "Function to estimate 6D rigid motion from two RGBD image pairs. " - "Output: (is_success, 4x4 motion matrix, 6x6 information matrix).", - "rgbd_source"_a, "rgbd_target"_a, - "pinhole_camera_intrinsic"_a = camera::PinholeCameraIntrinsic(), - "odo_init"_a = Eigen::Matrix4d::Identity(), - "jacobian"_a = RGBDOdometryJacobianFromHybridTerm(), - "option"_a = OdometryOption()); + m_odometry.def( + "compute_rgbd_odometry", &ComputeRGBDOdometry, + py::call_guard(), + "Function to estimate 6D rigid motion from two RGBD image pairs. " + "Output: (is_success, 4x4 motion matrix, 6x6 information matrix).", + "rgbd_source"_a, "rgbd_target"_a, + "pinhole_camera_intrinsic"_a = camera::PinholeCameraIntrinsic(), + "odo_init"_a = Eigen::Matrix4d::Identity(), + "jacobian"_a = RGBDOdometryJacobianFromHybridTerm(), + "option"_a = OdometryOption()); docstring::FunctionDocInject( - m, "compute_rgbd_odometry", + m_odometry, "compute_rgbd_odometry", { {"rgbd_source", "Source RGBD image."}, {"rgbd_target", "Target RGBD image."}, @@ -195,15 +211,16 @@ void pybind_odometry_methods(py::module &m) { {"option", "Odometry hyper parameters."}, }); - m.def("compute_correspondence", &ComputeCorrespondence, - py::call_guard(), - "Function to estimate point to point correspondences from two depth " - "images. A vector of u_s, v_s, u_t, v_t which maps the 2d " - "coordinates of source to target.", - "intrinsic_matrix"_a, "extrinsic"_a, "depth_s"_a, "depth_t"_a, - "option"_a = OdometryOption()); + m_odometry.def("compute_correspondence", &ComputeCorrespondence, + py::call_guard(), + "Function to estimate point to point correspondences from " + "two depth " + "images. A vector of u_s, v_s, u_t, v_t which maps the 2d " + "coordinates of source to target.", + "intrinsic_matrix"_a, "extrinsic"_a, "depth_s"_a, + "depth_t"_a, "option"_a = OdometryOption()); docstring::FunctionDocInject( - m, "compute_correspondence", + m_odometry, "compute_correspondence", { {"intrinsic_matrix", "Camera intrinsic parameters."}, {"extrinsic", @@ -214,12 +231,6 @@ void pybind_odometry_methods(py::module &m) { }); } -void pybind_odometry(py::module &m) { - py::module m_submodule = m.def_submodule("odometry", "Odometry pipeline."); - pybind_odometry_classes(m_submodule); - pybind_odometry_methods(m_submodule); -} - } // namespace odometry } // namespace pipelines } // namespace open3d diff --git a/cpp/pybind/pipelines/odometry/odometry.h b/cpp/pybind/pipelines/odometry/odometry.h index 48cd0edc657..e3ed804288e 100644 --- a/cpp/pybind/pipelines/odometry/odometry.h +++ b/cpp/pybind/pipelines/odometry/odometry.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -13,7 +13,8 @@ namespace open3d { namespace pipelines { namespace odometry { -void pybind_odometry(py::module &m); +void pybind_odometry_declarations(py::module &m); +void pybind_odometry_definitions(py::module &m); } // namespace odometry } // namespace pipelines diff --git a/cpp/pybind/pipelines/pipelines.cpp b/cpp/pybind/pipelines/pipelines.cpp index aa696a50245..11a83921f3b 100644 --- a/cpp/pybind/pipelines/pipelines.cpp +++ b/cpp/pybind/pipelines/pipelines.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -16,12 +16,20 @@ namespace open3d { namespace pipelines { -void pybind_pipelines(py::module& m) { +void pybind_pipelines_declarations(py::module& m) { py::module m_pipelines = m.def_submodule("pipelines"); - color_map::pybind_color_map(m_pipelines); - integration::pybind_integration(m_pipelines); - registration::pybind_registration(m_pipelines); - odometry::pybind_odometry(m_pipelines); + color_map::pybind_color_map_declarations(m_pipelines); + integration::pybind_integration_declarations(m_pipelines); + registration::pybind_registration_declarations(m_pipelines); + odometry::pybind_odometry_declarations(m_pipelines); +} + +void pybind_pipelines_definitions(py::module& m) { + auto m_pipelines = static_cast(m.attr("pipelines")); + color_map::pybind_color_map_definitions(m_pipelines); + integration::pybind_integration_definitions(m_pipelines); + registration::pybind_registration_definitions(m_pipelines); + odometry::pybind_odometry_definitions(m_pipelines); } } // namespace pipelines diff --git a/cpp/pybind/pipelines/pipelines.h b/cpp/pybind/pipelines/pipelines.h index 3f01c128cfe..22f1aa5fcde 100644 --- a/cpp/pybind/pipelines/pipelines.h +++ b/cpp/pybind/pipelines/pipelines.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -12,7 +12,8 @@ namespace open3d { namespace pipelines { -void pybind_pipelines(py::module& m); +void pybind_pipelines_declarations(py::module& m); +void pybind_pipelines_definitions(py::module& m); -} +} // namespace pipelines } // namespace open3d diff --git a/cpp/pybind/pipelines/registration/feature.cpp b/cpp/pybind/pipelines/registration/feature.cpp index bdc4b5d8e51..5ab1ce3cd2c 100644 --- a/cpp/pybind/pipelines/registration/feature.cpp +++ b/cpp/pybind/pipelines/registration/feature.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -15,10 +15,19 @@ namespace open3d { namespace pipelines { namespace registration { -void pybind_feature(py::module &m) { - // open3d.registration.Feature +void pybind_feature_declarations(py::module &m_registration) { py::class_> feature( - m, "Feature", "Class to store featrues for registration."); + m_registration, "Feature", + "Class to store featrues for registration."); + m_registration.attr("m") = + py::module_::import("typing").attr("TypeVar")("m"); + m_registration.attr("n") = + py::module_::import("typing").attr("TypeVar")("n"); +} +void pybind_feature_definitions(py::module &m_registration) { + // open3d.registration.Feature + auto feature = static_cast>>( + m_registration.attr("Feature")); py::detail::bind_default_constructor(feature); py::detail::bind_copy_functions(feature); feature.def("resize", &Feature::Resize, "dim"_a, "n"_a, @@ -26,6 +35,10 @@ void pybind_feature(py::module &m) { .def("dimension", &Feature::Dimension, "Returns feature dimensions per point.") .def("num", &Feature::Num, "Returns number of points.") + .def("select_by_index", &Feature::SelectByIndex, + "Function to select features from input Feature group into " + "output Feature group.", + "indices"_a, "invert"_a = false) .def_readwrite("data", &Feature::data_, "``dim x n`` float64 numpy array: Data buffer " "storing features.") @@ -38,28 +51,31 @@ void pybind_feature(py::module &m) { std::string(" and num = ") + std::to_string(f.Num()) + std::string("\nAccess its data via data member."); }); - docstring::ClassMethodDocInject(m, "Feature", "dimension"); - docstring::ClassMethodDocInject(m, "Feature", "num"); - docstring::ClassMethodDocInject(m, "Feature", "resize", + docstring::ClassMethodDocInject(m_registration, "Feature", "dimension"); + docstring::ClassMethodDocInject(m_registration, "Feature", "num"); + docstring::ClassMethodDocInject(m_registration, "Feature", "resize", {{"dim", "Feature dimension per point."}, {"n", "Number of points."}}); -} - -void pybind_feature_methods(py::module &m) { - m.def("compute_fpfh_feature", &ComputeFPFHFeature, - "Function to compute FPFH feature for a point cloud", "input"_a, - "search_param"_a); + docstring::ClassMethodDocInject( + m_registration, "Feature", "select_by_index", + {{"indices", "Indices of features to be selected."}, + {"invert", + "Set to ``True`` to invert the selection of indices."}}); + m_registration.def("compute_fpfh_feature", &ComputeFPFHFeature, + "Function to compute FPFH feature for a point cloud", + "input"_a, "search_param"_a); docstring::FunctionDocInject( - m, "compute_fpfh_feature", + m_registration, "compute_fpfh_feature", {{"input", "The Input point cloud."}, {"search_param", "KDTree KNN search parameter."}}); - m.def("correspondences_from_features", &CorrespondencesFromFeatures, - "Function to find nearest neighbor correspondences from features", - "source_features"_a, "target_features"_a, "mutual_filter"_a = false, - "mutual_consistency_ratio"_a = 0.1f); + m_registration.def( + "correspondences_from_features", &CorrespondencesFromFeatures, + "Function to find nearest neighbor correspondences from features", + "source_features"_a, "target_features"_a, "mutual_filter"_a = false, + "mutual_consistency_ratio"_a = 0.1f); docstring::FunctionDocInject( - m, "correspondences_from_features", + m_registration, "correspondences_from_features", {{"source_features", "The source features stored in (dim, N)."}, {"target_features", "The target features stored in (dim, M)."}, {"mutual_filter", diff --git a/cpp/pybind/pipelines/registration/global_optimization.cpp b/cpp/pybind/pipelines/registration/global_optimization.cpp index 58607de6597..7f5b747c2aa 100644 --- a/cpp/pybind/pipelines/registration/global_optimization.cpp +++ b/cpp/pybind/pipelines/registration/global_optimization.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -29,10 +29,50 @@ class PyGlobalOptimizationMethod : public GlobalOptimizationMethodBase { } }; -void pybind_global_optimization(py::module &m) { - // open3d.registration.PoseGraphNode +void pybind_global_optimization_declarations(py::module &m_registration) { py::class_> pose_graph_node( - m, "PoseGraphNode", "Node of ``PoseGraph``."); + m_registration, "PoseGraphNode", "Node of ``PoseGraph``."); + auto pose_graph_node_vector = py::bind_vector>( + m_registration, "PoseGraphNodeVector"); + py::class_> pose_graph_edge( + m_registration, "PoseGraphEdge", "Edge of ``PoseGraph``."); + auto pose_graph_edge_vector = py::bind_vector>( + m_registration, "PoseGraphEdgeVector"); + py::class_> pose_graph( + m_registration, "PoseGraph", + "Data structure defining the pose graph."); + py::class_> + global_optimization_method( + m_registration, "GlobalOptimizationMethod", + "Base class for global optimization method."); + py::class_, + GlobalOptimizationMethod> + global_optimization_method_lm( + m_registration, "GlobalOptimizationLevenbergMarquardt", + "Global optimization with Levenberg-Marquardt algorithm. " + "Recommended over the Gauss-Newton method since the LM has " + "better convergence characteristics."); + py::class_, + GlobalOptimizationMethod> + global_optimization_method_gn( + m_registration, "GlobalOptimizationGaussNewton", + "Global optimization with Gauss-Newton algorithm."); + py::class_ criteria( + m_registration, "GlobalOptimizationConvergenceCriteria", + "Convergence criteria of GlobalOptimization."); + py::class_ option( + m_registration, "GlobalOptimizationOption", + "Option for GlobalOptimization."); +} + +void pybind_global_optimization_definitions(py::module &m_registration) { + // open3d.registration.PoseGraphNode + auto pose_graph_node = static_cast< + py::class_>>( + m_registration.attr("PoseGraphNode")); py::detail::bind_default_constructor(pose_graph_node); py::detail::bind_copy_functions(pose_graph_node); pose_graph_node.def_readwrite("pose", &PoseGraphNode::pose_) @@ -49,8 +89,10 @@ void pybind_global_optimization(py::module &m) { }); // open3d.registration.PoseGraphNodeVector - auto pose_graph_node_vector = py::bind_vector>( - m, "PoseGraphNodeVector"); + auto pose_graph_node_vector = + static_cast>( + m_registration, "PoseGraphNodeVector"))>( + m_registration.attr("PoseGraphNodeVector")); pose_graph_node_vector.attr("__doc__") = docstring::static_property( py::cpp_function([](py::handle arg) -> std::string { return "Vector of PoseGraphNode"; @@ -58,8 +100,9 @@ void pybind_global_optimization(py::module &m) { py::none(), py::none(), ""); // open3d.registration.PoseGraphEdge - py::class_> pose_graph_edge( - m, "PoseGraphEdge", "Edge of ``PoseGraph``."); + auto pose_graph_edge = static_cast< + py::class_>>( + m_registration.attr("PoseGraphEdge")); py::detail::bind_default_constructor(pose_graph_edge); py::detail::bind_copy_functions(pose_graph_edge); pose_graph_edge @@ -109,8 +152,10 @@ void pybind_global_optimization(py::module &m) { }); // open3d.registration.PoseGraphEdgeVector - auto pose_graph_edge_vector = py::bind_vector>( - m, "PoseGraphEdgeVector"); + auto pose_graph_edge_vector = + static_cast>( + m_registration, "PoseGraphEdgeVector"))>( + m_registration.attr("PoseGraphEdgeVector")); pose_graph_edge_vector.attr("__doc__") = docstring::static_property( py::cpp_function([](py::handle arg) -> std::string { return "Vector of PoseGraphEdge"; @@ -118,8 +163,9 @@ void pybind_global_optimization(py::module &m) { py::none(), py::none(), ""); // open3d.registration.PoseGraph - py::class_> pose_graph( - m, "PoseGraph", "Data structure defining the pose graph."); + auto pose_graph = + static_cast>>( + m_registration.attr("PoseGraph")); py::detail::bind_default_constructor(pose_graph); py::detail::bind_copy_functions(pose_graph); pose_graph @@ -138,29 +184,25 @@ void pybind_global_optimization(py::module &m) { }); // open3d.registration.GlobalOptimizationMethod - py::class_> - global_optimization_method( - m, "GlobalOptimizationMethod", - "Base class for global optimization method."); + auto global_optimization_method = static_cast< + py::class_>>( + m_registration.attr("GlobalOptimizationMethod")); global_optimization_method.def("OptimizePoseGraph", &GlobalOptimizationMethod::OptimizePoseGraph, "pose_graph"_a, "criteria"_a, "option"_a, "Run pose graph optimization."); docstring::ClassMethodDocInject( - m, "GlobalOptimizationMethod", "OptimizePoseGraph", + m_registration, "GlobalOptimizationMethod", "OptimizePoseGraph", {{"pose_graph", "The pose graph to be optimized (in-place)."}, {"criteria", "Convergence criteria."}, {"option", "Global optimization options."}}); - py::class_, - GlobalOptimizationMethod> - global_optimization_method_lm( - m, "GlobalOptimizationLevenbergMarquardt", - "Global optimization with Levenberg-Marquardt algorithm. " - "Recommended over the Gauss-Newton method since the LM has " - "better convergence characteristics."); + auto global_optimization_method_lm = static_cast, + GlobalOptimizationMethod>>( + m_registration.attr("GlobalOptimizationLevenbergMarquardt")); py::detail::bind_default_constructor( global_optimization_method_lm); py::detail::bind_copy_functions( @@ -170,12 +212,11 @@ void pybind_global_optimization(py::module &m) { return std::string("GlobalOptimizationLevenbergMarquardt"); }); - py::class_, - GlobalOptimizationMethod> - global_optimization_method_gn( - m, "GlobalOptimizationGaussNewton", - "Global optimization with Gauss-Newton algorithm."); + auto global_optimization_method_gn = static_cast, + GlobalOptimizationMethod>>( + m_registration.attr("GlobalOptimizationGaussNewton")); py::detail::bind_default_constructor( global_optimization_method_gn); py::detail::bind_copy_functions( @@ -185,9 +226,10 @@ void pybind_global_optimization(py::module &m) { return std::string("GlobalOptimizationGaussNewton"); }); - py::class_ criteria( - m, "GlobalOptimizationConvergenceCriteria", - "Convergence criteria of GlobalOptimization."); + auto criteria = + static_cast>( + m_registration.attr( + "GlobalOptimizationConvergenceCriteria")); py::detail::bind_default_constructor( criteria); py::detail::bind_copy_functions( @@ -252,8 +294,8 @@ void pybind_global_optimization(py::module &m) { std::to_string(cr.lower_scale_factor_); }); - py::class_ option( - m, "GlobalOptimizationOption", "Option for GlobalOptimization."); + auto option = static_cast>( + m_registration.attr("GlobalOptimizationOption")); py::detail::bind_default_constructor(option); py::detail::bind_copy_functions(option); option.def_readwrite( @@ -302,10 +344,7 @@ void pybind_global_optimization(py::module &m) { std::string("\n> reference_node : ") + std::to_string(goo.reference_node_); }); -} - -void pybind_global_optimization_methods(py::module &m) { - m.def( + m_registration.def( "global_optimization", [](PoseGraph &pose_graph, const GlobalOptimizationMethod &method, const GlobalOptimizationConvergenceCriteria &criteria, @@ -315,7 +354,7 @@ void pybind_global_optimization_methods(py::module &m) { "Function to optimize PoseGraph", "pose_graph"_a, "method"_a, "criteria"_a, "option"_a); docstring::FunctionDocInject( - m, "global_optimization", + m_registration, "global_optimization", {{"pose_graph", "The pose_graph to be optimized (in-place)."}, {"method", "Global optimization method. Either " diff --git a/cpp/pybind/pipelines/registration/registration.cpp b/cpp/pybind/pipelines/registration/registration.cpp index cddcb7e7e80..0cc560df72f 100644 --- a/cpp/pybind/pipelines/registration/registration.cpp +++ b/cpp/pybind/pipelines/registration/registration.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -63,16 +63,109 @@ class PyCorrespondenceChecker : public CorrespondenceCheckerBase { } }; -void pybind_registration_classes(py::module &m) { - // open3d.registration.ICPConvergenceCriteria +void pybind_registration_declarations(py::module &m) { + py::module m_registration = + m.def_submodule("registration", "Registration pipeline."); py::class_ convergence_criteria( - m, "ICPConvergenceCriteria", + m_registration, "ICPConvergenceCriteria", "Class that defines the convergence criteria of ICP. ICP " "algorithm " "stops if the relative change of fitness and rmse hit " "``relative_fitness`` and ``relative_rmse`` individually, " "or the " "iteration number exceeds ``max_iteration``."); + py::class_ ransac_criteria( + m_registration, "RANSACConvergenceCriteria", + "Class that defines the convergence criteria of " + "RANSAC. RANSAC algorithm stops if the iteration " + "number hits ``max_iteration``, or the fitness " + "measured during validation suggests that the " + "algorithm can be terminated early with some " + "``confidence``. Early termination takes place " + "when the number of iterations reaches ``k = " + "log(1 - confidence)/log(1 - fitness^{ransac_n})``, " + "where ``ransac_n`` is the number of points used " + "during a ransac iteration. Use confidence=1.0 " + "to avoid early termination."); + py::class_> + te(m_registration, "TransformationEstimation", + "Base class that estimates a transformation between two point " + "clouds. The virtual function ComputeTransformation() must be " + "implemented in subclasses."); + py::class_, + TransformationEstimation> + te_p2p(m_registration, "TransformationEstimationPointToPoint", + "Class to estimate a transformation for point to point " + "distance."); + py::class_, + TransformationEstimation> + te_p2l(m_registration, "TransformationEstimationPointToPlane", + "Class to estimate a transformation for point to plane " + "distance."); + py::class_< + TransformationEstimationForColoredICP, + PyTransformationEstimation, + TransformationEstimation> + te_col(m_registration, "TransformationEstimationForColoredICP", + "Class to estimate a transformation between two point " + "clouds using color information"); + py::class_, + TransformationEstimation> + te_gicp(m_registration, "TransformationEstimationForGeneralizedICP", + "Class to estimate a transformation for Generalized ICP."); + py::class_> + cc(m_registration, "CorrespondenceChecker", + "Base class that checks if two (small) point clouds can be " + "aligned. This class is used in feature based matching " + "algorithms (such as RANSAC and FastGlobalRegistration) to " + "prune out outlier correspondences. The virtual function " + "Check() must be implemented in subclasses."); + py::class_, + CorrespondenceChecker> + cc_el(m_registration, "CorrespondenceCheckerBasedOnEdgeLength", + "Check if two point clouds build the polygons with similar " + "edge lengths. That is, checks if the lengths of any two " + "arbitrary edges (line formed by two vertices) individually " + "drawn within the source point cloud and within the target " + "point cloud with correspondences are similar. The only " + "parameter similarity_threshold is a number between 0 " + "(loose) and 1 (strict)"); + py::class_, + CorrespondenceChecker> + cc_d(m_registration, "CorrespondenceCheckerBasedOnDistance", + "Class to check if aligned point clouds are close (less than " + "specified threshold)."); + py::class_, + CorrespondenceChecker> + cc_n(m_registration, "CorrespondenceCheckerBasedOnNormal", + "Class to check if two aligned point clouds have similar " + "normals. It considers vertex normal affinity of any " + "correspondences. It computes dot product of two normal " + "vectors. It takes radian value for the threshold."); + py::class_ fgr_option( + m_registration, "FastGlobalRegistrationOption", + "Options for FastGlobalRegistration."); + py::class_ registration_result( + m_registration, "RegistrationResult", + "Class that contains the registration results."); + pybind_feature_declarations(m_registration); + pybind_global_optimization_declarations(m_registration); + pybind_robust_kernels_declarations(m_registration); +} +void pybind_registration_definitions(py::module &m) { + auto m_registration = static_cast(m.attr("registration")); + // open3d.registration.ICPConvergenceCriteria + auto convergence_criteria = static_cast>( + m_registration.attr("ICPConvergenceCriteria")); py::detail::bind_copy_functions( convergence_criteria); convergence_criteria @@ -95,27 +188,17 @@ void pybind_registration_classes(py::module &m) { "Maximum iteration before iteration stops.") .def("__repr__", [](const ICPConvergenceCriteria &c) { return fmt::format( - "ICPConvergenceCriteria class " - "with relative_fitness={:e}, relative_rmse={:e}, " - "and max_iteration={:d}", + "ICPConvergenceCriteria(" + "relative_fitness={:e}, " + "relative_rmse={:e}, " + "max_iteration={:d})", c.relative_fitness_, c.relative_rmse_, c.max_iteration_); }); // open3d.registration.RANSACConvergenceCriteria - py::class_ ransac_criteria( - m, "RANSACConvergenceCriteria", - "Class that defines the convergence criteria of " - "RANSAC. RANSAC algorithm stops if the iteration " - "number hits ``max_iteration``, or the fitness " - "measured during validation suggests that the " - "algorithm can be terminated early with some " - "``confidence``. Early termination takes place " - "when the number of iterations reaches ``k = " - "log(1 - confidence)/log(1 - fitness^{ransac_n})``, " - "where ``ransac_n`` is the number of points used " - "during a ransac iteration. Use confidence=1.0 " - "to avoid early termination."); + auto ransac_criteria = static_cast>( + m_registration.attr("RANSACConvergenceCriteria")); py::detail::bind_copy_functions(ransac_criteria); ransac_criteria .def(py::init([](int max_iteration, double confidence) { @@ -132,19 +215,17 @@ void pybind_registration_classes(py::module &m) { "termination. Use 1.0 to avoid early termination.") .def("__repr__", [](const RANSACConvergenceCriteria &c) { return fmt::format( - "RANSACConvergenceCriteria " - "class with max_iteration={:d}, " - "and confidence={:e}", + "RANSACConvergenceCriteria(" + "max_iteration={:d}, " + "confidence={:e})", c.max_iteration_, c.confidence_); }); // open3d.registration.TransformationEstimation - py::class_> - te(m, "TransformationEstimation", - "Base class that estimates a transformation between two point " - "clouds. The virtual function ComputeTransformation() must be " - "implemented in subclasses."); + auto te = static_cast< + py::class_>>( + m_registration.attr("TransformationEstimation")); te.def("compute_rmse", &TransformationEstimation::ComputeRMSE, "source"_a, "target"_a, "corres"_a, "Compute RMSE between source and target points cloud given " @@ -155,13 +236,14 @@ void pybind_registration_classes(py::module &m) { "Compute transformation from source to target point cloud given " "correspondences."); docstring::ClassMethodDocInject( - m, "TransformationEstimation", "compute_rmse", + m_registration, "TransformationEstimation", "compute_rmse", {{"source", "Source point cloud."}, {"target", "Target point cloud."}, {"corres", "Correspondence set between source and target point cloud."}}); docstring::ClassMethodDocInject( - m, "TransformationEstimation", "compute_transformation", + m_registration, "TransformationEstimation", + "compute_transformation", {{"source", "Source point cloud."}, {"target", "Target point cloud."}, {"corres", @@ -169,12 +251,11 @@ void pybind_registration_classes(py::module &m) { // open3d.registration.TransformationEstimationPointToPoint: // TransformationEstimation - py::class_, - TransformationEstimation> - te_p2p(m, "TransformationEstimationPointToPoint", - "Class to estimate a transformation for point to point " - "distance."); + auto te_p2p = static_cast, + TransformationEstimation>>( + m_registration.attr("TransformationEstimationPointToPoint")); py::detail::bind_copy_functions( te_p2p); te_p2p.def(py::init([](bool with_scaling) { @@ -184,11 +265,10 @@ void pybind_registration_classes(py::module &m) { "with_scaling"_a = false) .def("__repr__", [](const TransformationEstimationPointToPoint &te) { - return std::string( - "TransformationEstimationPointToPoint ") + - (te.with_scaling_ - ? std::string("with scaling.") - : std::string("without scaling.")); + return fmt::format( + "TransformationEstimationPointToPoint(" + "with_scaling={})", + te.with_scaling_ ? "True" : "False"); }) .def_readwrite( "with_scaling", @@ -205,12 +285,11 @@ Sets :math:`c = 1` if ``with_scaling`` is ``False``. // open3d.registration.TransformationEstimationPointToPlane: // TransformationEstimation - py::class_, - TransformationEstimation> - te_p2l(m, "TransformationEstimationPointToPlane", - "Class to estimate a transformation for point to plane " - "distance."); + auto te_p2l = static_cast, + TransformationEstimation>>( + m_registration.attr("TransformationEstimationPointToPlane")); py::detail::bind_default_constructor( te_p2l); py::detail::bind_copy_functions( @@ -229,13 +308,11 @@ Sets :math:`c = 1` if ``with_scaling`` is ``False``. "Robust Kernel used in the Optimization"); // open3d.registration.TransformationEstimationForColoredICP : - py::class_< + auto te_col = static_cast, - TransformationEstimation> - te_col(m, "TransformationEstimationForColoredICP", - "Class to estimate a transformation between two point " - "clouds using color information"); + TransformationEstimation>>( + m_registration.attr("TransformationEstimationForColoredICP")); py::detail::bind_default_constructor( te_col); py::detail::bind_copy_functions( @@ -259,10 +336,12 @@ Sets :math:`c = 1` if ``with_scaling`` is ``False``. "kernel"_a) .def("__repr__", [](const TransformationEstimationForColoredICP &te) { - return std::string( - "TransformationEstimationForColoredICP ") + - ("with lambda_geometric=" + - std::to_string(te.lambda_geometric_)); + // This is missing kernel, but getting kernel name on C++ + // is hard + return fmt::format( + "TransformationEstimationForColoredICP(" + "lambda_geometric={})", + te.lambda_geometric_); }) .def_readwrite( "lambda_geometric", @@ -274,12 +353,12 @@ Sets :math:`c = 1` if ``with_scaling`` is ``False``. // open3d.registration.TransformationEstimationForGeneralizedICP: // TransformationEstimation - py::class_, - TransformationEstimation> - te_gicp(m, "TransformationEstimationForGeneralizedICP", - "Class to estimate a transformation for Generalized ICP."); + auto te_gicp = static_cast< + py::class_, + TransformationEstimation>>( + m_registration.attr("TransformationEstimationForGeneralizedICP")); py::detail::bind_default_constructor< TransformationEstimationForGeneralizedICP>(te_gicp); py::detail::bind_copy_functions( @@ -303,10 +382,10 @@ Sets :math:`c = 1` if ``with_scaling`` is ``False``. "kernel"_a) .def("__repr__", [](const TransformationEstimationForGeneralizedICP &te) { - return std::string( - "TransformationEstimationForGeneralizedICP" - " ") + - ("with epsilon=" + std::to_string(te.epsilon_)); + return fmt::format( + "TransformationEstimationForGeneralizedICP(" + "epsilon={})", + te.epsilon_); }) .def_readwrite("epsilon", &TransformationEstimationForGeneralizedICP::epsilon_, @@ -316,14 +395,10 @@ Sets :math:`c = 1` if ``with_scaling`` is ``False``. "Robust Kernel used in the Optimization"); // open3d.registration.CorrespondenceChecker - py::class_> - cc(m, "CorrespondenceChecker", - "Base class that checks if two (small) point clouds can be " - "aligned. This class is used in feature based matching " - "algorithms (such as RANSAC and FastGlobalRegistration) to " - "prune out outlier correspondences. The virtual function " - "Check() must be implemented in subclasses."); + auto cc = static_cast< + py::class_>>( + m_registration.attr("CorrespondenceChecker")); cc.def("Check", &CorrespondenceChecker::Check, "source"_a, "target"_a, "corres"_a, "transformation"_a, "Function to check if two points can be aligned. The two input " @@ -335,7 +410,7 @@ Sets :math:`c = 1` if ``with_scaling`` is ``False``. "the edge length checker. Some checkers do, e.g., the distance " "checker."); docstring::ClassMethodDocInject( - m, "CorrespondenceChecker", "Check", + m_registration, "CorrespondenceChecker", "Check", {{"source", "Source point cloud."}, {"target", "Target point cloud."}, {"corres", @@ -344,17 +419,11 @@ Sets :math:`c = 1` if ``with_scaling`` is ``False``. // open3d.registration.CorrespondenceCheckerBasedOnEdgeLength: // CorrespondenceChecker - py::class_, - CorrespondenceChecker> - cc_el(m, "CorrespondenceCheckerBasedOnEdgeLength", - "Check if two point clouds build the polygons with similar " - "edge lengths. That is, checks if the lengths of any two " - "arbitrary edges (line formed by two vertices) individually " - "drawn within the source point cloud and within the target " - "point cloud with correspondences are similar. The only " - "parameter similarity_threshold is a number between 0 " - "(loose) and 1 (strict)"); + auto cc_el = static_cast, + CorrespondenceChecker>>( + m_registration.attr("CorrespondenceCheckerBasedOnEdgeLength")); py::detail::bind_copy_functions( cc_el); cc_el.def(py::init([](double similarity_threshold) { @@ -385,12 +454,11 @@ must hold true for all edges.)"); // open3d.registration.CorrespondenceCheckerBasedOnDistance: // CorrespondenceChecker - py::class_, - CorrespondenceChecker> - cc_d(m, "CorrespondenceCheckerBasedOnDistance", - "Class to check if aligned point clouds are close (less than " - "specified threshold)."); + auto cc_d = static_cast, + CorrespondenceChecker>>( + m_registration.attr("CorrespondenceCheckerBasedOnDistance")); py::detail::bind_copy_functions(cc_d); cc_d.def(py::init([](double distance_threshold) { return new CorrespondenceCheckerBasedOnDistance( @@ -412,14 +480,11 @@ must hold true for all edges.)"); // open3d.registration.CorrespondenceCheckerBasedOnNormal: // CorrespondenceChecker - py::class_, - CorrespondenceChecker> - cc_n(m, "CorrespondenceCheckerBasedOnNormal", - "Class to check if two aligned point clouds have similar " - "normals. It considers vertex normal affinity of any " - "correspondences. It computes dot product of two normal " - "vectors. It takes radian value for the threshold."); + auto cc_n = static_cast, + CorrespondenceChecker>>( + m_registration.attr("CorrespondenceCheckerBasedOnNormal")); py::detail::bind_copy_functions(cc_n); cc_n.def(py::init([](double normal_angle_threshold) { return new CorrespondenceCheckerBasedOnNormal( @@ -440,9 +505,8 @@ must hold true for all edges.)"); "Radian value for angle threshold."); // open3d.registration.FastGlobalRegistrationOption: - py::class_ fgr_option( - m, "FastGlobalRegistrationOption", - "Options for FastGlobalRegistration."); + auto fgr_option = static_cast>( + m_registration.attr("FastGlobalRegistrationOption")); py::detail::bind_copy_functions(fgr_option); fgr_option .def(py::init([](double division_factor, bool use_absolute_scale, @@ -493,25 +557,25 @@ must hold true for all edges.)"); "tests on initial set of correspondences.") .def("__repr__", [](const FastGlobalRegistrationOption &c) { return fmt::format( - "" - "FastGlobalRegistrationOption class " - "with \ndivision_factor={}" - "\nuse_absolute_scale={}" - "\ndecrease_mu={}" - "\nmaximum_correspondence_distance={}" - "\niteration_number={}" - "\ntuple_scale={}" - "\nmaximum_tuple_count={}", - "\ntuple_test={}", c.division_factor_, - c.use_absolute_scale_, c.decrease_mu_, - c.maximum_correspondence_distance_, c.iteration_number_, - c.tuple_scale_, c.maximum_tuple_count_, c.tuple_test_); + "FastGlobalRegistrationOption(" + "\ndivision_factor={}," + "\nuse_absolute_scale={}," + "\ndecrease_mu={}," + "\nmaximum_correspondence_distance={}," + "\niteration_number={}," + "\ntuple_scale={}," + "\nmaximum_tuple_count={}," + "\ntuple_test={}," + "\n)", + c.division_factor_, c.use_absolute_scale_, + c.decrease_mu_, c.maximum_correspondence_distance_, + c.iteration_number_, c.tuple_scale_, + c.maximum_tuple_count_, c.tuple_test_); }); // open3d.registration.RegistrationResult - py::class_ registration_result( - m, "RegistrationResult", - "Class that contains the registration results."); + auto registration_result = static_cast>( + m_registration.attr("RegistrationResult")); py::detail::bind_default_constructor( registration_result); py::detail::bind_copy_functions(registration_result); @@ -542,162 +606,161 @@ must hold true for all edges.)"); rr.fitness_, rr.inlier_rmse_, rr.correspondence_set_.size()); }); -} - -// Registration functions have similar arguments, sharing arg docstrings -static const std::unordered_map - map_shared_argument_docstrings = { - {"checkers", - "Vector of Checker class to check if two point " - "clouds can be aligned. One of " - "(``CorrespondenceCheckerBasedOnEdgeLength``, " - "``CorrespondenceCheckerBasedOnDistance``, " - "``CorrespondenceCheckerBasedOnNormal``)"}, - {"confidence", - "Desired probability of success for RANSAC. Used for " - "estimating early termination by k = log(1 - " - "confidence)/log(1 - inlier_ratio^{ransac_n}."}, - {"corres", - "o3d.utility.Vector2iVector that stores indices of " - "corresponding point or feature arrays."}, - {"criteria", "Convergence criteria"}, - {"estimation_method", - "Estimation method. One of " - "(``TransformationEstimationPointToPoint``, " - "``TransformationEstimationPointToPlane``, " - "``TransformationEstimationForGeneralizedICP``, " - "``TransformationEstimationForColoredICP``)"}, - {"init", "Initial transformation estimation"}, - {"lambda_geometric", "lambda_geometric value"}, - {"epsilon", "epsilon value"}, - {"kernel", "Robust Kernel used in the Optimization"}, - {"max_correspondence_distance", - "Maximum correspondence points-pair distance."}, - {"mutual_filter", - "Enables mutual filter such that the correspondence of the " - "source point's correspondence is itself."}, - {"option", "Registration option"}, - {"ransac_n", "Fit ransac with ``ransac_n`` correspondences"}, - {"source_feature", "Source point cloud feature."}, - {"source", "The source point cloud."}, - {"target_feature", "Target point cloud feature."}, - {"target", "The target point cloud."}, - {"transformation", - "The 4x4 transformation matrix to transform ``source`` to " - "``target``"}}; - -void pybind_registration_methods(py::module &m) { - m.def("evaluate_registration", &EvaluateRegistration, - py::call_guard(), - "Function for evaluating registration between point clouds", - "source"_a, "target"_a, "max_correspondence_distance"_a, - "transformation"_a = Eigen::Matrix4d::Identity()); - docstring::FunctionDocInject(m, "evaluate_registration", + // Registration functions have similar arguments, sharing arg docstrings + static const std::unordered_map + map_shared_argument_docstrings = { + {"checkers", + "Vector of Checker class to check if two point " + "clouds can be aligned. One of " + "(``CorrespondenceCheckerBasedOnEdgeLength``, " + "``CorrespondenceCheckerBasedOnDistance``, " + "``CorrespondenceCheckerBasedOnNormal``)"}, + {"confidence", + "Desired probability of success for RANSAC. Used for " + "estimating early termination by k = log(1 - " + "confidence)/log(1 - inlier_ratio^{ransac_n}."}, + {"corres", + "o3d.utility.Vector2iVector that stores indices of " + "corresponding point or feature arrays."}, + {"criteria", "Convergence criteria"}, + {"estimation_method", + "Estimation method. One of " + "(``TransformationEstimationPointToPoint``, " + "``TransformationEstimationPointToPlane``, " + "``TransformationEstimationForGeneralizedICP``, " + "``TransformationEstimationForColoredICP``)"}, + {"init", "Initial transformation estimation"}, + {"lambda_geometric", "lambda_geometric value"}, + {"epsilon", "epsilon value"}, + {"kernel", "Robust Kernel used in the Optimization"}, + {"max_correspondence_distance", + "Maximum correspondence points-pair distance."}, + {"mutual_filter", + "Enables mutual filter such that the correspondence of " + "the " + "source point's correspondence is itself."}, + {"option", "Registration option"}, + {"ransac_n", + "Fit ransac with ``ransac_n`` correspondences"}, + {"source_feature", "Source point cloud feature."}, + {"source", "The source point cloud."}, + {"target_feature", "Target point cloud feature."}, + {"target", "The target point cloud."}, + {"transformation", + "The 4x4 transformation matrix to transform ``source`` to " + "``target``"}}; + m_registration.def( + "evaluate_registration", &EvaluateRegistration, + py::call_guard(), + "Function for evaluating registration between point clouds", + "source"_a, "target"_a, "max_correspondence_distance"_a, + "transformation"_a = Eigen::Matrix4d::Identity()); + docstring::FunctionDocInject(m_registration, "evaluate_registration", map_shared_argument_docstrings); - m.def("registration_icp", &RegistrationICP, - py::call_guard(), - "Function for ICP registration", "source"_a, "target"_a, - "max_correspondence_distance"_a, - "init"_a = Eigen::Matrix4d::Identity(), - "estimation_method"_a = TransformationEstimationPointToPoint(false), - "criteria"_a = ICPConvergenceCriteria()); - docstring::FunctionDocInject(m, "registration_icp", + m_registration.def( + "registration_icp", &RegistrationICP, + py::call_guard(), + "Function for ICP registration", "source"_a, "target"_a, + "max_correspondence_distance"_a, + "init"_a = Eigen::Matrix4d::Identity(), + "estimation_method"_a = TransformationEstimationPointToPoint(false), + "criteria"_a = ICPConvergenceCriteria()); + docstring::FunctionDocInject(m_registration, "registration_icp", map_shared_argument_docstrings); - m.def("registration_colored_icp", &RegistrationColoredICP, - py::call_guard(), - "Function for Colored ICP registration", "source"_a, "target"_a, - "max_correspondence_distance"_a, - "init"_a = Eigen::Matrix4d::Identity(), - "estimation_method"_a = TransformationEstimationForColoredICP(0.968), - "criteria"_a = ICPConvergenceCriteria()); - docstring::FunctionDocInject(m, "registration_colored_icp", + m_registration.def("registration_colored_icp", &RegistrationColoredICP, + py::call_guard(), + "Function for Colored ICP registration", "source"_a, + "target"_a, "max_correspondence_distance"_a, + "init"_a = Eigen::Matrix4d::Identity(), + "estimation_method"_a = + TransformationEstimationForColoredICP(0.968), + "criteria"_a = ICPConvergenceCriteria()); + docstring::FunctionDocInject(m_registration, "registration_colored_icp", map_shared_argument_docstrings); - m.def("registration_generalized_icp", &RegistrationGeneralizedICP, - py::call_guard(), - "Function for Generalized ICP registration", "source"_a, "target"_a, - "max_correspondence_distance"_a, - "init"_a = Eigen::Matrix4d::Identity(), - "estimation_method"_a = - TransformationEstimationForGeneralizedICP(1e-3), - "criteria"_a = ICPConvergenceCriteria()); - docstring::FunctionDocInject(m, "registration_generalized_icp", + m_registration.def("registration_generalized_icp", + &RegistrationGeneralizedICP, + py::call_guard(), + "Function for Generalized ICP registration", "source"_a, + "target"_a, "max_correspondence_distance"_a, + "init"_a = Eigen::Matrix4d::Identity(), + "estimation_method"_a = + TransformationEstimationForGeneralizedICP(1e-3), + "criteria"_a = ICPConvergenceCriteria()); + docstring::FunctionDocInject(m_registration, "registration_generalized_icp", map_shared_argument_docstrings); - m.def("registration_ransac_based_on_correspondence", - &RegistrationRANSACBasedOnCorrespondence, - py::call_guard(), - "Function for global RANSAC registration based on a set of " - "correspondences", - "source"_a, "target"_a, "corres"_a, "max_correspondence_distance"_a, - "estimation_method"_a = TransformationEstimationPointToPoint(false), - "ransac_n"_a = 3, - "checkers"_a = std::vector< - std::reference_wrapper>(), - "criteria"_a = RANSACConvergenceCriteria(100000, 0.999)); - docstring::FunctionDocInject(m, + m_registration.def( + "registration_ransac_based_on_correspondence", + &RegistrationRANSACBasedOnCorrespondence, + py::call_guard(), + "Function for global RANSAC registration based on a set of " + "correspondences", + "source"_a, "target"_a, "corres"_a, "max_correspondence_distance"_a, + "estimation_method"_a = TransformationEstimationPointToPoint(false), + "ransac_n"_a = 3, + "checkers"_a = std::vector< + std::reference_wrapper>(), + "criteria"_a = RANSACConvergenceCriteria(100000, 0.999)); + docstring::FunctionDocInject(m_registration, "registration_ransac_based_on_correspondence", map_shared_argument_docstrings); - m.def("registration_ransac_based_on_feature_matching", - &RegistrationRANSACBasedOnFeatureMatching, - py::call_guard(), - "Function for global RANSAC registration based on feature matching", - "source"_a, "target"_a, "source_feature"_a, "target_feature"_a, - "mutual_filter"_a, "max_correspondence_distance"_a, - "estimation_method"_a = TransformationEstimationPointToPoint(false), - "ransac_n"_a = 3, - "checkers"_a = std::vector< - std::reference_wrapper>(), - "criteria"_a = RANSACConvergenceCriteria(100000, 0.999)); + m_registration.def( + "registration_ransac_based_on_feature_matching", + &RegistrationRANSACBasedOnFeatureMatching, + py::call_guard(), + "Function for global RANSAC registration based on feature matching", + "source"_a, "target"_a, "source_feature"_a, "target_feature"_a, + "mutual_filter"_a, "max_correspondence_distance"_a, + "estimation_method"_a = TransformationEstimationPointToPoint(false), + "ransac_n"_a = 3, + "checkers"_a = std::vector< + std::reference_wrapper>(), + "criteria"_a = RANSACConvergenceCriteria(100000, 0.999)); docstring::FunctionDocInject( - m, "registration_ransac_based_on_feature_matching", + m_registration, "registration_ransac_based_on_feature_matching", map_shared_argument_docstrings); - m.def("registration_fgr_based_on_correspondence", - &FastGlobalRegistrationBasedOnCorrespondence, - py::call_guard(), - "Function for fast global registration based on a set of " - "correspondences", - "source"_a, "target"_a, "corres"_a, - "option"_a = FastGlobalRegistrationOption()); - docstring::FunctionDocInject(m, "registration_fgr_based_on_correspondence", + m_registration.def( + "registration_fgr_based_on_correspondence", + &FastGlobalRegistrationBasedOnCorrespondence, + py::call_guard(), + "Function for fast global registration based on a set of " + "correspondences", + "source"_a, "target"_a, "corres"_a, + "option"_a = FastGlobalRegistrationOption()); + docstring::FunctionDocInject(m_registration, + "registration_fgr_based_on_correspondence", map_shared_argument_docstrings); - m.def("registration_fgr_based_on_feature_matching", - &FastGlobalRegistrationBasedOnFeatureMatching, - py::call_guard(), - "Function for fast global registration based on feature matching", - "source"_a, "target"_a, "source_feature"_a, "target_feature"_a, - "option"_a = FastGlobalRegistrationOption()); - docstring::FunctionDocInject(m, + m_registration.def( + "registration_fgr_based_on_feature_matching", + &FastGlobalRegistrationBasedOnFeatureMatching, + py::call_guard(), + "Function for fast global registration based on feature matching", + "source"_a, "target"_a, "source_feature"_a, "target_feature"_a, + "option"_a = FastGlobalRegistrationOption()); + docstring::FunctionDocInject(m_registration, "registration_fgr_based_on_feature_matching", map_shared_argument_docstrings); - m.def("get_information_matrix_from_point_clouds", - &GetInformationMatrixFromPointClouds, - py::call_guard(), - "Function for computing information matrix from transformation " - "matrix", - "source"_a, "target"_a, "max_correspondence_distance"_a, - "transformation"_a); - docstring::FunctionDocInject(m, "get_information_matrix_from_point_clouds", + m_registration.def( + "get_information_matrix_from_point_clouds", + &GetInformationMatrixFromPointClouds, + py::call_guard(), + "Function for computing information matrix from transformation " + "matrix", + "source"_a, "target"_a, "max_correspondence_distance"_a, + "transformation"_a); + docstring::FunctionDocInject(m_registration, + "get_information_matrix_from_point_clouds", map_shared_argument_docstrings); -} - -void pybind_registration(py::module &m) { - py::module m_submodule = - m.def_submodule("registration", "Registration pipeline."); - pybind_registration_classes(m_submodule); - pybind_registration_methods(m_submodule); - - pybind_feature(m_submodule); - pybind_feature_methods(m_submodule); - pybind_global_optimization(m_submodule); - pybind_global_optimization_methods(m_submodule); - pybind_robust_kernels(m_submodule); + pybind_feature_definitions(m_registration); + pybind_global_optimization_definitions(m_registration); + pybind_robust_kernels_definitions(m_registration); } } // namespace registration diff --git a/cpp/pybind/pipelines/registration/registration.h b/cpp/pybind/pipelines/registration/registration.h index 17eb18a3b02..ff1240bf5a2 100644 --- a/cpp/pybind/pipelines/registration/registration.h +++ b/cpp/pybind/pipelines/registration/registration.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -13,13 +13,15 @@ namespace open3d { namespace pipelines { namespace registration { -void pybind_registration(py::module &m); +void pybind_registration_declarations(py::module &m); +void pybind_feature_declarations(py::module &m_registration); +void pybind_global_optimization_declarations(py::module &m_registration); +void pybind_robust_kernels_declarations(py::module &m_registration); -void pybind_feature(py::module &m); -void pybind_feature_methods(py::module &m); -void pybind_global_optimization(py::module &m); -void pybind_global_optimization_methods(py::module &m); -void pybind_robust_kernels(py::module &m); +void pybind_registration_definitions(py::module &m); +void pybind_feature_definitions(py::module &m_registration); +void pybind_global_optimization_definitions(py::module &m_registration); +void pybind_robust_kernels_definitions(py::module &m_registration); } // namespace registration } // namespace pipelines diff --git a/cpp/pybind/pipelines/registration/robust_kernels.cpp b/cpp/pybind/pipelines/registration/robust_kernels.cpp index 5cd8bb83181..f47d6fdb1ff 100644 --- a/cpp/pybind/pipelines/registration/robust_kernels.cpp +++ b/cpp/pybind/pipelines/registration/robust_kernels.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // @author Ignacio Vizzo [ivizzo@uni-bonn.de] @@ -39,10 +39,9 @@ using PyCauchyLoss = PyRobustKernelT; using PyGMLoss = PyRobustKernelT; using PyTukeyLoss = PyRobustKernelT; -void pybind_robust_kernels(py::module &m) { - // open3d.registration.RobustKernel +void pybind_robust_kernels_declarations(py::module &m_registration) { py::class_, PyRobustKernel> rk( - m, "RobustKernel", + m_registration, "RobustKernel", R"( Base class that models a robust kernel for outlier rejection. The virtual function ``weight()`` must be implemented in derived classes. @@ -114,16 +113,8 @@ Philippe Babin et al. For more information please also see: **"Adaptive Robust Kernels for Non-Linear Least Squares Problems"**, by Nived Chebrolu et al. )"); - rk.def("weight", &RobustKernel::Weight, "residual"_a, - "Obtain the weight for the given residual according to the " - "robust kernel model."); - docstring::ClassMethodDocInject( - m, "RobustKernel", "weight", - {{"residual", "value obtained during the optimization problem"}}); - - // open3d.registration.L2Loss py::class_, PyL2Loss, RobustKernel> l2_loss( - m, "L2Loss", + m_registration, "L2Loss", R"( The loss :math:`\rho(r)` for a given residual ``r`` is given by: @@ -133,16 +124,8 @@ The weight :math:`w(r)` for a given residual ``r`` is given by: .. math:: w(r) = 1 )"); - py::detail::bind_default_constructor(l2_loss); - py::detail::bind_copy_functions(l2_loss); - l2_loss.def("__repr__", [](const L2Loss &rk) { - (void)rk; - return "RobustKernel::L2Loss"; - }); - - // open3d.registration.L1Loss:RobustKernel py::class_, PyL1Loss, RobustKernel> l1_loss( - m, "L1Loss", + m_registration, "L1Loss", R"( The loss :math:`\rho(r)` for a given residual ``r`` is given by: @@ -152,16 +135,8 @@ The weight :math:`w(r)` for a given residual ``r`` is given by: .. math:: w(r) = \frac{1}{|r|} )"); - py::detail::bind_default_constructor(l1_loss); - py::detail::bind_copy_functions(l1_loss); - l1_loss.def("__repr__", [](const L1Loss &rk) { - (void)rk; - return "RobustKernel::L1Loss"; - }); - - // open3d.registration.HuberLoss py::class_, PyHuberLoss, RobustKernel> - h_loss(m, "HuberLoss", + h_loss(m_registration, "HuberLoss", R"( The loss :math:`\rho(r)` for a given residual ``r`` is: @@ -185,21 +160,9 @@ The weight :math:`w(r)` for a given residual ``r`` is given by: \end{cases} \end{equation} )"); - py::detail::bind_copy_functions(h_loss); - h_loss.def(py::init( - [](double k) { return std::make_shared(k); }), - "k"_a) - .def("__repr__", - [](const HuberLoss &rk) { - return std::string("RobustKernel::HuberLoss with k=") + - std::to_string(rk.k_); - }) - .def_readwrite("k", &HuberLoss::k_, "Parameter of the loss"); - - // open3d.registration.CauchyLoss py::class_, PyCauchyLoss, RobustKernel> - c_loss(m, "CauchyLoss", + c_loss(m_registration, "CauchyLoss", R"( The loss :math:`\rho(r)` for a given residual ``r`` is: @@ -217,21 +180,8 @@ The weight :math:`w(r)` for a given residual ``r`` is given by: \frac{1}{1 + \left(\frac{r}{k}\right)^2} \end{equation} )"); - py::detail::bind_copy_functions(c_loss); - c_loss.def(py::init([](double k) { - return std::make_shared(k); - }), - "k"_a) - .def("__repr__", - [](const CauchyLoss &rk) { - return std::string("RobustKernel::CauchyLoss with k=") + - std::to_string(rk.k_); - }) - .def_readwrite("k", &CauchyLoss::k_, "Parameter of the loss."); - - // open3d.registration.GMLoss py::class_, PyGMLoss, RobustKernel> gm_loss( - m, "GMLoss", + m_registration, "GMLoss", R"( The loss :math:`\rho(r)` for a given residual ``r`` is: @@ -249,19 +199,8 @@ The weight :math:`w(r)` for a given residual ``r`` is given by: \frac{k}{\left(k + r^2\right)^2} \end{equation} )"); - py::detail::bind_copy_functions(gm_loss); - gm_loss.def(py::init([](double k) { return std::make_shared(k); }), - "k"_a) - .def("__repr__", - [](const GMLoss &rk) { - return std::string("RobustKernel::GMLoss with k=") + - std::to_string(rk.k_); - }) - .def_readwrite("k", &GMLoss::k_, "Parameter of the loss."); - - // open3d.registration.TukeyLoss:RobustKernel py::class_, PyTukeyLoss, RobustKernel> - t_loss(m, "TukeyLoss", + t_loss(m_registration, "TukeyLoss", R"( The loss :math:`\rho(r)` for a given residual ``r`` is: @@ -285,6 +224,92 @@ The weight :math:`w(r)` for a given residual ``r`` is given by: \end{cases} \end{equation} )"); +} +void pybind_robust_kernels_definitions(py::module &m_registration) { + // open3d.registration.RobustKernel + auto rk = + static_cast, + PyRobustKernel>>( + m_registration.attr("RobustKernel")); + rk.def("weight", &RobustKernel::Weight, "residual"_a, + "Obtain the weight for the given residual according to the " + "robust kernel model."); + docstring::ClassMethodDocInject( + m_registration, "RobustKernel", "weight", + {{"residual", "value obtained during the optimization problem"}}); + + // open3d.registration.L2Loss + auto l2_loss = static_cast, + PyL2Loss, RobustKernel>>( + m_registration.attr("L2Loss")); + py::detail::bind_default_constructor(l2_loss); + py::detail::bind_copy_functions(l2_loss); + l2_loss.def("__repr__", [](const L2Loss &rk) { + (void)rk; + return "RobustKernel::L2Loss"; + }); + + // open3d.registration.L1Loss:RobustKernel + auto l1_loss = static_cast, + PyL1Loss, RobustKernel>>( + m_registration.attr("L1Loss")); + py::detail::bind_default_constructor(l1_loss); + py::detail::bind_copy_functions(l1_loss); + l1_loss.def("__repr__", [](const L1Loss &rk) { + (void)rk; + return "RobustKernel::L1Loss"; + }); + + // open3d.registration.HuberLoss + auto h_loss = static_cast, + PyHuberLoss, RobustKernel>>( + m_registration.attr("HuberLoss")); + py::detail::bind_copy_functions(h_loss); + h_loss.def(py::init( + [](double k) { return std::make_shared(k); }), + "k"_a) + .def("__repr__", + [](const HuberLoss &rk) { + return std::string("RobustKernel::HuberLoss with k=") + + std::to_string(rk.k_); + }) + .def_readwrite("k", &HuberLoss::k_, "Parameter of the loss"); + + // open3d.registration.CauchyLoss + auto c_loss = + static_cast, + PyCauchyLoss, RobustKernel>>( + m_registration.attr("CauchyLoss")); + py::detail::bind_copy_functions(c_loss); + c_loss.def(py::init([](double k) { + return std::make_shared(k); + }), + "k"_a) + .def("__repr__", + [](const CauchyLoss &rk) { + return std::string("RobustKernel::CauchyLoss with k=") + + std::to_string(rk.k_); + }) + .def_readwrite("k", &CauchyLoss::k_, "Parameter of the loss."); + + // open3d.registration.GMLoss + auto gm_loss = static_cast, + PyGMLoss, RobustKernel>>( + m_registration.attr("GMLoss")); + py::detail::bind_copy_functions(gm_loss); + gm_loss.def(py::init([](double k) { return std::make_shared(k); }), + "k"_a) + .def("__repr__", + [](const GMLoss &rk) { + return std::string("RobustKernel::GMLoss with k=") + + std::to_string(rk.k_); + }) + .def_readwrite("k", &GMLoss::k_, "Parameter of the loss."); + + // open3d.registration.TukeyLoss:RobustKernel + auto t_loss = static_cast, + PyTukeyLoss, RobustKernel>>( + m_registration.attr("TukeyLoss")); py::detail::bind_copy_functions(t_loss); t_loss.def(py::init( [](double k) { return std::make_shared(k); }), diff --git a/cpp/pybind/pybind_filesystem.h b/cpp/pybind/pybind_filesystem.h index 85028761057..3617d6cad45 100644 --- a/cpp/pybind/pybind_filesystem.h +++ b/cpp/pybind/pybind_filesystem.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/pybind/pybind_utils.cpp b/cpp/pybind/pybind_utils.cpp index 50fafea4a85..f907d0d9c17 100644 --- a/cpp/pybind/pybind_utils.cpp +++ b/cpp/pybind/pybind_utils.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/pybind/pybind_utils.h b/cpp/pybind/pybind_utils.h index d99ea505351..066b54b0112 100644 --- a/cpp/pybind/pybind_utils.h +++ b/cpp/pybind/pybind_utils.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/pybind/t/geometry/boundingvolume.cpp b/cpp/pybind/t/geometry/boundingvolume.cpp index 946fb9617df..ed973e739d5 100644 --- a/cpp/pybind/t/geometry/boundingvolume.cpp +++ b/cpp/pybind/t/geometry/boundingvolume.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -17,32 +17,31 @@ namespace open3d { namespace t { namespace geometry { -void pybind_boundingvolume(py::module& m) { +void pybind_boundingvolume_declarations(py::module& m) { py::class_, std::shared_ptr, Geometry, DrawableGeometry> aabb(m, "AxisAlignedBoundingBox", - R"(A bounding box that is aligned along the coordinate axes -and defined by the min_bound and max_bound." -- (min_bound, max_bound): Lower and upper bounds of the bounding box for all -axes. - - Usage - - AxisAlignedBoundingBox::GetMinBound() - - AxisAlignedBoundingBox::SetMinBound(const core::Tensor &min_bound) - - AxisAlignedBoundingBox::GetMaxBound() - - AxisAlignedBoundingBox::SetMaxBound(const core::Tensor &max_bound) - - Value tensor must have shape {3,}. - - Value tensor must have the same data type and device. - - Value tensor can only be float32 (default) or float64. - - The device of the tensor determines the device of the box. + R"(A bounding box that is aligned along the coordinate axes and +has the properties: -- color: Color of the bounding box. - - Usage - - AxisAlignedBoundingBox::GetColor() - - AxisAlignedBoundingBox::SetColor(const core::Tensor &color) - - Value tensor must have shape {3,}. - - Value tensor can only be float32 (default) or float64. - - Value tensor can only be range [0.0, 1.0].)"); +- (``min_bound``, ``max_bound``): Lower and upper bounds of the bounding box for all axes. These are tensors with shape (3,) and a common data type and device. The data type can only be ``open3d.core.float32`` (default) or ``open3d.core.float64``. The device of the tensor determines the device of the box. +- ``color``: Color of the bounding box is a tensor with shape (3,) and a data type ``open3d.core.float32`` (default) or ``open3d.core.float64``. Values can only be in the range [0.0, 1.0].)"); + py::class_, + std::shared_ptr, Geometry, DrawableGeometry> + obb(m, "OrientedBoundingBox", + R"(A bounding box oriented along an arbitrary frame of reference +with the properties: + +- (``center``, ``rotation``, ``extent``): The oriented bounding box is defined by its center position (shape (3,)), rotation maxtrix (shape (3,3)) and extent (shape (3,)). Each of these tensors must have the same data type and device. The data type can only be ``open3d.core.float32`` (default) or ``open3d.core.float64``. The device of the tensor determines the device of the box. +- ``color``: Color of the bounding box is a tensor with shape (3,) and a data type ``open3d.core.float32`` (default) or ``open3d.core.float64``. Values can only be in the range [0.0, 1.0].)"); +} +void pybind_boundingvolume_definitions(py::module& m) { + auto aabb = static_cast, + std::shared_ptr, + Geometry, DrawableGeometry>>( + m.attr("AxisAlignedBoundingBox")); aabb.def(py::init(), "device"_a = core::Device("CPU:0"), "Construct an empty axis-aligned box on the provided " @@ -50,7 +49,7 @@ axes. aabb.def(py::init(), "min_bound"_a, "max_bound"_a, R"(Construct an axis-aligned box from min/max bound. -The axis-aligned box will be created on the device of the given bound +The axis-aligned box will be created on the device of the given bound tensor, which must be on the same device and have the same data type.)"); docstring::ClassMethodDocInject( m, "AxisAlignedBoundingBox", "__init__", @@ -125,7 +124,7 @@ translation is applied to make the box's center at the given translation.)", aabb.def("scale", &AxisAlignedBoundingBox::Scale, R"(Scale the axis-aligned box. If \f$mi\f$ is the min_bound and \f$ma\f$ is the max_bound of the axis aligned -bounding box, and \f$s\f$ and \f$c\f$ are the provided scaling factor and +bounding box, and \f$s\f$ and \f$c\f$ are the provided scaling factor and center respectively, then the new min_bound and max_bound are given by \f$mi = c + s (mi - c)\f$ and \f$ma = c + s (ma - c)\f$. The scaling center will be the box center if it is not specified.)", @@ -198,38 +197,17 @@ The scaling center will be the box center if it is not specified.)", {{"points", "A list of points with data type of float32 or float64 (N x 3 " "tensor)."}}); - - py::class_, - std::shared_ptr, Geometry, DrawableGeometry> - obb(m, "OrientedBoundingBox", - R"(A bounding box oriented along an arbitrary frame of reference. -- (center, rotation, extent): The oriented bounding box is defined by its -center position, rotation maxtrix and extent. - - Usage - - OrientedBoundingBox::GetCenter() - - OrientedBoundingBox::SetCenter(const core::Tensor ¢er) - - OrientedBoundingBox::GetRotation() - - OrientedBoundingBox::SetRotation(const core::Tensor &rotation) - - Value tensor of center and extent must have shape {3,}. - - Value tensor of rotation must have shape {3, 3}. - - Value tensor must have the same data type and device. - - Value tensor can only be float32 (default) or float64. - - The device of the tensor determines the device of the box. - -- color: Color of the bounding box. - - Usage - - OrientedBoundingBox::GetColor() - - OrientedBoundingBox::SetColor(const core::Tensor &color) - - Value tensor must have shape {3,}. - - Value tensor can only be float32 (default) or float64. - - Value tensor can only be range [0.0, 1.0].)"); + auto obb = static_cast, + std::shared_ptr, Geometry, DrawableGeometry>>( + m.attr("OrientedBoundingBox")); obb.def(py::init(), "device"_a = core::Device("CPU:0"), "Construct an empty OrientedBoundingBox on the provided device."); obb.def(py::init(), "center"_a, "rotation"_a, "extent"_a, - R"(Construct an OrientedBoundingBox from center, rotation and extent. -The OrientedBoundingBox will be created on the device of the given tensors, which + R"(Construct an OrientedBoundingBox from center, rotation and extent. +The OrientedBoundingBox will be created on the device of the given tensors, which must be on the same device and have the same data type.)"); docstring::ClassMethodDocInject( m, "OrientedBoundingBox", "__init__", @@ -295,7 +273,7 @@ must be on the same device and have the same data type.)"); obb.def("translate", &OrientedBoundingBox::Translate, R"(Translate the oriented box by the given translation. If relative is true, the translation is -added to the center of the box. If false, the center will be assigned to the +added to the center of the box. If false, the center will be assigned to the translation.)", "translation"_a, "relative"_a = true); obb.def("rotate", &OrientedBoundingBox::Rotate, @@ -309,7 +287,7 @@ The rotation center will be the box center if it is not specified.)", obb.def("scale", &OrientedBoundingBox::Scale, R"(Scale the axis-aligned box. If \f$mi\f$ is the min_bound and \f$ma\f$ is the max_bound of the axis aligned -bounding box, and \f$s\f$ and \f$c\f$ are the provided scaling factor and +bounding box, and \f$s\f$ and \f$c\f$ are the provided scaling factor and center respectively, then the new min_bound and max_bound are given by \f$mi = c + s (mi - c)\f$ and \f$ma = c + s (ma - c)\f$. The scaling center will be the box center if it is not specified.)", @@ -341,7 +319,7 @@ The scaling center will be the box center if it is not specified.)", obb.def_static("create_from_points", &OrientedBoundingBox::CreateFromPoints, R"(Creates an oriented bounding box using a PCA. Note that this is only an approximation to the minimum oriented bounding box -that could be computed for example with O'Rourke's algorithm +that could be computed for example with O'Rourke's algorithm (cf. http://cs.smith.edu/~jorourke/Papers/MinVolBox.pdf, https://www.geometrictools.com/Documentation/MinimumVolumeBox.pdf) This is a wrapper for a CPU implementation.)", "points"_a, "robust"_a = false); diff --git a/cpp/pybind/t/geometry/drawablegeometry.cpp b/cpp/pybind/t/geometry/drawablegeometry.cpp index 7d4a11493fc..7408c503a38 100644 --- a/cpp/pybind/t/geometry/drawablegeometry.cpp +++ b/cpp/pybind/t/geometry/drawablegeometry.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -13,12 +13,17 @@ namespace open3d { namespace t { namespace geometry { -void pybind_drawable_geometry_class(py::module& m) { - // open3d.t.geometry.DrawableGeometry +void pybind_drawable_geometry_class_declarations(py::module& m) { py::class_> drawable_geometry( m, "DrawableGeometry", "Base class for geometry types which can be visualized."); +} +void pybind_drawable_geometry_class_definitions(py::module& m) { + // open3d.t.geometry.DrawableGeometry + auto drawable_geometry = static_cast< + py::class_>>( + m.attr("DrawableGeometry")); drawable_geometry.def("has_valid_material", &DrawableGeometry::HasMaterial, "Returns true if the geometry's material is valid."); drawable_geometry.def_property( diff --git a/cpp/pybind/t/geometry/geometry.cpp b/cpp/pybind/t/geometry/geometry.cpp index 9563fbb215f..f6c57124c84 100644 --- a/cpp/pybind/t/geometry/geometry.cpp +++ b/cpp/pybind/t/geometry/geometry.cpp @@ -1,24 +1,36 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- #include "open3d/t/geometry/Geometry.h" +#include +#include + +#include +#include + #include "pybind/docstring.h" +#include "pybind/open3d_pybind.h" #include "pybind/t/geometry/geometry.h" namespace open3d { namespace t { namespace geometry { -void pybind_geometry_class(py::module& m) { - // open3d.t.geometry.Geometry +void pybind_geometry_class_declarations(py::module& m) { py::class_, std::shared_ptr> geometry(m, "Geometry", "The base geometry class."); +} +void pybind_geometry_class_definitions(py::module& m) { + // open3d.t.geometry.Geometry + auto geometry = static_cast, + std::shared_ptr>>( + m.attr("Geometry")); geometry.def("clear", &Geometry::Clear, "Clear all elements in the geometry."); geometry.def("is_empty", &Geometry::IsEmpty, @@ -33,20 +45,82 @@ void pybind_geometry_class(py::module& m) { docstring::ClassMethodDocInject(m, "Geometry", "is_empty"); } -void pybind_geometry(py::module& m) { - py::module m_submodule = m.def_submodule( +void pybind_geometry_declarations(py::module& m) { + py::module m_geometry = m.def_submodule( "geometry", "Tensor-based geometry defining module."); - pybind_geometry_class(m_submodule); - pybind_drawable_geometry_class(m_submodule); - pybind_tensormap(m_submodule); - pybind_pointcloud(m_submodule); - pybind_lineset(m_submodule); - pybind_trianglemesh(m_submodule); - pybind_image(m_submodule); - pybind_boundingvolume(m_submodule); - pybind_voxel_block_grid(m_submodule); - pybind_raycasting_scene(m_submodule); + py::enum_( + m_geometry, "Metric", + "Enum for metrics for comparing point clouds and triangle meshes.") + .value("ChamferDistance", Metric::ChamferDistance, + "Chamfer Distance") + .value("HausdorffDistance", Metric::HausdorffDistance, + "Hausdorff Distance") + .value("FScore", Metric::FScore, "F-Score") + .export_values(); + py::class_ metric_parameters( + m_geometry, "MetricParameters", + "Holder for various parameters required by metrics."); + + pybind_geometry_class_declarations(m_geometry); + pybind_drawable_geometry_class_declarations(m_geometry); + pybind_tensormap_declarations(m_geometry); + pybind_pointcloud_declarations(m_geometry); + pybind_lineset_declarations(m_geometry); + pybind_trianglemesh_declarations(m_geometry); + pybind_image_declarations(m_geometry); + pybind_boundingvolume_declarations(m_geometry); + pybind_voxel_block_grid_declarations(m_geometry); + pybind_raycasting_scene_declarations(m_geometry); +} + +void pybind_geometry_definitions(py::module& m) { + auto m_geometry = static_cast(m.attr("geometry")); + py::bind_vector>(m_geometry, "VectorMetric"); + + auto metric_parameters = static_cast>( + m_geometry.attr("MetricParameters")); + // Use std::deque instead of std::vector to enable automatic Python list / + // tuple conversion. FIXME: Ideally this should work for std::vector. + metric_parameters + .def(py::init([](const std::deque& fsr, size_t nsp) { + std::vector fsrvec{fsr.begin(), fsr.end()}; + return MetricParameters{fsrvec, nsp}; + }), + "fscore_radius"_a = std::deque{0.01f}, + "n_sampled_points"_a = 1000) + .def_property( + "fscore_radius", + [](const MetricParameters& self) { // getter + return std::deque(self.fscore_radius.begin(), + self.fscore_radius.end()); + }, + [](MetricParameters& self, + const std::deque& fsr) { // setter + self.fscore_radius = + std::vector(fsr.begin(), fsr.end()); + }, + "Radius for computing the F-Score. A match between " + "a point and its nearest neighbor is sucessful if " + "it is within this radius.") + .def_readwrite("n_sampled_points", + &MetricParameters::n_sampled_points, + "Points are sampled uniformly from the surface of " + "triangle meshes before distance computation. This " + "specifies the number of points sampled. No " + "sampling is done for point clouds.") + .def("__repr__", &MetricParameters::ToString); + + pybind_geometry_class_definitions(m_geometry); + pybind_drawable_geometry_class_definitions(m_geometry); + pybind_tensormap_definitions(m_geometry); + pybind_pointcloud_definitions(m_geometry); + pybind_lineset_definitions(m_geometry); + pybind_trianglemesh_definitions(m_geometry); + pybind_image_definitions(m_geometry); + pybind_boundingvolume_definitions(m_geometry); + pybind_voxel_block_grid_definitions(m_geometry); + pybind_raycasting_scene_definitions(m_geometry); } } // namespace geometry diff --git a/cpp/pybind/t/geometry/geometry.h b/cpp/pybind/t/geometry/geometry.h index 6e1271083df..1776a283cd1 100644 --- a/cpp/pybind/t/geometry/geometry.h +++ b/cpp/pybind/t/geometry/geometry.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -34,18 +34,29 @@ class PyGeometry : public GeometryBase { } }; -void pybind_geometry(py::module& m); -void pybind_geometry_class(py::module& m); -void pybind_drawable_geometry_class(py::module& m); -void pybind_tensormap(py::module& m); -void pybind_image(py::module& m); -void pybind_pointcloud(py::module& m); -void pybind_lineset(py::module& m); -void pybind_trianglemesh(py::module& m); -void pybind_image(py::module& m); -void pybind_boundingvolume(py::module& m); -void pybind_voxel_block_grid(py::module& m); -void pybind_raycasting_scene(py::module& m); +void pybind_geometry_declarations(py::module& m); +void pybind_geometry_class_declarations(py::module& m); +void pybind_drawable_geometry_class_declarations(py::module& m); +void pybind_tensormap_declarations(py::module& m); +void pybind_pointcloud_declarations(py::module& m); +void pybind_lineset_declarations(py::module& m); +void pybind_trianglemesh_declarations(py::module& m); +void pybind_image_declarations(py::module& m); +void pybind_boundingvolume_declarations(py::module& m); +void pybind_voxel_block_grid_declarations(py::module& m); +void pybind_raycasting_scene_declarations(py::module& m); + +void pybind_geometry_definitions(py::module& m); +void pybind_geometry_class_definitions(py::module& m); +void pybind_drawable_geometry_class_definitions(py::module& m); +void pybind_tensormap_definitions(py::module& m); +void pybind_pointcloud_definitions(py::module& m); +void pybind_lineset_definitions(py::module& m); +void pybind_trianglemesh_definitions(py::module& m); +void pybind_image_definitions(py::module& m); +void pybind_boundingvolume_definitions(py::module& m); +void pybind_voxel_block_grid_definitions(py::module& m); +void pybind_raycasting_scene_definitions(py::module& m); } // namespace geometry } // namespace t diff --git a/cpp/pybind/t/geometry/image.cpp b/cpp/pybind/t/geometry/image.cpp index b9fe3c20725..1d63432f1c6 100644 --- a/cpp/pybind/t/geometry/image.cpp +++ b/cpp/pybind/t/geometry/image.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -53,12 +53,11 @@ static const std::unordered_map {"distance_sigma", "Standard deviation for the image pixel positions."}}; -void pybind_image(py::module &m) { +void pybind_image_declarations(py::module &m) { py::class_, std::shared_ptr, Geometry> image(m, "Image", py::buffer_protocol(), "The Image class stores image with customizable rols, cols, " "channels, dtype and device."); - py::enum_(m, "InterpType", "Interpolation type.") .value("Nearest", Image::InterpType::Nearest) .value("Linear", Image::InterpType::Linear) @@ -66,7 +65,19 @@ void pybind_image(py::module &m) { .value("Lanczos", Image::InterpType::Lanczos) .value("Super", Image::InterpType::Super) .export_values(); - + py::class_, std::shared_ptr, + Geometry> + rgbd_image( + m, "RGBDImage", + "RGBDImage is a pair of color and depth images. For most " + "processing, the image pair should be aligned (same " + "viewpoint and " + "resolution)."); +} +void pybind_image_definitions(py::module &m) { + auto image = static_cast, + std::shared_ptr, Geometry>>( + m.attr("Image")); // Constructors image.def(py::init(), "Row-major storage is used, similar to OpenCV. Use (row, col, " @@ -170,7 +181,8 @@ void pybind_image(py::module &m) { "Upsample if sampling rate > 1. Aspect ratio is always " "kept.", "sampling_rate"_a = 0.5, - "interp_type"_a = Image::InterpType::Nearest) + py::arg_v("interp_type", Image::InterpType::Nearest, + "open3d.t.geometry.InterpType.Nearest")) .def("pyrdown", &Image::PyrDown, "Return a new downsampled image with pyramid downsampling " "formed by a chained Gaussian filter (kernel_size = 5, sigma" @@ -266,15 +278,10 @@ void pybind_image(py::module &m) { docstring::ClassMethodDocInject(m, "Image", "clear"); docstring::ClassMethodDocInject(m, "Image", "is_empty"); docstring::ClassMethodDocInject(m, "Image", "to_legacy"); - - py::class_, std::shared_ptr, - Geometry> - rgbd_image( - m, "RGBDImage", - "RGBDImage is a pair of color and depth images. For most " - "processing, the image pair should be aligned (same " - "viewpoint and " - "resolution)."); + auto rgbd_image = + static_cast, + std::shared_ptr, Geometry>>( + m.attr("RGBDImage")); rgbd_image // Constructors. .def(py::init<>(), "Construct an empty RGBDImage.") diff --git a/cpp/pybind/t/geometry/lineset.cpp b/cpp/pybind/t/geometry/lineset.cpp index 299deef36b0..6d209646abd 100644 --- a/cpp/pybind/t/geometry/lineset.cpp +++ b/cpp/pybind/t/geometry/lineset.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -19,7 +19,7 @@ namespace open3d { namespace t { namespace geometry { -void pybind_lineset(py::module& m) { +void pybind_lineset_declarations(py::module& m) { py::class_, std::shared_ptr, Geometry, DrawableGeometry> line_set(m, "LineSet", R"( @@ -72,7 +72,12 @@ The attributes of the line set have different levels:: lineset.point.labels = o3d.core.Tensor(...) lineset.line.features = o3d.core.Tensor(...) )"); +} +void pybind_lineset_definitions(py::module& m) { + auto line_set = static_cast< + py::class_, std::shared_ptr, + Geometry, DrawableGeometry>>(m.attr("LineSet")); // Constructors. line_set.def(py::init(), "device"_a = core::Device("CPU:0"), @@ -252,12 +257,9 @@ transformation as :math:`P = R(P) + t`)"); Args: angle (float): The rotation angle in degree. - axis (open3d.core.Tensor): The rotation axis. - resolution (int): The resolution defines the number of intermediate sweeps about the rotation axis. - translation (float): The translation along the rotation axis. Returns: @@ -265,7 +267,6 @@ transformation as :math:`P = R(P) + t`)"); Example: - This code generates a spring from a single line:: import open3d as o3d @@ -281,9 +282,7 @@ transformation as :math:`P = R(P) + t`)"); R"(Sweeps the line set along a direction vector. Args: - vector (open3d.core.Tensor): The direction vector. - scale (float): Scalar factor which essentially scales the direction vector. Returns: @@ -291,8 +290,8 @@ transformation as :math:`P = R(P) + t`)"); Example: - This code generates an L-shaped mesh:: + import open3d as o3d lines = o3d.t.geometry.LineSet([[1.0,0.0,0.0],[0,0,0],[0,0,1]], [[0,1],[1,2]]) @@ -307,7 +306,10 @@ transformation as :math:`P = R(P) + t`)"); line_set.def_static( "create_camera_visualization", &LineSet::CreateCameraVisualization, "view_width_px"_a, "view_height_px"_a, "intrinsic"_a, "extrinsic"_a, - "scale"_a = 1.f, "color"_a = core::Tensor({}, core::Float32), + "scale"_a = 1.f, + py::arg_v( + "color", core::Tensor({}, core::Float32), + "open3d.core.Tensor([], dtype=open3d.core.Dtype.Float32)"), R"(Factory function to create a LineSet from intrinsic and extrinsic matrices. Camera reference frame is shown with XYZ axes in RGB. @@ -321,7 +323,7 @@ matrices. Camera reference frame is shown with XYZ axes in RGB. Example: - Draw a purple camera frame with XYZ axes in RGB. + Draw a purple camera frame with XYZ axes in RGB:: import open3d.core as o3c from open3d.t.geometry import LineSet diff --git a/cpp/pybind/t/geometry/pointcloud.cpp b/cpp/pybind/t/geometry/pointcloud.cpp index a36813fd353..e5bac211b90 100644 --- a/cpp/pybind/t/geometry/pointcloud.cpp +++ b/cpp/pybind/t/geometry/pointcloud.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -47,7 +47,7 @@ static const std::unordered_map "neighbors search radius parameter to use HybridSearch. " "[Recommended ~1.4x voxel size]."}}; -void pybind_pointcloud(py::module& m) { +void pybind_pointcloud_declarations(py::module& m) { py::class_, std::shared_ptr, Geometry, DrawableGeometry> pointcloud(m, "PointCloud", @@ -95,7 +95,12 @@ The attributes of the point cloud have different levels:: pcd.point.intensities = o3d.core.Tensor([0.3, 0.1, 0.4], dtype, device) pcd.point.labels = o3d.core.Tensor([3, 1, 4], o3d.core.int32, device) )"); - +} +void pybind_pointcloud_definitions(py::module& m) { + auto pointcloud = + static_cast, + std::shared_ptr, Geometry, + DrawableGeometry>>(m.attr("PointCloud")); // Constructors. pointcloud .def(py::init(), @@ -251,12 +256,15 @@ The attributes of the point cloud have different levels:: "of points has farthest distance.The sampling is performed " "by selecting the farthest point from previous selected " "points iteratively", - "num_samples"_a); - pointcloud.def( - "remove_radius_outliers", &PointCloud::RemoveRadiusOutliers, - "nb_points"_a, "search_radius"_a, - R"(Remove points that have less than nb_points neighbors in a -sphere of a given search radius. + "num_samples"_a, + "Index to start downsampling from. Valid index is a " + "non-negative number less than number of points in the " + "input pointcloud.", + "start_index"_a = 0); + pointcloud.def("remove_radius_outliers", &PointCloud::RemoveRadiusOutliers, + "nb_points"_a, "search_radius"_a, + R"(Remove points that have less than nb_points neighbors in a +sphere of a given search radius. Args: nb_points: Number of neighbor points required within the radius. @@ -270,7 +278,7 @@ sphere of a given search radius. &PointCloud::RemoveStatisticalOutliers, "nb_neighbors"_a, "std_ratio"_a, R"(Remove points that are further away from their \p nb_neighbor -neighbors in average. This function is not recommended to use on GPU. +neighbors in average. This function is not recommended to use on GPU. Args: nb_neighbors: Number of neighbors around the target point. @@ -285,9 +293,9 @@ neighbors in average. This function is not recommended to use on GPU. pointcloud.def( "remove_non_finite_points", &PointCloud::RemoveNonFinitePoints, "remove_nan"_a = true, "remove_infinite"_a = true, - R"(Remove all points from the point cloud that have a nan entry, or -infinite value. It also removes the corresponding attributes. - + R"(Remove all points from the point cloud that have a nan entry, or +infinite value. It also removes the corresponding attributes. + Args: remove_nan: Remove NaN values from the PointCloud. remove_infinite: Remove infinite values from the PointCloud. @@ -326,31 +334,31 @@ infinite value. It also removes the corresponding attributes. "lambda"_a = 0.0, "cos_alpha_tol"_a = 1.0, R"(Function to consistently orient the normals of a point cloud based on tangent planes. -The algorithm is described in Hoppe et al., "Surface Reconstruction from Unorganized Points", 1992. +The algorithm is described in Hoppe et al., "Surface Reconstruction from Unorganized Points", 1992. Additional information about the choice of lambda and cos_alpha_tol for complex -point clouds can be found in Piazza, Valentini, Varetti, "Mesh Reconstruction from Point Cloud", 2023 +point clouds can be found in Piazza, Valentini, Varetti, "Mesh Reconstruction from Point Cloud", 2023 (https://eugeniovaretti.github.io/meshreco/Piazza_Valentini_Varetti_MeshReconstructionFromPointCloud_2023.pdf). Args: k (int): Number of neighbors to use for tangent plane estimation. - lambda (float): A non-negative real parameter that influences the distance - metric used to identify the true neighbors of a point in complex - geometries. It penalizes the distance between a point and the tangent - plane defined by the reference point and its normal vector, helping to - mitigate misclassification issues encountered with traditional + lambda (float): A non-negative real parameter that influences the distance + metric used to identify the true neighbors of a point in complex + geometries. It penalizes the distance between a point and the tangent + plane defined by the reference point and its normal vector, helping to + mitigate misclassification issues encountered with traditional Euclidean distance metrics. - cos_alpha_tol (float): Cosine threshold angle used to determine the - inclusion boundary of neighbors based on the direction of the normal + cos_alpha_tol (float): Cosine threshold angle used to determine the + inclusion boundary of neighbors based on the direction of the normal vector. Example: We use Bunny point cloud to compute its normals and orient them consistently. - The initial reconstruction adheres to Hoppe's algorithm (raw), whereas the - second reconstruction utilises the lambda and cos_alpha_tol parameters. + The initial reconstruction adheres to Hoppe's algorithm (raw), whereas the + second reconstruction utilises the lambda and cos_alpha_tol parameters. Due to the high density of the Bunny point cloud available in Open3D a larger - value of the parameter k is employed to test the algorithm. Usually you do - not have at disposal such a refined point clouds, thus you cannot find a - proper choice of k: refer to + value of the parameter k is employed to test the algorithm. Usually you do + not have at disposal such a refined point clouds, thus you cannot find a + proper choice of k: refer to https://eugeniovaretti.github.io/meshreco for these cases.:: import open3d as o3d @@ -428,14 +436,18 @@ point clouds can be found in Piazza, Valentini, Varetti, "Mesh Reconstruction fr // processing pointcloud.def("project_to_depth_image", &PointCloud::ProjectToDepthImage, "width"_a, "height"_a, "intrinsics"_a, - "extrinsics"_a = core::Tensor::Eye(4, core::Float32, - core::Device("CPU:0")), + py::arg_v("extrinsics", + core::Tensor::Eye(4, core::Float32, + core::Device("CPU:0")), + "open3d.core.Tensor.eye(4)"), "depth_scale"_a = 1000.0, "depth_max"_a = 3.0, "Project a point cloud to a depth image."); pointcloud.def("project_to_rgbd_image", &PointCloud::ProjectToRGBDImage, "width"_a, "height"_a, "intrinsics"_a, - "extrinsics"_a = core::Tensor::Eye(4, core::Float32, - core::Device("CPU:0")), + py::arg_v("extrinsics", + core::Tensor::Eye(4, core::Float32, + core::Device("CPU:0")), + "open3d.core.Tensor.eye(4)"), "depth_scale"_a = 1000.0, "depth_max"_a = 3.0, "Project a colored point cloud to a RGBD image."); pointcloud.def( @@ -652,7 +664,8 @@ The implementation is inspired by the PCL implementation. Reference: "in the pointcloud."}}); docstring::ClassMethodDocInject( m, "PointCloud", "farthest_point_down_sample", - {{"num_samples", "Number of points to be sampled."}}); + {{"num_samples", "Number of points to be sampled."}, + {"start_index", "Index of point to start downsampling from."}}); docstring::ClassMethodDocInject( m, "PointCloud", "remove_radius_outliers", {{"nb_points", @@ -690,13 +703,13 @@ The implementation is inspired by the PCL implementation. Reference: Args: angle (float): The rotation angle in degree. - + axis (open3d.core.Tensor): The rotation axis. - + resolution (int): The resolution defines the number of intermediate sweeps about the rotation axis. - translation (float): The translation along the rotation axis. + translation (float): The translation along the rotation axis. Returns: A line set with the result of the sweep operation. @@ -719,9 +732,9 @@ The implementation is inspired by the PCL implementation. Reference: R"(Sweeps the point cloud along a direction vector. Args: - + vector (open3d.core.Tensor): The direction vector. - + scale (float): Scalar factor which essentially scales the direction vector. Returns: @@ -731,7 +744,7 @@ The implementation is inspired by the PCL implementation. Reference: Example: This code generates a set of straight lines from a point cloud:: - + import open3d as o3d import numpy as np pcd = o3d.t.geometry.PointCloud(np.random.rand(10,3)) @@ -743,7 +756,7 @@ The implementation is inspired by the PCL implementation. Reference: pointcloud.def("pca_partition", &PointCloud::PCAPartition, "max_points"_a, R"(Partition the point cloud by recursively doing PCA. -This function creates a new point attribute with the name "partition_ids" storing +This function creates a new point attribute with the name "partition_ids" storing the partition id for each point. Args: @@ -764,6 +777,61 @@ the partition id for each point. print(np.unique(pcd.point.partition_ids.numpy(), return_counts=True)) )"); + + pointcloud.def("compute_metrics", &PointCloud::ComputeMetrics, "pcd2"_a, + "metrics"_a, "params"_a, + R"(Compute various metrics between two point clouds. + +Currently, Chamfer distance, Hausdorff distance and F-Score `[Knapitsch2017] <../tutorial/reference.html#Knapitsch2017>`_ are supported. +The Chamfer distance is the sum of the mean distance to the nearest neighbor +from the points of the first point cloud to the second point cloud. The F-Score +at a fixed threshold radius is the harmonic mean of the Precision and Recall. +Recall is the percentage of surface points from the first point cloud that have +the second point cloud points within the threshold radius, while Precision is +the percentage of points from the second point cloud that have the first point +cloud points within the threhold radius. + +.. math:: + :nowrap: + + \begin{align} + \text{Chamfer Distance: } d_{CD}(X,Y) &= \frac{1}{|X|}\sum_{i \in X} || x_i - n(x_i, Y) || + \frac{1}{|Y|}\sum_{i \in Y} || y_i - n(y_i, X) ||\\ + \text{Hausdorff distance: } d_H(X,Y) &= \max \left\{ \max_{i \in X} || x_i - n(x_i, Y) ||, \max_{i \in Y} || y_i - n(y_i, X) || \right\}\\ + \text{Precision: } P(X,Y|d) &= \frac{100}{|X|} \sum_{i \in X} || x_i - n(x_i, Y) || < d \\ + \text{Recall: } R(X,Y|d) &= \frac{100}{|Y|} \sum_{i \in Y} || y_i - n(y_i, X) || < d \\ + \text{F-Score: } F(X,Y|d) &= \frac{2 P(X,Y|d) R(X,Y|d)}{P(X,Y|d) + R(X,Y|d)} \\ + \end{align} + +Args: + pcd2 (t.geometry.PointCloud): Other point cloud to compare with. + metrics (Sequence[t.geometry.Metric]): List of Metric s to compute. Multiple metrics can be computed at once for efficiency. + params (t.geometry.MetricParameters): This holds parameters required by different metrics. + +Returns: + Tensor containing the requested metrics. + +Example:: + + from open3d.t.geometry import TriangleMesh, PointCloud, Metric, MetricParameters + # box is a cube with one vertex at the origin and a side length 1 + pos = TriangleMesh.create_box().vertex.positions + pcd1 = PointCloud(pos.clone()) + pcd2 = PointCloud(pos * 1.1) + + # (1, 3, 3, 1) vertices are shifted by (0, 0.1, 0.1*sqrt(2), 0.1*sqrt(3)) + # respectively + metric_params = MetricParameters( + fscore_radius=o3d.utility.FloatVector((0.01, 0.11, 0.15, 0.18))) + metrics = pcd1.compute_metrics( + pcd2, (Metric.ChamferDistance, Metric.HausdorffDistance, Metric.FScore), + metric_params) + + print(metrics) + np.testing.assert_allclose( + metrics.cpu().numpy(), + (0.22436734, np.sqrt(3) / 10, 100. / 8, 400. / 8, 700. / 8, 100.), + rtol=1e-6) + )"); } } // namespace geometry diff --git a/cpp/pybind/t/geometry/raycasting_scene.cpp b/cpp/pybind/t/geometry/raycasting_scene.cpp index e7f6dcecbd5..0d924fc749b 100644 --- a/cpp/pybind/t/geometry/raycasting_scene.cpp +++ b/cpp/pybind/t/geometry/raycasting_scene.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -13,7 +13,7 @@ namespace open3d { namespace t { namespace geometry { -void pybind_raycasting_scene(py::module& m) { +void pybind_raycasting_scene_declarations(py::module& m) { py::class_ raycasting_scene(m, "RaycastingScene", R"doc( A scene class with basic ray casting and closest point queries. @@ -22,7 +22,7 @@ or compute the closest point on the surface of a mesh with respect to one or more query points. It builds an internal acceleration structure to speed up those queries. -This class supports only the CPU device. +This class supports the CPU device and SYCL GPU device. The following shows how to create a scene and compute ray intersections:: @@ -52,13 +52,19 @@ The following shows how to create a scene and compute ray intersections:: plt.imshow(ans['t_hit'].numpy()) )doc"); +} +void pybind_raycasting_scene_definitions(py::module& m) { + auto raycasting_scene = + static_cast>(m.attr("RaycastingScene")); // Constructors. - raycasting_scene.def(py::init(), "nthreads"_a = 0, R"doc( + raycasting_scene.def(py::init(), "nthreads"_a = 0, + "device"_a = core::Device("CPU:0"), R"doc( Create a RaycastingScene. Args: nthreads (int): The number of threads to use for building the scene. Set to 0 for automatic. + device (open3d.core.Device): The device to use. Currently CPU and SYCL devices are supported. )doc"); raycasting_scene.def( @@ -219,7 +225,7 @@ Lists the intersections of the rays with the scene:: # Calculate intersection coordinates using ray_ids c = rays[lx['ray_ids']][:,:3] + rays[lx['ray_ids']][:,3:]*lx['t_hit'][...,None] - + # Visualize the rays and intersections. lines = o3d.t.geometry.LineSet() lines.point.positions = np.hstack([orig,dest]).reshape(-1,3) @@ -234,35 +240,35 @@ Lists the intersections of the rays with the scene:: Float32 describing the rays; {..} can be any number of dimensions. The last dimension must be 6 and has the format [ox, oy, oz, dx, dy, dz] with [ox,oy,oz] as the origin and [dx,dy,dz] as the direction. It is not - necessary to normalize the direction although it should be normalised if + necessary to normalize the direction although it should be normalised if t_hit is to be calculated in coordinate units. nthreads (int): The number of threads to use. Set to 0 for automatic. Returns: The returned dictionary contains - + ray_splits A tensor with ray intersection splits. Can be used to iterate over all intersections for each ray. The shape is {num_rays + 1}. - + ray_ids A tensor with ray IDs. The shape is {num_intersections}. - + t_hit - A tensor with the distance to the hit. The shape is {num_intersections}. - + A tensor with the distance to the hit. The shape is {num_intersections}. + geometry_ids A tensor with the geometry IDs. The shape is {num_intersections}. primitive_ids A tensor with the primitive IDs, which corresponds to the triangle index. The shape is {num_intersections}. - - primitive_uvs - A tensor with the barycentric coordinates of the intersection points within + + primitive_uvs + A tensor with the barycentric coordinates of the intersection points within the triangles. The shape is {num_intersections, 2}. - - + + An example of using ray_splits:: ray_splits: [0, 2, 3, 6, 6, 8] # note that the length of this is num_rays+1 @@ -271,8 +277,8 @@ An example of using ray_splits:: for ray_id, (start, end) in enumerate(zip(ray_splits[:-1], ray_splits[1:])): for i,t in enumerate(t_hit[start:end]): print(f'ray {ray_id}, intersection {i} at {t}') - - + + )doc"); raycasting_scene.def("compute_closest_points", @@ -302,12 +308,12 @@ Computes the closest points on the surfaces of the scene. A tensor with the primitive IDs, which corresponds to the triangle index. The shape is {..}. - primitive_uvs - A tensor with the barycentric coordinates of the closest points within + primitive_uvs + A tensor with the barycentric coordinates of the closest points within the triangles. The shape is {.., 2}. - primitive_normals - A tensor with the normals of the closest triangle . The shape is + primitive_normals + A tensor with the normals of the closest triangle . The shape is {.., 3}. )doc"); @@ -353,7 +359,7 @@ the intersections of a rays starting at the query points. nsamples (int): The number of rays used for determining the inside. This must be an odd number. The default is 1. Use a higher value if you - notice sign flipping, which can occur when rays hit exactly an edge or + notice sign flipping, which can occur when rays hit exactly an edge or vertex in the scene. Returns: diff --git a/cpp/pybind/t/geometry/tensormap.cpp b/cpp/pybind/t/geometry/tensormap.cpp index 36fea31b472..6fd4f0e6a9c 100644 --- a/cpp/pybind/t/geometry/tensormap.cpp +++ b/cpp/pybind/t/geometry/tensormap.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -116,7 +116,11 @@ static py::class_ bind_tensor_map(py::handle scope, return cl; } -void pybind_tensormap(py::module &m) { +void pybind_tensormap_declarations(py::module &m) { + auto tm = bind_tensor_map( + m, "TensorMap", "Map of String to Tensor with a primary key."); +} +void pybind_tensormap_definitions(py::module &m) { // Bind to the generic dictionary interface such that it works the same as a // regular dictionary in Python, except that types are enforced. Supported // functions include `__bool__`, `__iter__`, `items`, `__getitem__`, @@ -124,9 +128,8 @@ void pybind_tensormap(py::module &m) { // The `__delitem__` function is removed from bind_map, in bind_tensor_map, // and defined in this function, to use TensorMap::Erase, in order to // protect users from deleting the `private_key`. - auto tm = bind_tensor_map( - m, "TensorMap", "Map of String to Tensor with a primary key."); - + auto tm = static_cast>>( + m.attr("TensorMap")); tm.def("__delitem__", [](TensorMap &m, const std::string &k) { return m.Erase(k); }); diff --git a/cpp/pybind/t/geometry/trianglemesh.cpp b/cpp/pybind/t/geometry/trianglemesh.cpp index 3958a4248f2..91be38335d3 100644 --- a/cpp/pybind/t/geometry/trianglemesh.cpp +++ b/cpp/pybind/t/geometry/trianglemesh.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -12,6 +12,7 @@ #include "open3d/core/CUDAUtils.h" #include "open3d/t/geometry/LineSet.h" +#include "open3d/t/geometry/PointCloud.h" #include "pybind/docstring.h" #include "pybind/t/geometry/geometry.h" @@ -19,7 +20,7 @@ namespace open3d { namespace t { namespace geometry { -void pybind_trianglemesh(py::module& m) { +void pybind_trianglemesh_declarations(py::module& m) { py::class_, std::shared_ptr, Geometry, DrawableGeometry> triangle_mesh(m, "TriangleMesh", @@ -77,7 +78,13 @@ The attributes of the triangle mesh have different levels:: pcd.vertex.labels = o3d.core.Tensor(...) pcd.triangle.features = o3d.core.Tensor(...) )"); +} +void pybind_trianglemesh_definitions(py::module& m) { + auto triangle_mesh = + static_cast, + std::shared_ptr, Geometry, + DrawableGeometry>>(m.attr("TriangleMesh")); // Constructors. triangle_mesh .def(py::init(), @@ -254,12 +261,14 @@ shared storage on the CPU (GPU resident images for textures is not yet supported Dictionary of names to triangle meshes. Example: - flight_helmet = o3d.data.FlightHelmetModel() - model = o3d.io.read_triangle_model(flight_helmet.path) - mesh_dict = o3d.t.geometry.TriangleMesh.from_triangle_mesh_model(model) - o3d.visualization.draw(list({"name": name, "geometry": tmesh} for - (name, tmesh) in mesh_dict.items())) - )"); + Converting the FlightHelmetModel to a dictionary of triangle meshes:: + + flight_helmet = o3d.data.FlightHelmetModel() + model = o3d.io.read_triangle_model(flight_helmet.path) + mesh_dict = o3d.t.geometry.TriangleMesh.from_triangle_mesh_model(model) + o3d.visualization.draw(list({"name": name, "geometry": tmesh} for + (name, tmesh) in mesh_dict.items())) +)"); // conversion triangle_mesh.def("to_legacy", &TriangleMesh::ToLegacy, "Convert to a legacy Open3D TriangleMesh."); @@ -315,7 +324,7 @@ values with respect to a plane. generated. The value describes the signed distance to the plane. Returns: - LineSet with he extracted contours. + LineSet with the extracted contours. This example shows how to create a hemisphere from a sphere:: @@ -541,6 +550,67 @@ This example shows how to create a hemisphere from a sphere:: mesh = o3d.t.geometry.TriangleMesh.create_text('Open3D', depth=1) o3d.visualization.draw([{'name': 'text', 'geometry': mesh}]) +)"); + + triangle_mesh.def_static( + "create_isosurfaces", + // Accept anything for contour_values that pybind can convert to + // std::list. This also avoids o3d.utility.DoubleVector. + [](const core::Tensor& volume, std::list contour_values, + const core::Device& device) { + std::vector cv(contour_values.begin(), + contour_values.end()); + return TriangleMesh::CreateIsosurfaces(volume, cv, device); + }, + "volume"_a, "contour_values"_a = std::list{0.0}, + "device"_a = core::Device("CPU:0"), + R"(Create a mesh from a 3D scalar field (volume) by computing the +isosurface. + +This method uses the Flying Edges dual contouring method that computes the +isosurface similar to Marching Cubes. The center of the first voxel of the +volume is at the origin (0,0,0). The center of the voxel at index [z,y,x] +will be at (x,y,z). + +Args: + volume (open3d.core.Tensor): 3D tensor with the volume. + contour_values (list): A list of contour values at which isosurfaces will + be generated. The default value is 0. + device (o3d.core.Device): The device for the returned mesh. + +Returns: + A TriangleMesh with the extracted isosurfaces. + + +This example shows how to create a sphere from a volume:: + + import open3d as o3d + import numpy as np + + grid_coords = np.stack(np.meshgrid(*3*[np.linspace(-1,1,num=64)], indexing='ij'), axis=-1) + vol = 0.5 - np.linalg.norm(grid_coords, axis=-1) + mesh = o3d.t.geometry.TriangleMesh.create_isosurfaces(vol) + o3d.visualization.draw(mesh) + + +This example shows how to convert a mesh to a signed distance field (SDF) and back to a mesh:: + + import open3d as o3d + import numpy as np + + mesh1 = o3d.t.geometry.TriangleMesh.create_torus() + grid_coords = np.stack(np.meshgrid(*3*[np.linspace(-2,2,num=64, dtype=np.float32)], indexing='ij'), axis=-1) + + scene = o3d.t.geometry.RaycastingScene() + scene.add_triangles(mesh1) + sdf = scene.compute_signed_distance(grid_coords) + mesh2 = o3d.t.geometry.TriangleMesh.create_isosurfaces(sdf) + + # Flip the triangle orientation for SDFs with negative values as "inside" and positive values as "outside" + mesh2.triangle.indices = mesh2.triangle.indices[:,[2,1,0]] + + o3d.visualization.draw(mesh2) + )"); triangle_mesh.def( @@ -706,8 +776,7 @@ This function always uses the CPU device. Input meshes must be manifold for this method to work. The algorithm is based on: -Zhou et al, "Iso-charts: Stretch-driven Mesh Parameterization using Spectral - Analysis", Eurographics Symposium on Geometry Processing (2004) +Zhou et al, "Iso-charts: Stretch-driven Mesh Parameterization using Spectral Analysis", Eurographics Symposium on Geometry Processing (2004) Sander et al. "Signal-Specialized Parametrization" Europgraphics 2002 This function always uses the CPU device. @@ -1002,7 +1071,7 @@ or has a negative value, it is ignored. Example: - This code computes the overall surface area of a box: + This code computes the overall surface area of a box:: import open3d as o3d box = o3d.t.geometry.TriangleMesh.create_box() @@ -1024,6 +1093,83 @@ adjacent triangles to the edge is `<= 2`. &TriangleMesh::GetNonManifoldEdges, "allow_boundary_edges"_a = true, R"(Returns the list consisting of non-manifold edges.)"); + + triangle_mesh.def( + "sample_points_uniformly", &TriangleMesh::SamplePointsUniformly, + "number_of_points"_a, "use_triangle_normal"_a = false, + R"(Sample points uniformly from the triangle mesh surface and return as a PointCloud. Normals and colors are interpolated from the triangle mesh. If texture_uvs and albedo are present, these are used to estimate the sampled point color, otherwise vertex colors are used, if present. During sampling, triangle areas are computed and saved in the "areas" attribute. + +Args: + number_of_points (int): The number of points to sample. + use_triangle_normal (bool): If true, use the triangle normal as the normal of the sampled point. By default, the vertex normals are interpolated instead. + +Returns: + Sampled point cloud, with colors and normals, if available. + +Example:: + + mesh = o3d.t.geometry.TriangleMesh.create_box() + mesh.vertex.colors = mesh.vertex.positions.clone() + pcd = mesh.sample_points_uniformly(100000) + o3d.visualization.draw([mesh, pcd], point_size=5, show_ui=True, show_skybox=False) + + )"); + + triangle_mesh.def("compute_metrics", &TriangleMesh::ComputeMetrics, + "mesh2"_a, "metrics"_a, "params"_a, + R"(Compute various metrics between two triangle meshes. + +This uses ray casting for distance computations between a sampled point cloud +and a triangle mesh. Currently, Chamfer distance, Hausdorff distance and +F-Score `[Knapitsch2017] <../tutorial/reference.html#Knapitsch2017>`_ are supported. +The Chamfer distance is the sum of the mean distance to the nearest neighbor from +the sampled surface points of the first mesh to the second mesh and vice versa. +The F-Score at the fixed threshold radius is the harmonic mean of the Precision +and Recall. Recall is the percentage of surface points from the first mesh that +have the second mesh within the threshold radius, while Precision is the +percentage of sampled points from the second mesh that have the first mesh +surface within the threhold radius. + +.. math:: + :nowrap: + + \begin{align} + \text{Chamfer Distance: } d_{CD}(X,Y) &= \frac{1}{|X|}\sum_{i \in X} || x_i - n(x_i, Y) || + \frac{1}{|Y|}\sum_{i \in Y} || y_i - n(y_i, X) ||\\ + \text{Hausdorff distance: } d_H(X,Y) &= \max \left\{ \max_{i \in X} || x_i - n(x_i, Y) ||, \max_{i \in Y} || y_i - n(y_i, X) || \right\}\\ + \text{Precision: } P(X,Y|d) &= \frac{100}{|X|} \sum_{i \in X} || x_i - n(x_i, Y) || < d \\ + \text{Recall: } R(X,Y|d) &= \frac{100}{|Y|} \sum_{i \in Y} || y_i - n(y_i, X) || < d \\ + \text{F-Score: } F(X,Y|d) &= \frac{2 P(X,Y|d) R(X,Y|d)}{P(X,Y|d) + R(X,Y|d)} \\ + \end{align} + +As a side effect, the triangle areas are saved in the "areas" attribute. + +Args: + mesh2 (t.geometry.TriangleMesh): Other triangle mesh to compare with. + metrics (Sequence[t.geometry.Metric]): List of Metrics to compute. Multiple metrics can be computed at once for efficiency. + params (t.geometry.MetricParameters): This holds parameters required by different metrics. + +Returns: + Tensor containing the requested metrics. + +Example:: + + from open3d.t.geometry import TriangleMesh, Metric, MetricParameters + # box is a cube with one vertex at the origin and a side length 1 + box1 = TriangleMesh.create_box() + box2 = TriangleMesh.create_box() + box2.vertex.positions *= 1.1 + + # 3 faces of the cube are the same, and 3 are shifted up by 0.1 + metric_params = MetricParameters(fscore_radius=o3d.utility.FloatVector( + (0.05, 0.15)), n_sampled_points=100000) + metrics = box1.compute_metrics( + box2, (Metric.ChamferDistance, Metric.HausdorffDistance, Metric.FScore), + metric_params) + + print(metrics) + np.testing.assert_allclose(metrics.cpu().numpy(), (0.1, 0.17, 50, 100), + rtol=0.05) + )"); } } // namespace geometry diff --git a/cpp/pybind/t/geometry/voxel_block_grid.cpp b/cpp/pybind/t/geometry/voxel_block_grid.cpp index ff47ffa0e85..e5a4d4fea2a 100644 --- a/cpp/pybind/t/geometry/voxel_block_grid.cpp +++ b/cpp/pybind/t/geometry/voxel_block_grid.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -17,14 +17,17 @@ namespace open3d { namespace t { namespace geometry { -void pybind_voxel_block_grid(py::module& m) { +void pybind_voxel_block_grid_declarations(py::module& m) { py::class_ vbg( m, "VoxelBlockGrid", "A voxel block grid is a sparse grid of voxel blocks. Each voxel " "block is a dense 3D array, preserving local data distribution. If " "the block_resolution is set to 1, then the VoxelBlockGrid " "degenerates to a sparse voxel grid."); - +} +void pybind_voxel_block_grid_definitions(py::module& m) { + auto vbg = + static_cast>(m.attr("VoxelBlockGrid")); vbg.def(py::init&, const std::vector&, const std::vector&, float, int64_t, diff --git a/cpp/pybind/t/io/class_io.cpp b/cpp/pybind/t/io/class_io.cpp index 9ec88f08475..9a12b3a93c4 100644 --- a/cpp/pybind/t/io/class_io.cpp +++ b/cpp/pybind/t/io/class_io.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -67,7 +67,35 @@ static const std::unordered_map "If set to true a progress bar is visualized in the console."}, }; -void pybind_class_io(py::module &m_io) { +void pybind_class_io_declarations(py::module &m_io) { + py::class_ depth_noise_simulator( + m_io, "DepthNoiseSimulator", + R"(Simulate depth image noise from a given noise distortion model. The distortion model is based on *Teichman et. al. "Unsupervised intrinsic calibration of depth sensors via SLAM" RSS 2009*. Also see __ + +Example:: + + import open3d as o3d + + # Redwood Indoor LivingRoom1 (Augmented ICL-NUIM) + # http://redwood-data.org/indoor/ + data = o3d.data.RedwoodIndoorLivingRoom1() + noise_model_path = data.noise_model_path + im_src_path = data.depth_paths[0] + depth_scale = 1000.0 + + # Read clean depth image (uint16) + im_src = o3d.t.io.read_image(im_src_path) + + # Run noise model simulation + simulator = o3d.t.io.DepthNoiseSimulator(noise_model_path) + im_dst = simulator.simulate(im_src, depth_scale=depth_scale) + + # Save noisy depth image (uint16) + o3d.t.io.write_image("noisy_depth.png", im_dst) + )"); +} + +void pybind_class_io_definitions(py::module &m_io) { // open3d::t::geometry::Image m_io.def( "read_image", @@ -153,25 +181,25 @@ The following example reads a triangle mesh with the .ply extension:: Args: filename (str): Path to the mesh file. - enable_post_processing (bool): If True enables post-processing. - Post-processing will + enable_post_processing (bool): If True enables post-processing. + Post-processing will - triangulate meshes with polygonal faces - remove redundant materials - pretransform vertices - generate face normals if needed - + For more information see ASSIMPs documentation on the flags - `aiProcessPreset_TargetRealtime_Fast, aiProcess_RemoveRedundantMaterials, + `aiProcessPreset_TargetRealtime_Fast, aiProcess_RemoveRedundantMaterials, aiProcess_OptimizeMeshes, aiProcess_PreTransformVertices`. - + Note that identical vertices will always be joined regardless of whether - post-processing is enabled or not, which changes the number of vertices + post-processing is enabled or not, which changes the number of vertices in the mesh. The `ply`-format is not affected by the post-processing. print_progress (bool): If True print the reading progress to the terminal. - + Returns: Returns the mesh object. On failure an empty mesh is returned. )doc"); @@ -196,31 +224,8 @@ The following example reads a triangle mesh with the .ply extension:: map_shared_argument_docstrings); // DepthNoiseSimulator - py::class_ depth_noise_simulator( - m_io, "DepthNoiseSimulator", - R"(Simulate depth image noise from a given noise distortion model. The distortion model is based on *Teichman et. al. "Unsupervised intrinsic calibration of depth sensors via SLAM" RSS 2009*. Also see __ - -Example:: - - import open3d as o3d - - # Redwood Indoor LivingRoom1 (Augmented ICL-NUIM) - # http://redwood-data.org/indoor/ - data = o3d.data.RedwoodIndoorLivingRoom1() - noise_model_path = data.noise_model_path - im_src_path = data.depth_paths[0] - depth_scale = 1000.0 - - # Read clean depth image (uint16) - im_src = o3d.t.io.read_image(im_src_path) - - # Run noise model simulation - simulator = o3d.t.io.DepthNoiseSimulator(noise_model_path) - im_dst = simulator.simulate(im_src, depth_scale=depth_scale) - - # Save noisy depth image (uint16) - o3d.t.io.write_image("noisy_depth.png", im_dst) - )"); + auto depth_noise_simulator = static_cast>( + m_io.attr("DepthNoiseSimulator")); depth_noise_simulator.def(py::init([](const fs::path &fielname) { return DepthNoiseSimulator(fielname.string()); }), diff --git a/cpp/pybind/t/io/io.cpp b/cpp/pybind/t/io/io.cpp index 5cbdb441879..cc0a10cab70 100644 --- a/cpp/pybind/t/io/io.cpp +++ b/cpp/pybind/t/io/io.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -13,11 +13,16 @@ namespace open3d { namespace t { namespace io { -void pybind_io(py::module& m) { +void pybind_io_declarations(py::module& m) { py::module m_io = m.def_submodule("io", "Tensor-based input-output handling module."); - pybind_class_io(m_io); - pybind_sensor(m_io); + pybind_class_io_declarations(m_io); + pybind_sensor_declarations(m_io); +} +void pybind_io_definitions(py::module& m) { + auto m_io = static_cast(m.attr("io")); + pybind_class_io_definitions(m_io); + pybind_sensor_definitions(m_io); } } // namespace io diff --git a/cpp/pybind/t/io/io.h b/cpp/pybind/t/io/io.h index dc3aef9327a..73e334f6f3a 100644 --- a/cpp/pybind/t/io/io.h +++ b/cpp/pybind/t/io/io.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -13,9 +13,13 @@ namespace open3d { namespace t { namespace io { -void pybind_io(py::module& m); -void pybind_class_io(py::module& m); -void pybind_sensor(py::module& m); +void pybind_io_declarations(py::module& m); +void pybind_class_io_declarations(py::module& m); +void pybind_sensor_declarations(py::module& m); + +void pybind_io_definitions(py::module& m); +void pybind_class_io_definitions(py::module& m); +void pybind_sensor_definitions(py::module& m); } // namespace io } // namespace t diff --git a/cpp/pybind/t/io/sensor.cpp b/cpp/pybind/t/io/sensor.cpp index 241d763d3cc..d33f171446e 100644 --- a/cpp/pybind/t/io/sensor.cpp +++ b/cpp/pybind/t/io/sensor.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -22,7 +22,98 @@ namespace open3d { namespace t { namespace io { -void pybind_sensor(py::module &m) { +// RGBD video reader trampoline +class PyRGBDVideoReader : public RGBDVideoReader { +public: + using RGBDVideoReader::RGBDVideoReader; + bool IsOpened() const override { + PYBIND11_OVERLOAD_PURE(bool, RGBDVideoReader, ); + } + + bool IsEOF() const override { + PYBIND11_OVERLOAD_PURE(bool, RGBDVideoReader, ); + } + + bool Open(const std::string &filename) override { + PYBIND11_OVERLOAD_PURE(bool, RGBDVideoReader, Open, filename); + } + + void Close() override { PYBIND11_OVERLOAD_PURE(void, RGBDVideoReader, ); } + + RGBDVideoMetadata &GetMetadata() override { + PYBIND11_OVERLOAD_PURE(RGBDVideoMetadata &, RGBDVideoReader, ); + } + + const RGBDVideoMetadata &GetMetadata() const override { + PYBIND11_OVERLOAD_PURE(const RGBDVideoMetadata &, RGBDVideoReader, ); + } + + bool SeekTimestamp(uint64_t timestamp) override { + PYBIND11_OVERLOAD_PURE(bool, RGBDVideoReader, SeekTimestamp, timestamp); + } + + uint64_t GetTimestamp() const override { + PYBIND11_OVERLOAD_PURE(uint64_t, RGBDVideoReader, ); + } + + t::geometry::RGBDImage NextFrame() override { + PYBIND11_OVERLOAD_PURE(t::geometry::RGBDImage, RGBDVideoReader, ); + } + + std::string GetFilename() const override { + PYBIND11_OVERLOAD_PURE(std::string, RGBDVideoReader, ); + } +}; + +void pybind_sensor_declarations(py::module &m) { + py::enum_(m, "SensorType", "Sensor type") + .value("AZURE_KINECT", SensorType::AZURE_KINECT) + .value("REAL_SENSE", SensorType::REAL_SENSE); + py::class_ rgbd_video_metadata(m, "RGBDVideoMetadata", + "RGBD Video metadata."); + py::class_> + rgbd_video_reader(m, "RGBDVideoReader", "RGBD Video file reader."); + py::class_ rgbd_sensor( + m, "RGBDSensor", "Interface class for control of RGBD cameras."); +#ifdef BUILD_LIBREALSENSE + py::class_, RGBDVideoReader> + rs_bag_reader( + m, "RSBagReader", + "RealSense Bag file reader.\n" + "\tOnly the first color and depth streams from the bag " + "file will be read.\n" + " - The streams must have the same frame rate.\n" + " - The color stream must have RGB 8 bit (RGB8/BGR8) pixel " + "format\n" + " - The depth stream must have 16 bit unsigned int (Z16) " + "pixel format\n" + "The output is synchronized color and depth frame pairs " + "with the depth frame aligned to the color frame. " + "Unsynchronized frames will be dropped. With alignment, " + "the depth and color frames have the same viewpoint and " + "resolution. See format documentation `here " + "`__" + "\n\n" + ".. warning:: A few frames may be dropped if user code " + "takes a long time (>10 frame intervals) to process a " + "frame."); + py::class_ realsense_sensor_config( + m, "RealSenseSensorConfig", "Configuration for a RealSense camera"); + py::class_ realsense_valid_configs( + m, "RealSenseValidConfigs", + "Store set of valid configuration options for a connected " + "RealSense device. From this structure, a user can construct a " + "RealSenseSensorConfig object meeting their specifications."); + py::class_ realsense_sensor( + m, "RealSenseSensor", + "RealSense camera discovery, configuration, streaming and " + "recording"); +#endif +} + +void pybind_sensor_definitions(py::module &m) { static const std::unordered_map map_shared_argument_docstrings = { {"timestamp", "Timestamp in the video (usec)."}, @@ -39,13 +130,9 @@ void pybind_sensor(py::module &m) { "Size of internal frame buffer, increase this if you " "experience frame drops."}}; - py::enum_(m, "SensorType", "Sensor type") - .value("AZURE_KINECT", SensorType::AZURE_KINECT) - .value("REAL_SENSE", SensorType::REAL_SENSE); - // Class RGBD video metadata - py::class_ rgbd_video_metadata(m, "RGBDVideoMetadata", - "RGBD Video metadata."); + auto rgbd_video_metadata = static_cast>( + m.attr("RGBDVideoMetadata")); rgbd_video_metadata.def(py::init<>()) .def_readwrite("intrinsics", &RGBDVideoMetadata::intrinsics_, "Shared intrinsics between RGB & depth") @@ -78,57 +165,11 @@ void pybind_sensor(py::module &m) { "Number of color channels.") .def("__repr__", &RGBDVideoMetadata::ToString); - // RGBD video reader trampoline - class PyRGBDVideoReader : public RGBDVideoReader { - public: - using RGBDVideoReader::RGBDVideoReader; - bool IsOpened() const override { - PYBIND11_OVERLOAD_PURE(bool, RGBDVideoReader, ); - } - - bool IsEOF() const override { - PYBIND11_OVERLOAD_PURE(bool, RGBDVideoReader, ); - } - - bool Open(const std::string &filename) override { - PYBIND11_OVERLOAD_PURE(bool, RGBDVideoReader, Open, filename); - } - - void Close() override { - PYBIND11_OVERLOAD_PURE(void, RGBDVideoReader, ); - } - - RGBDVideoMetadata &GetMetadata() override { - PYBIND11_OVERLOAD_PURE(RGBDVideoMetadata &, RGBDVideoReader, ); - } - - const RGBDVideoMetadata &GetMetadata() const override { - PYBIND11_OVERLOAD_PURE(const RGBDVideoMetadata &, - RGBDVideoReader, ); - } - - bool SeekTimestamp(uint64_t timestamp) override { - PYBIND11_OVERLOAD_PURE(bool, RGBDVideoReader, SeekTimestamp, - timestamp); - } - - uint64_t GetTimestamp() const override { - PYBIND11_OVERLOAD_PURE(uint64_t, RGBDVideoReader, ); - } - - t::geometry::RGBDImage NextFrame() override { - PYBIND11_OVERLOAD_PURE(t::geometry::RGBDImage, RGBDVideoReader, ); - } - - std::string GetFilename() const override { - PYBIND11_OVERLOAD_PURE(std::string, RGBDVideoReader, ); - } - }; - // Class RGBD video reader - py::class_> - rgbd_video_reader(m, "RGBDVideoReader", "RGBD Video file reader."); + auto rgbd_video_reader = + static_cast>>( + m.attr("RGBDVideoReader")); rgbd_video_reader.def(py::init<>()) .def_static( "create", @@ -147,34 +188,15 @@ void pybind_sensor(py::module &m) { map_shared_argument_docstrings); // Class RGBD sensor - py::class_ rgbd_sensor( - m, "RGBDSensor", "Interface class for control of RGBD cameras."); + auto rgbd_sensor = + static_cast>(m.attr("RGBDSensor")); rgbd_sensor.def("__repr__", &RGBDSensor::ToString); #ifdef BUILD_LIBREALSENSE // Class RS bag reader - py::class_, RGBDVideoReader> - rs_bag_reader( - m, "RSBagReader", - "RealSense Bag file reader.\n" - "\tOnly the first color and depth streams from the bag " - "file will be read.\n" - " - The streams must have the same frame rate.\n" - " - The color stream must have RGB 8 bit (RGB8/BGR8) pixel " - "format\n" - " - The depth stream must have 16 bit unsigned int (Z16) " - "pixel format\n" - "The output is synchronized color and depth frame pairs " - "with the depth frame aligned to the color frame. " - "Unsynchronized frames will be dropped. With alignment, " - "the depth and color frames have the same viewpoint and " - "resolution. See format documentation `here " - "`__" - "\n\n" - ".. warning:: A few frames may be dropped if user code " - "takes a long time (>10 frame intervals) to process a " - "frame."); + auto rs_bag_reader = + static_cast, + RGBDVideoReader>>(m.attr("RSBagReader")); rs_bag_reader.def(py::init<>()) .def(py::init(), "buffer_size"_a = RSBagReader::DEFAULT_BUFFER_SIZE) @@ -218,19 +240,16 @@ void pybind_sensor(py::module &m) { map_shared_argument_docstrings); // Class RealSenseSensorConfig - py::class_ realsense_sensor_config( - m, "RealSenseSensorConfig", "Configuration for a RealSense camera"); - + auto realsense_sensor_config = + static_cast>( + m.attr("RealSenseSensorConfig")); realsense_sensor_config.def(py::init<>(), "Default config will be used") .def(py::init &>(), "config"_a, "Initialize config with a map"); - - py::class_ realsense_valid_configs( - m, "RealSenseValidConfigs", - "Store set of valid configuration options for a connected " - "RealSense device. From this structure, a user can construct a " - "RealSenseSensorConfig object meeting their specifications."); + auto realsense_valid_configs = + static_cast>( + m.attr("RealSenseValidConfigs")); realsense_valid_configs .def_readwrite("serial", &RealSenseValidConfigs::serial, "Device serial number.") @@ -241,10 +260,9 @@ void pybind_sensor(py::module &m) { "list of valid values."); // Class RealSenseSensor - py::class_ realsense_sensor( - m, "RealSenseSensor", - "RealSense camera discovery, configuration, streaming and " - "recording"); + auto realsense_sensor = + static_cast>( + m.attr("RealSenseSensor")); realsense_sensor.def(py::init<>(), "Initialize with default settings.") .def_static("list_devices", &RealSenseSensor::ListDevices, py::call_guard(), diff --git a/cpp/pybind/t/pipelines/odometry/odometry.cpp b/cpp/pybind/t/pipelines/odometry/odometry.cpp index a6744e6a0b9..35886b5e554 100644 --- a/cpp/pybind/t/pipelines/odometry/odometry.cpp +++ b/cpp/pybind/t/pipelines/odometry/odometry.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -15,20 +15,95 @@ namespace t { namespace pipelines { namespace odometry { -void pybind_odometry_classes(py::module &m) { - py::enum_(m, "Method", "Tensor odometry estimation method.") +// Odometry functions have similar arguments, sharing arg docstrings. +static const std::unordered_map + map_shared_argument_docstrings = { + {"criteria", "Odometry convergence criteria."}, + {"criteria_list", "List of Odometry convergence criteria."}, + {"depth_outlier_trunc", + "Depth difference threshold used to filter projective " + "associations."}, + {"depth_huber_delta", + "Huber norm parameter used in depth loss."}, + {"depth_scale", + "Converts depth pixel values to meters by dividing the scale " + "factor."}, + {"init_source_to_target", + "(4, 4) initial transformation matrix from source to target."}, + {"intrinsics", "(3, 3) intrinsic matrix for projection."}, + {"intensity_huber_delta", + "Huber norm parameter used in intensity loss."}, + {"method", + "Estimation method used to apply RGBD odometry. " + "One of (``PointToPlane``, ``Intensity``, ``Hybrid``)"}, + {"params", "Odometry loss parameters."}, + {"source", "The source RGBD image."}, + {"source_depth", + "(row, col, channel = 1) Float32 source depth image obtained " + "by PreprocessDepth before calling this function."}, + {"source_intensity", + "(row, col, channel = 1) Float32 source intensity image " + "obtained by RGBToGray before calling this function"}, + {"source_vertex_map", + "(row, col, channel = 3) Float32 source vertex image obtained " + "by CreateVertexMap before calling this function."}, + {"target", "The target RGBD image."}, + {"target_depth", + "(row, col, channel = 1) Float32 target depth image obtained " + "by PreprocessDepth before calling this function."}, + {"target_depth_dx", + "(row, col, channel = 1) Float32 target depth gradient image " + "along x-axis obtained by FilterSobel before calling this " + "function."}, + {"target_depth_dy", + "(row, col, channel = 1) Float32 target depth gradient image " + "along y-axis obtained by FilterSobel before calling this " + "function."}, + {"target_intensity", + "(row, col, channel = 1) Float32 target intensity image " + "obtained by RGBToGray before calling this function"}, + {"target_intensity_dx", + "(row, col, channel = 1) Float32 target intensity gradient " + "image along x-axis obtained by FilterSobel before calling " + "this function."}, + {"target_intensity_dy", + "(row, col, channel = 1) Float32 target intensity gradient " + "image along y-axis obtained by FilterSobel before calling " + "this function."}, + {"target_normal_map", + "(row, col, channel = 3) Float32 target normal image obtained " + "by CreateNormalMap before calling this function."}, + {"target_vertex_map", + "(row, col, channel = 3) Float32 target vertex image obtained " + "by CreateVertexMap before calling this function."}}; + +void pybind_odometry_declarations(py::module &m) { + py::module m_odometry = + m.def_submodule("odometry", "Tensor odometry pipeline."); + py::enum_(m_odometry, "Method", + "Tensor odometry estimation method.") .value("PointToPlane", Method::PointToPlane) .value("Intensity", Method::Intensity) .value("Hybrid", Method::Hybrid) .export_values(); - - // open3d.t.pipelines.odometry.OdometryConvergenceCriteria py::class_ odometry_convergence_criteria( - m, "OdometryConvergenceCriteria", + m_odometry, "OdometryConvergenceCriteria", "Convergence criteria of odometry. " "Odometry algorithm stops if the relative change of fitness and " "rmse hit ``relative_fitness`` and ``relative_rmse`` individually, " "or the iteration number exceeds ``max_iteration``."); + py::class_ odometry_result(m_odometry, "OdometryResult", + "Odometry results."); + py::class_ odometry_loss_params( + m_odometry, "OdometryLossParams", "Odometry loss parameters."); +} + +void pybind_odometry_definitions(py::module &m) { + auto m_odometry = static_cast(m.attr("odometry")); + // open3d.t.pipelines.odometry.OdometryConvergenceCriteria + auto odometry_convergence_criteria = + static_cast>( + m_odometry.attr("OdometryConvergenceCriteria")); py::detail::bind_copy_functions( odometry_convergence_criteria); odometry_convergence_criteria @@ -49,20 +124,25 @@ void pybind_odometry_classes(py::module &m) { "than ``relative_fitness``, the iteration stops.") .def("__repr__", [](const OdometryConvergenceCriteria &c) { return fmt::format( - "OdometryConvergenceCriteria[max_iteration={:d}, " - "relative_rmse={:e}, relative_fitness={:e}].", + "OdometryConvergenceCriteria(" + "max_iteration={:d}, " + "relative_rmse={:e}, " + "relative_fitness={:e})", c.max_iteration_, c.relative_rmse_, c.relative_fitness_); }); // open3d.t.pipelines.odometry.OdometryResult - py::class_ odometry_result(m, "OdometryResult", - "Odometry results."); + auto odometry_result = static_cast>( + m_odometry.attr("OdometryResult")); py::detail::bind_copy_functions(odometry_result); odometry_result .def(py::init(), - "transformation"_a = core::Tensor::Eye(4, core::Float64, - core::Device("CPU:0")), + py::arg_v("transformation", + core::Tensor::Eye(4, core::Float64, + core::Device("CPU:0")), + "open3d.core.Tensor.eye(4, " + "dtype=open3d.core.Dtype.Float64)"), "inlier_rmse"_a = 0.0, "fitness"_a = 0.0) .def_readwrite("transformation", &OdometryResult::transformation_, "``4 x 4`` float64 tensor on CPU: The estimated " @@ -82,8 +162,8 @@ void pybind_odometry_classes(py::module &m) { }); // open3d.t.pipelines.odometry.OdometryLossParams - py::class_ odometry_loss_params( - m, "OdometryLossParams", "Odometry loss parameters."); + auto odometry_loss_params = static_cast>( + m_odometry.attr("OdometryLossParams")); py::detail::bind_copy_functions(odometry_loss_params); odometry_loss_params .def(py::init(), @@ -107,88 +187,25 @@ void pybind_odometry_classes(py::module &m) { olp.depth_outlier_trunc_, olp.depth_huber_delta_, olp.intensity_huber_delta_); }); -} - -// Odometry functions have similar arguments, sharing arg docstrings. -static const std::unordered_map - map_shared_argument_docstrings = { - {"criteria", "Odometry convergence criteria."}, - {"criteria_list", "List of Odometry convergence criteria."}, - {"depth_outlier_trunc", - "Depth difference threshold used to filter projective " - "associations."}, - {"depth_huber_delta", - "Huber norm parameter used in depth loss."}, - {"depth_scale", - "Converts depth pixel values to meters by dividing the scale " - "factor."}, - {"init_source_to_target", - "(4, 4) initial transformation matrix from source to target."}, - {"intrinsics", "(3, 3) intrinsic matrix for projection."}, - {"intensity_huber_delta", - "Huber norm parameter used in intensity loss."}, - {"method", - "Estimation method used to apply RGBD odometry. " - "One of (``PointToPlane``, ``Intensity``, ``Hybrid``)"}, - {"params", "Odometry loss parameters."}, - {"source", "The source RGBD image."}, - {"source_depth", - "(row, col, channel = 1) Float32 source depth image obtained " - "by PreprocessDepth before calling this function."}, - {"source_intensity", - "(row, col, channel = 1) Float32 source intensity image " - "obtained by RGBToGray before calling this function"}, - {"source_vertex_map", - "(row, col, channel = 3) Float32 source vertex image obtained " - "by CreateVertexMap before calling this function."}, - {"target", "The target RGBD image."}, - {"target_depth", - "(row, col, channel = 1) Float32 target depth image obtained " - "by PreprocessDepth before calling this function."}, - {"target_depth_dx", - "(row, col, channel = 1) Float32 target depth gradient image " - "along x-axis obtained by FilterSobel before calling this " - "function."}, - {"target_depth_dy", - "(row, col, channel = 1) Float32 target depth gradient image " - "along y-axis obtained by FilterSobel before calling this " - "function."}, - {"target_intensity", - "(row, col, channel = 1) Float32 target intensity image " - "obtained by RGBToGray before calling this function"}, - {"target_intensity_dx", - "(row, col, channel = 1) Float32 target intensity gradient " - "image along x-axis obtained by FilterSobel before calling " - "this function."}, - {"target_intensity_dy", - "(row, col, channel = 1) Float32 target intensity gradient " - "image along y-axis obtained by FilterSobel before calling " - "this function."}, - {"target_normal_map", - "(row, col, channel = 3) Float32 target normal image obtained " - "by CreateNormalMap before calling this function."}, - {"target_vertex_map", - "(row, col, channel = 3) Float32 target vertex image obtained " - "by CreateVertexMap before calling this function."}}; - -void pybind_odometry_methods(py::module &m) { - m.def("rgbd_odometry_multi_scale", &RGBDOdometryMultiScale, - py::call_guard(), - "Function for Multi Scale RGBD odometry.", "source"_a, "target"_a, - "intrinsics"_a, - "init_source_to_target"_a = - core::Tensor::Eye(4, core::Float64, core::Device("CPU:0")), - "depth_scale"_a = 1000.0f, "depth_max"_a = 3.0f, - "criteria_list"_a = - std::vector({10, 5, 3}), - "method"_a = Method::Hybrid, "params"_a = OdometryLossParams()); - docstring::FunctionDocInject(m, "rgbd_odometry_multi_scale", + m_odometry.def( + "rgbd_odometry_multi_scale", &RGBDOdometryMultiScale, + py::call_guard(), + "Function for Multi Scale RGBD odometry.", "source"_a, "target"_a, + "intrinsics"_a, + "init_source_to_target"_a = + core::Tensor::Eye(4, core::Float64, core::Device("CPU:0")), + "depth_scale"_a = 1000.0f, "depth_max"_a = 3.0f, + "criteria_list"_a = + std::vector({10, 5, 3}), + "method"_a = Method::Hybrid, "params"_a = OdometryLossParams()); + docstring::FunctionDocInject(m_odometry, "rgbd_odometry_multi_scale", map_shared_argument_docstrings); - m.def("compute_odometry_result_point_to_plane", - &ComputeOdometryResultPointToPlane, - py::call_guard(), - R"(Estimates the OdometryResult (4x4 rigid transformation T from + m_odometry.def( + "compute_odometry_result_point_to_plane", + &ComputeOdometryResultPointToPlane, + py::call_guard(), + R"(Estimates the OdometryResult (4x4 rigid transformation T from source to target, with inlier rmse and fitness). Performs one iteration of RGBD odometry using Loss function: :math:`[(V_p - V_q)^T N_p]^2` @@ -199,15 +216,18 @@ where, q is obtained by transforming p with init_source_to_target then projecting with intrinsics. Reference: KinectFusion, ISMAR 2011.)", - "source_vertex_map"_a, "target_vertex_map"_a, "target_normal_map"_a, - "intrinsics"_a, "init_source_to_target"_a, "depth_outlier_trunc"_a, - "depth_huber_delta"_a); - docstring::FunctionDocInject(m, "compute_odometry_result_point_to_plane", + "source_vertex_map"_a, "target_vertex_map"_a, "target_normal_map"_a, + "intrinsics"_a, "init_source_to_target"_a, "depth_outlier_trunc"_a, + "depth_huber_delta"_a); + docstring::FunctionDocInject(m_odometry, + "compute_odometry_result_point_to_plane", map_shared_argument_docstrings); - m.def("compute_odometry_result_intensity", &ComputeOdometryResultIntensity, - py::call_guard(), - R"(Estimates the OdometryResult (4x4 rigid transformation T from + m_odometry.def( + "compute_odometry_result_intensity", + &ComputeOdometryResultIntensity, + py::call_guard(), + R"(Estimates the OdometryResult (4x4 rigid transformation T from source to target, with inlier rmse and fitness). Performs one iteration of RGBD odometry using Loss function: :math:`(I_p - I_q)^2` @@ -219,17 +239,19 @@ projecting with intrinsics. Reference: Real-time visual odometry from dense RGB-D images, ICCV Workshops, 2017.)", - "source_depth"_a, "target_depth"_a, "source_intensity"_a, - "target_intensity"_a, "target_intensity_dx"_a, - "target_intensity_dy"_a, "source_vertex_map"_a, "intrinsics"_a, - "init_source_to_target"_a, "depth_outlier_trunc"_a, - "intensity_huber_delta"_a); - docstring::FunctionDocInject(m, "compute_odometry_result_intensity", + "source_depth"_a, "target_depth"_a, "source_intensity"_a, + "target_intensity"_a, "target_intensity_dx"_a, + "target_intensity_dy"_a, "source_vertex_map"_a, "intrinsics"_a, + "init_source_to_target"_a, "depth_outlier_trunc"_a, + "intensity_huber_delta"_a); + docstring::FunctionDocInject(m_odometry, + "compute_odometry_result_intensity", map_shared_argument_docstrings); - m.def("compute_odometry_result_hybrid", &ComputeOdometryResultHybrid, - py::call_guard(), - R"(Estimates the OdometryResult (4x4 rigid transformation T from + m_odometry.def( + "compute_odometry_result_hybrid", &ComputeOdometryResultHybrid, + py::call_guard(), + R"(Estimates the OdometryResult (4x4 rigid transformation T from source to target, with inlier rmse and fitness). Performs one iteration of RGBD odometry using Loss function: :math:`(I_p - I_q)^2 + \lambda(D_p - (D_q)')^2` @@ -242,27 +264,21 @@ q is obtained by transforming p with init_source_to_target then projecting with intrinsics. Reference: J. Park, Q.Y. Zhou, and V. Koltun, Colored Point Cloud Registration Revisited, ICCV, 2017.)", - "source_depth"_a, "target_depth"_a, "source_intensity"_a, - "target_intensity"_a, "target_depth_dx"_a, "target_depth_dy"_a, - "target_intensity_dx"_a, "target_intensity_dy"_a, - "source_vertex_map"_a, "intrinsics"_a, "init_source_to_target"_a, - "depth_outlier_trunc"_a, "depth_huber_delta"_a, - "intensity_huber_delta"_a); - docstring::FunctionDocInject(m, "compute_odometry_result_hybrid", + "source_depth"_a, "target_depth"_a, "source_intensity"_a, + "target_intensity"_a, "target_depth_dx"_a, "target_depth_dy"_a, + "target_intensity_dx"_a, "target_intensity_dy"_a, + "source_vertex_map"_a, "intrinsics"_a, "init_source_to_target"_a, + "depth_outlier_trunc"_a, "depth_huber_delta"_a, + "intensity_huber_delta"_a); + docstring::FunctionDocInject(m_odometry, "compute_odometry_result_hybrid", map_shared_argument_docstrings); - m.def("compute_odometry_information_matrix", - &ComputeOdometryInformationMatrix, - py::call_guard(), "source_depth"_a, - "target_depth"_a, "intrinsic"_a, "source_to_target"_a, - "dist_threshold"_a, "depth_scale"_a = 1000.0, "depth_max"_a = 3.0); -} - -void pybind_odometry(py::module &m) { - py::module m_submodule = - m.def_submodule("odometry", "Tensor odometry pipeline."); - pybind_odometry_classes(m_submodule); - pybind_odometry_methods(m_submodule); + m_odometry.def("compute_odometry_information_matrix", + &ComputeOdometryInformationMatrix, + py::call_guard(), "source_depth"_a, + "target_depth"_a, "intrinsic"_a, "source_to_target"_a, + "dist_threshold"_a, "depth_scale"_a = 1000.0, + "depth_max"_a = 3.0); } } // namespace odometry diff --git a/cpp/pybind/t/pipelines/odometry/odometry.h b/cpp/pybind/t/pipelines/odometry/odometry.h index 2a603765675..ee82edc956d 100644 --- a/cpp/pybind/t/pipelines/odometry/odometry.h +++ b/cpp/pybind/t/pipelines/odometry/odometry.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -14,7 +14,8 @@ namespace t { namespace pipelines { namespace odometry { -void pybind_odometry(py::module &m); +void pybind_odometry_declarations(py::module &m); +void pybind_odometry_definitions(py::module &m); } // namespace odometry } // namespace pipelines diff --git a/cpp/pybind/t/pipelines/pipelines.cpp b/cpp/pybind/t/pipelines/pipelines.cpp index 6407923bf91..083a0c06f5b 100644 --- a/cpp/pybind/t/pipelines/pipelines.cpp +++ b/cpp/pybind/t/pipelines/pipelines.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -17,13 +17,20 @@ namespace open3d { namespace t { namespace pipelines { -void pybind_pipelines(py::module& m) { +void pybind_pipelines_declarations(py::module& m) { py::module m_pipelines = m.def_submodule( "pipelines", "Tensor-based geometry processing pipelines."); - odometry::pybind_odometry(m_pipelines); - registration::pybind_registration(m_pipelines); - slac::pybind_slac(m_pipelines); - slam::pybind_slam(m_pipelines); + odometry::pybind_odometry_declarations(m_pipelines); + registration::pybind_registration_declarations(m_pipelines); + slac::pybind_slac_declarations(m_pipelines); + slam::pybind_slam_declarations(m_pipelines); +} +void pybind_pipelines_definitions(py::module& m) { + auto m_pipelines = static_cast(m.attr("pipelines")); + odometry::pybind_odometry_definitions(m_pipelines); + registration::pybind_registration_definitions(m_pipelines); + slac::pybind_slac_definitions(m_pipelines); + slam::pybind_slam_definitions(m_pipelines); } } // namespace pipelines diff --git a/cpp/pybind/t/pipelines/pipelines.h b/cpp/pybind/t/pipelines/pipelines.h index 015a3959b56..f9a02a5e0bd 100644 --- a/cpp/pybind/t/pipelines/pipelines.h +++ b/cpp/pybind/t/pipelines/pipelines.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -13,8 +13,9 @@ namespace open3d { namespace t { namespace pipelines { -void pybind_pipelines(py::module& m); +void pybind_pipelines_declarations(py::module& m); +void pybind_pipelines_definitions(py::module& m); -} +} // namespace pipelines } // namespace t } // namespace open3d diff --git a/cpp/pybind/t/pipelines/registration/feature.cpp b/cpp/pybind/t/pipelines/registration/feature.cpp index 74de409115d..b7e9e1d5ca5 100644 --- a/cpp/pybind/t/pipelines/registration/feature.cpp +++ b/cpp/pybind/t/pipelines/registration/feature.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -17,16 +17,16 @@ namespace t { namespace pipelines { namespace registration { -void pybind_feature(py::module &m) { - m.def("compute_fpfh_feature", &ComputeFPFHFeature, - py::call_guard(), - R"(Function to compute FPFH feature for a point cloud. +void pybind_feature_definitions(py::module &m_registration) { + m_registration.def("compute_fpfh_feature", &ComputeFPFHFeature, + py::call_guard(), + R"(Function to compute FPFH feature for a point cloud. It uses KNN search (Not recommended to use on GPU) if only max_nn parameter is provided, Radius search (Not recommended to use on GPU) if only radius parameter is provided, and Hybrid search (Recommended) if both are provided.)", - "input"_a, "max_nn"_a = 100, "radius"_a = py::none()); + "input"_a, "max_nn"_a = 100, "radius"_a = py::none()); docstring::FunctionDocInject( - m, "compute_fpfh_feature", + m_registration, "compute_fpfh_feature", {{"input", "The input point cloud with data type float32 or float64."}, {"max_nn", @@ -36,13 +36,14 @@ parameter is provided, and Hybrid search (Recommended) if both are provided.)", "[optional] Neighbor search radius parameter. [Recommended ~5x " "voxel size]"}}); - m.def("correspondences_from_features", &CorrespondencesFromFeatures, - py::call_guard(), - R"(Function to query nearest neighbors of source_features in target_features.)", - "source_features"_a, "target_features"_a, "mutual_filter"_a = false, - "mutual_consistency_ratio"_a = 0.1f); + m_registration.def( + "correspondences_from_features", &CorrespondencesFromFeatures, + py::call_guard(), + R"(Function to query nearest neighbors of source_features in target_features.)", + "source_features"_a, "target_features"_a, "mutual_filter"_a = false, + "mutual_consistency_ratio"_a = 0.1f); docstring::FunctionDocInject( - m, "correspondences_from_features", + m_registration, "correspondences_from_features", {{"source_features", "The source features in shape (N, dim)."}, {"target_features", "The target features in shape (M, dim)."}, {"mutual_filter", diff --git a/cpp/pybind/t/pipelines/registration/registration.cpp b/cpp/pybind/t/pipelines/registration/registration.cpp index 6dbe3f1d27a..0d3e54eddaf 100644 --- a/cpp/pybind/t/pipelines/registration/registration.cpp +++ b/cpp/pybind/t/pipelines/registration/registration.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -46,14 +46,101 @@ class PyTransformationEstimation : public TransformationEstimationBase { } }; -void pybind_registration_classes(py::module &m) { - // open3d.t.pipelines.registration.ICPConvergenceCriteria +// Registration functions have similar arguments, sharing arg docstrings. +static const std::unordered_map + map_shared_argument_docstrings = { + {"correspondences", + "Tensor of type Int64 containing indices of corresponding " + "target points, where the value is the target index and the " + "index of the value itself is the source index. It contains " + "-1 as value at index with no correspondence."}, + {"criteria", "Convergence criteria"}, + {"criteria_list", + "List of Convergence criteria for each scale of multi-scale " + "icp."}, + {"estimation_method", + "Estimation method. One of " + "(``TransformationEstimationPointToPoint``, " + "``TransformationEstimationPointToPlane``, " + "``TransformationEstimationForColoredICP``, " + "``TransformationEstimationForGeneralizedICP``)"}, + {"init_source_to_target", "Initial transformation estimation"}, + {"max_correspondence_distance", + "Maximum correspondence points-pair distance."}, + {"max_correspondence_distances", + "o3d.utility.DoubleVector of maximum correspondence " + "points-pair distances for multi-scale icp."}, + {"option", "Registration option"}, + {"source", "The source point cloud."}, + {"target", "The target point cloud."}, + {"transformation", + "The 4x4 transformation matrix of type Float64 " + "to transform ``source`` to ``target``"}, + {"voxel_size", + "The input pointclouds will be down-sampled to this " + "`voxel_size` scale. If `voxel_size` < 0, original scale will " + "be used. However it is highly recommended to down-sample the " + "point-cloud for performance. By default original scale of " + "the point-cloud will be used."}, + {"voxel_sizes", + "o3d.utility.DoubleVector of voxel sizes in strictly " + "decreasing order, for multi-scale icp."}, + {"callback_after_iteration", + "Optional lambda function, saves string to tensor map of " + "attributes such as iteration_index, scale_index, " + "scale_iteration_index, inlier_rmse, fitness, transformation, " + "on CPU device, updated after each iteration."}}; + +void pybind_registration_declarations(py::module &m) { + py::module m_registration = m.def_submodule( + "registration", "Tensor-based registration pipeline."); py::class_ convergence_criteria( - m, "ICPConvergenceCriteria", + m_registration, "ICPConvergenceCriteria", "Convergence criteria of ICP. " "ICP algorithm stops if the relative change of fitness and rmse " "hit ``relative_fitness`` and ``relative_rmse`` individually, " "or the iteration number exceeds ``max_iteration``."); + py::class_ registration_result( + m_registration, "RegistrationResult", "Registration results."); + py::class_> + te(m_registration, "TransformationEstimation", + "Base class that estimates a transformation between two " + "point clouds. The virtual function ComputeTransformation() " + "must be implemented in subclasses."); + py::class_, + TransformationEstimation> + te_p2p(m_registration, "TransformationEstimationPointToPoint", + "Class to estimate a transformation for point to " + "point distance."); + py::class_, + TransformationEstimation> + te_p2l(m_registration, "TransformationEstimationPointToPlane", + "Class to estimate a transformation for point to " + "plane distance."); + py::class_< + TransformationEstimationForColoredICP, + PyTransformationEstimation, + TransformationEstimation> + te_col(m_registration, "TransformationEstimationForColoredICP", + "Class to estimate a transformation between two point " + "clouds using color information"); + py::class_< + TransformationEstimationForDopplerICP, + PyTransformationEstimation, + TransformationEstimation> + te_dop(m_registration, "TransformationEstimationForDopplerICP", + "Class to estimate a transformation between two point " + "clouds using color information"); + pybind_robust_kernel_declarations(m_registration); +} +void pybind_registration_definitions(py::module &m) { + auto m_registration = static_cast(m.attr("registration")); + // open3d.t.pipelines.registration.ICPConvergenceCriteria + auto convergence_criteria = static_cast>( + m_registration.attr("ICPConvergenceCriteria")); py::detail::bind_copy_functions( convergence_criteria); convergence_criteria @@ -80,8 +167,8 @@ void pybind_registration_classes(py::module &m) { }); // open3d.t.pipelines.registration.RegistrationResult - py::class_ registration_result(m, "RegistrationResult", - "Registration results."); + auto registration_result = static_cast>( + m_registration.attr("RegistrationResult")); py::detail::bind_default_constructor( registration_result); py::detail::bind_copy_functions(registration_result); @@ -124,12 +211,10 @@ void pybind_registration_classes(py::module &m) { }); // open3d.t.pipelines.registration.TransformationEstimation - py::class_> - te(m, "TransformationEstimation", - "Base class that estimates a transformation between two " - "point clouds. The virtual function ComputeTransformation() " - "must be implemented in subclasses."); + auto te = static_cast< + py::class_>>( + m_registration.attr("TransformationEstimation")); te.def("compute_rmse", &TransformationEstimation::ComputeRMSE, "source"_a, "target"_a, "correspondences"_a, "Compute RMSE between source and target points cloud given " @@ -142,7 +227,7 @@ void pybind_registration_classes(py::module &m) { "iteration"_a = 0, "Compute transformation from source to target point cloud given " "correspondences."); - docstring::ClassMethodDocInject(m, "TransformationEstimation", + docstring::ClassMethodDocInject(m_registration, "TransformationEstimation", "compute_rmse", {{"source", "Source point cloud."}, {"target", "Target point cloud."}, @@ -155,7 +240,8 @@ void pybind_registration_classes(py::module &m) { "index. It contains -1 as value " "at index with no correspondence."}}); docstring::ClassMethodDocInject( - m, "TransformationEstimation", "compute_transformation", + m_registration, "TransformationEstimation", + "compute_transformation", {{"source", "Source point cloud."}, {"target", "Target point cloud."}, {"correspondences", @@ -169,12 +255,11 @@ void pybind_registration_classes(py::module &m) { // open3d.t.pipelines.registration.TransformationEstimationPointToPoint // TransformationEstimation - py::class_, - TransformationEstimation> - te_p2p(m, "TransformationEstimationPointToPoint", - "Class to estimate a transformation for point to " - "point distance."); + auto te_p2p = static_cast, + TransformationEstimation>>( + m_registration.attr("TransformationEstimationPointToPoint")); py::detail::bind_copy_functions( te_p2p); te_p2p.def(py::init()) @@ -185,12 +270,11 @@ void pybind_registration_classes(py::module &m) { // open3d.t.pipelines.registration.TransformationEstimationPointToPlane // TransformationEstimation - py::class_, - TransformationEstimation> - te_p2l(m, "TransformationEstimationPointToPlane", - "Class to estimate a transformation for point to " - "plane distance."); + auto te_p2l = static_cast, + TransformationEstimation>>( + m_registration.attr("TransformationEstimationPointToPlane")); py::detail::bind_default_constructor( te_p2l); py::detail::bind_copy_functions( @@ -209,13 +293,11 @@ void pybind_registration_classes(py::module &m) { // open3d.t.pipelines.registration.TransformationEstimationForColoredICP // TransformationEstimation - py::class_< + auto te_col = static_cast, - TransformationEstimation> - te_col(m, "TransformationEstimationForColoredICP", - "Class to estimate a transformation between two point " - "clouds using color information"); + TransformationEstimation>>( + m_registration.attr("TransformationEstimationForColoredICP")); py::detail::bind_default_constructor( te_col); py::detail::bind_copy_functions( @@ -253,13 +335,11 @@ void pybind_registration_classes(py::module &m) { // open3d.t.pipelines.registration.TransformationEstimationForDopplerICP // TransformationEstimation - py::class_< + auto te_dop = static_cast, - TransformationEstimation> - te_dop(m, "TransformationEstimationForDopplerICP", - "Class to estimate a transformation between two point " - "clouds using color information"); + TransformationEstimation>>( + m_registration.attr("TransformationEstimationForDopplerICP")); py::detail::bind_default_constructor( te_dop); py::detail::bind_copy_functions( @@ -356,102 +436,53 @@ void pybind_registration_classes(py::module &m) { transform_vehicle_to_sensor_, "The 4x4 extrinsic transformation matrix between " "the vehicle and the sensor frames."); -} - -// Registration functions have similar arguments, sharing arg docstrings. -static const std::unordered_map - map_shared_argument_docstrings = { - {"correspondences", - "Tensor of type Int64 containing indices of corresponding " - "target points, where the value is the target index and the " - "index of the value itself is the source index. It contains " - "-1 as value at index with no correspondence."}, - {"criteria", "Convergence criteria"}, - {"criteria_list", - "List of Convergence criteria for each scale of multi-scale " - "icp."}, - {"estimation_method", - "Estimation method. One of " - "(``TransformationEstimationPointToPoint``, " - "``TransformationEstimationPointToPlane``, " - "``TransformationEstimationForColoredICP``, " - "``TransformationEstimationForGeneralizedICP``)"}, - {"init_source_to_target", "Initial transformation estimation"}, - {"max_correspondence_distance", - "Maximum correspondence points-pair distance."}, - {"max_correspondence_distances", - "o3d.utility.DoubleVector of maximum correspondence " - "points-pair distances for multi-scale icp."}, - {"option", "Registration option"}, - {"source", "The source point cloud."}, - {"target", "The target point cloud."}, - {"transformation", - "The 4x4 transformation matrix of type Float64 " - "to transform ``source`` to ``target``"}, - {"voxel_size", - "The input pointclouds will be down-sampled to this " - "`voxel_size` scale. If `voxel_size` < 0, original scale will " - "be used. However it is highly recommended to down-sample the " - "point-cloud for performance. By default original scale of " - "the point-cloud will be used."}, - {"voxel_sizes", - "o3d.utility.DoubleVector of voxel sizes in strictly " - "decreasing order, for multi-scale icp."}, - {"callback_after_iteration", - "Optional lambda function, saves string to tensor map of " - "attributes such as iteration_index, scale_index, " - "scale_iteration_index, inlier_rmse, fitness, transformation, " - "on CPU device, updated after each iteration."}}; - -void pybind_registration_methods(py::module &m) { - m.def("evaluate_registration", &EvaluateRegistration, - py::call_guard(), - "Function for evaluating registration between point clouds", - "source"_a, "target"_a, "max_correspondence_distance"_a, - "transformation"_a = - core::Tensor::Eye(4, core::Float64, core::Device("CPU:0"))); - docstring::FunctionDocInject(m, "evaluate_registration", + m_registration.def( + "evaluate_registration", &EvaluateRegistration, + py::call_guard(), + "Function for evaluating registration between point clouds", + "source"_a, "target"_a, "max_correspondence_distance"_a, + "transformation"_a = + core::Tensor::Eye(4, core::Float64, core::Device("CPU:0"))); + docstring::FunctionDocInject(m_registration, "evaluate_registration", map_shared_argument_docstrings); - m.def("icp", &ICP, py::call_guard(), - "Function for ICP registration", "source"_a, "target"_a, - "max_correspondence_distance"_a, - "init_source_to_target"_a = - core::Tensor::Eye(4, core::Float64, core::Device("CPU:0")), - "estimation_method"_a = TransformationEstimationPointToPoint(), - "criteria"_a = ICPConvergenceCriteria(), "voxel_size"_a = -1.0, - "callback_after_iteration"_a = py::none()); - docstring::FunctionDocInject(m, "icp", map_shared_argument_docstrings); - - m.def("multi_scale_icp", &MultiScaleICP, - py::call_guard(), - "Function for Multi-Scale ICP registration", "source"_a, "target"_a, - "voxel_sizes"_a, "criteria_list"_a, "max_correspondence_distances"_a, - "init_source_to_target"_a = - core::Tensor::Eye(4, core::Float64, core::Device("CPU:0")), - "estimation_method"_a = TransformationEstimationPointToPoint(), - "callback_after_iteration"_a = py::none()); - docstring::FunctionDocInject(m, "multi_scale_icp", + m_registration.def( + "icp", &ICP, py::call_guard(), + "Function for ICP registration", "source"_a, "target"_a, + "max_correspondence_distance"_a, + "init_source_to_target"_a = + core::Tensor::Eye(4, core::Float64, core::Device("CPU:0")), + "estimation_method"_a = TransformationEstimationPointToPoint(), + "criteria"_a = ICPConvergenceCriteria(), "voxel_size"_a = -1.0, + "callback_after_iteration"_a = py::none()); + docstring::FunctionDocInject(m_registration, "icp", map_shared_argument_docstrings); - m.def("get_information_matrix", &GetInformationMatrix, - py::call_guard(), - "Function for computing information matrix from transformation " - "matrix. Information matrix is tensor of shape {6, 6}, dtype Float64 " - "on CPU device.", - "source"_a, "target"_a, "max_correspondence_distance"_a, - "transformation"_a); - docstring::FunctionDocInject(m, "get_information_matrix", + m_registration.def( + "multi_scale_icp", &MultiScaleICP, + py::call_guard(), + "Function for Multi-Scale ICP registration", "source"_a, "target"_a, + "voxel_sizes"_a, "criteria_list"_a, + "max_correspondence_distances"_a, + "init_source_to_target"_a = + core::Tensor::Eye(4, core::Float64, core::Device("CPU:0")), + "estimation_method"_a = TransformationEstimationPointToPoint(), + "callback_after_iteration"_a = py::none()); + docstring::FunctionDocInject(m_registration, "multi_scale_icp", map_shared_argument_docstrings); -} - -void pybind_registration(py::module &m) { - py::module m_submodule = m.def_submodule( - "registration", "Tensor-based registration pipeline."); - pybind_registration_classes(m_submodule); - pybind_registration_methods(m_submodule); - pybind_feature(m_submodule); - pybind_robust_kernels(m_submodule); + m_registration.def( + "get_information_matrix", &GetInformationMatrix, + py::call_guard(), + "Function for computing information matrix from transformation " + "matrix. Information matrix is tensor of shape {6, 6}, dtype " + "Float64 " + "on CPU device.", + "source"_a, "target"_a, "max_correspondence_distance"_a, + "transformation"_a); + docstring::FunctionDocInject(m_registration, "get_information_matrix", + map_shared_argument_docstrings); + pybind_feature_definitions(m_registration); + pybind_robust_kernel_definitions(m_registration); } } // namespace registration diff --git a/cpp/pybind/t/pipelines/registration/registration.h b/cpp/pybind/t/pipelines/registration/registration.h index 671f6e96d0d..1032d7e2d7b 100644 --- a/cpp/pybind/t/pipelines/registration/registration.h +++ b/cpp/pybind/t/pipelines/registration/registration.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -14,9 +14,11 @@ namespace t { namespace pipelines { namespace registration { -void pybind_feature(py::module &m); -void pybind_registration(py::module &m); -void pybind_robust_kernels(py::module &m); +void pybind_registration_declarations(py::module &m); +void pybind_robust_kernel_declarations(py::module &m_registration); +void pybind_registration_definitions(py::module &m); +void pybind_feature_definitions(py::module &m_registration); +void pybind_robust_kernel_definitions(py::module &m_registration); } // namespace registration } // namespace pipelines diff --git a/cpp/pybind/t/pipelines/registration/robust_kernel.cpp b/cpp/pybind/t/pipelines/registration/robust_kernel.cpp index 2b2e7f5bccc..34d5a219b54 100644 --- a/cpp/pybind/t/pipelines/registration/robust_kernel.cpp +++ b/cpp/pybind/t/pipelines/registration/robust_kernel.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -15,8 +15,11 @@ namespace t { namespace pipelines { namespace registration { -void pybind_robust_kernel_classes(py::module& m) { - py::enum_(m, "RobustKernelMethod", +void pybind_robust_kernel_declarations(py::module& m) { + py::module m_robust_kernel = m.def_submodule( + "robust_kernel", + "Tensor-based robust kernel for outlier rejection."); + py::enum_(m_robust_kernel, "RobustKernelMethod", "Robust kernel method for outlier rejection.") .value("L2Loss", RobustKernelMethod::L2Loss) .value("L1Loss", RobustKernelMethod::L1Loss) @@ -26,9 +29,7 @@ void pybind_robust_kernel_classes(py::module& m) { .value("TukeyLoss", RobustKernelMethod::TukeyLoss) .value("GeneralizedLoss", RobustKernelMethod::GeneralizedLoss) .export_values(); - - // open3d.t.pipelines.odometry.OdometryConvergenceCriteria - py::class_ robust_kernel(m, "RobustKernel", + py::class_ robust_kernel(m_robust_kernel, "RobustKernel", R"( Base class that models a robust kernel for outlier rejection. The virtual function ``weight()`` must be implemented in derived classes. @@ -100,6 +101,12 @@ Philippe Babin et al. For more information please also see: **"Adaptive Robust Kernels for Non-Linear Least Squares Problems"**, by Nived Chebrolu et al. )"); +} + +void pybind_robust_kernel_definitions(py::module& m) { + auto m_robust_kernel = static_cast(m.attr("robust_kernel")); + auto robust_kernel = static_cast>( + m_robust_kernel.attr("RobustKernel")); py::detail::bind_copy_functions(robust_kernel); robust_kernel .def(py::init([](const RobustKernelMethod type, @@ -108,7 +115,9 @@ Non-Linear Least Squares Problems"**, by Nived Chebrolu et al. return new RobustKernel(type, scaling_parameter, shape_parameter); }), - "type"_a = RobustKernelMethod::L2Loss, + py::arg_v("type", RobustKernelMethod::L2Loss, + "open3d.t.pipelines.registration.RobustKernelMethod." + "L2Loss"), "scaling_parameter"_a = 1.0, "shape_parameter"_a = 1.0) .def_readwrite("type", &RobustKernel::type_, "Loss type.") .def_readwrite("scaling_parameter", @@ -124,13 +133,6 @@ Non-Linear Least Squares Problems"**, by Nived Chebrolu et al. }); } -void pybind_robust_kernels(py::module& m) { - py::module m_submodule = m.def_submodule( - "robust_kernel", - "Tensor-based robust kernel for outlier rejection."); - pybind_robust_kernel_classes(m_submodule); -} - } // namespace registration } // namespace pipelines } // namespace t diff --git a/cpp/pybind/t/pipelines/slac/slac.cpp b/cpp/pybind/t/pipelines/slac/slac.cpp index a2874e0b172..06eec75b3a5 100644 --- a/cpp/pybind/t/pipelines/slac/slac.cpp +++ b/cpp/pybind/t/pipelines/slac/slac.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -18,10 +18,45 @@ namespace t { namespace pipelines { namespace slac { -void pybind_slac_classes(py::module &m) { +// SLAC functions have similar arguments, sharing arg docstrings. +static const std::unordered_map + map_shared_argument_docstrings = { + {"fnames_processed", + "List of filenames (str) for pre-processed pointcloud " + "fragments."}, + {"fragment_filenames", + "List of filenames (str) for pointcloud fragments."}, + {"fragment_pose_graph", "PoseGraph for pointcloud fragments"}, + {"params", + "slac_optimizer_params Parameters to tune in optimization."}, + {"debug_option", "debug options."}}; + +void pybind_slac_declarations(py::module &m) { + py::module m_slac = m.def_submodule( + "slac", + "Tensor-based Simultaneous Localisation and Calibration pipeline."); py::class_ slac_optimizer_params( - m, "slac_optimizer_params", + m_slac, "slac_optimizer_params", "SLAC parameters to tune in optimization."); + py::class_ slac_debug_option(m_slac, "slac_debug_option", + "SLAC debug options."); + py::class_ control_grid( + m_slac, "control_grid", + " ControlGrid is a spatially hashed voxel grid used for non-rigid " + "point cloud registration and TSDF integration. Each grid stores a " + "map from the initial grid location to the deformed location. You " + "can imagine a control grid as a jelly that is warped upon " + "perturbation with its overall shape preserved. " + "Reference: " + "https://github.com/qianyizh/ElasticReconstruction/blob/master/" + "FragmentOptimizer/OptApp.cpp " + "http://vladlen.info/papers/elastic-fragments.pdf. "); +} + +void pybind_slac_definitions(py::module &m) { + auto m_slac = static_cast(m.attr("slac")); + auto slac_optimizer_params = static_cast>( + m_slac.attr("slac_optimizer_params")); py::detail::bind_copy_functions(slac_optimizer_params); slac_optimizer_params .def(py::init slac_debug_option(m, "slac_debug_option", - "SLAC debug options."); + auto slac_debug_option = static_cast>( + m_slac.attr("slac_debug_option")); py::detail::bind_copy_functions(slac_debug_option); slac_debug_option .def(py::init(), "debug"_a = false, @@ -83,23 +118,13 @@ void pybind_slac_classes(py::module &m) { "will be skipped for visualization.") .def("__repr__", [](const SLACDebugOption &debug_option) { return fmt::format( - "SLACDebugOption[debug={}, " - "debug_start_node_idx={:d}].", - debug_option.debug_, + "SLACDebugOption(debug={}, " + "debug_start_node_idx={:d})", + debug_option.debug_ ? "True" : "False", debug_option.debug_start_node_idx_); }); - - py::class_ control_grid( - m, "control_grid", - " ControlGrid is a spatially hashed voxel grid used for non-rigid " - "point cloud registration and TSDF integration. Each grid stores a " - "map from the initial grid location to the deformed location. You " - "can imagine a control grid as a jelly that is warped upon " - "perturbation with its overall shape preserved. " - "Reference: " - "https://github.com/qianyizh/ElasticReconstruction/blob/master/" - "FragmentOptimizer/OptApp.cpp " - "http://vladlen.info/papers/elastic-fragments.pdf. "); + auto control_grid = + static_cast>(m_slac.attr("control_grid")); py::detail::bind_copy_functions(control_grid); control_grid.def(py::init<>()) .def(py::init(), "grid_size"_a, @@ -205,64 +230,43 @@ void pybind_slac_classes(py::module &m) { "anchor_idx={:d}].", control_grid.Size(), control_grid.GetAnchorIdx()); }); -} - -// SLAC functions have similar arguments, sharing arg docstrings. -static const std::unordered_map - map_shared_argument_docstrings = { - {"fnames_processed", - "List of filenames (str) for pre-processed pointcloud " - "fragments."}, - {"fragment_filenames", - "List of filenames (str) for pointcloud fragments."}, - {"fragment_pose_graph", "PoseGraph for pointcloud fragments"}, - {"params", - "slac_optimizer_params Parameters to tune in optimization."}, - {"debug_option", "debug options."}}; - -void pybind_slac_methods(py::module &m) { - m.def("save_correspondences_for_pointclouds", - &SaveCorrespondencesForPointClouds, - py::call_guard(), - "Read pose graph containing loop closures and odometry to compute " - "correspondences. Uses aggressive pruning -- reject any suspicious " - "pair.", - "fnames_processed"_a, "fragment_pose_graph"_a, - "params"_a = SLACOptimizerParams(), - "debug_option"_a = SLACDebugOption()); - docstring::FunctionDocInject(m, "save_correspondences_for_pointclouds", + m_slac.def( + "save_correspondences_for_pointclouds", + &SaveCorrespondencesForPointClouds, + py::call_guard(), + "Read pose graph containing loop closures and odometry to compute " + "correspondences. Uses aggressive pruning -- reject any suspicious " + "pair.", + "fnames_processed"_a, "fragment_pose_graph"_a, + "params"_a = SLACOptimizerParams(), + "debug_option"_a = SLACDebugOption()); + docstring::FunctionDocInject(m_slac, "save_correspondences_for_pointclouds", map_shared_argument_docstrings); - m.def("run_slac_optimizer_for_fragments", &RunSLACOptimizerForFragments, - "Simultaneous Localization and Calibration: Self-Calibration of " - "Consumer Depth Cameras, CVPR 2014 Qian-Yi Zhou and Vladlen Koltun " - "Estimate a shared control grid for all fragments for scene " - "reconstruction, implemented in " - "https://github.com/qianyizh/ElasticReconstruction. ", - "fragment_filenames"_a, "fragment_pose_graph"_a, - "params"_a = SLACOptimizerParams(), - "debug_option"_a = SLACDebugOption()); - docstring::FunctionDocInject(m, "run_slac_optimizer_for_fragments", + m_slac.def( + "run_slac_optimizer_for_fragments", &RunSLACOptimizerForFragments, + "Simultaneous Localization and Calibration: Self-Calibration of " + "Consumer Depth Cameras, CVPR 2014 Qian-Yi Zhou and Vladlen Koltun " + "Estimate a shared control grid for all fragments for scene " + "reconstruction, implemented in " + "https://github.com/qianyizh/ElasticReconstruction. ", + "fragment_filenames"_a, "fragment_pose_graph"_a, + "params"_a = SLACOptimizerParams(), + "debug_option"_a = SLACDebugOption()); + docstring::FunctionDocInject(m_slac, "run_slac_optimizer_for_fragments", map_shared_argument_docstrings); - m.def("run_rigid_optimizer_for_fragments", &RunRigidOptimizerForFragments, - "Extended ICP to simultaneously align multiple point clouds with " - "dense pairwise point-to-plane distances.", - "fragment_filenames"_a, "fragment_pose_graph"_a, - "params"_a = SLACOptimizerParams(), - "debug_option"_a = SLACDebugOption()); - docstring::FunctionDocInject(m, "run_rigid_optimizer_for_fragments", + m_slac.def( + "run_rigid_optimizer_for_fragments", &RunRigidOptimizerForFragments, + "Extended ICP to simultaneously align multiple point clouds with " + "dense pairwise point-to-plane distances.", + "fragment_filenames"_a, "fragment_pose_graph"_a, + "params"_a = SLACOptimizerParams(), + "debug_option"_a = SLACDebugOption()); + docstring::FunctionDocInject(m_slac, "run_rigid_optimizer_for_fragments", map_shared_argument_docstrings); } -void pybind_slac(py::module &m) { - py::module m_submodule = m.def_submodule( - "slac", - "Tensor-based Simultaneous Localisation and Calibration pipeline."); - pybind_slac_classes(m_submodule); - pybind_slac_methods(m_submodule); -} - } // namespace slac } // namespace pipelines } // namespace t diff --git a/cpp/pybind/t/pipelines/slac/slac.h b/cpp/pybind/t/pipelines/slac/slac.h index aa161593640..d2b836f2835 100644 --- a/cpp/pybind/t/pipelines/slac/slac.h +++ b/cpp/pybind/t/pipelines/slac/slac.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -14,7 +14,8 @@ namespace t { namespace pipelines { namespace slac { -void pybind_slac(py::module &m); +void pybind_slac_declarations(py::module &m); +void pybind_slac_definitions(py::module &m); } // namespace slac } // namespace pipelines diff --git a/cpp/pybind/t/pipelines/slam/slam.cpp b/cpp/pybind/t/pipelines/slam/slam.cpp index 5a2cf260d60..f9a88f3c01b 100644 --- a/cpp/pybind/t/pipelines/slam/slam.cpp +++ b/cpp/pybind/t/pipelines/slam/slam.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -54,10 +54,18 @@ static const std::unordered_map "--trunc_voxel_multiplier=8 with --voxel_size=0.006(m) " "creates a truncation distance of 0.048(m)."}}; -void pybind_slam_model(py::module &m) { - py::class_ model(m, "Model", "Volumetric model for Dense SLAM."); +void pybind_slam_declarations(py::module &m) { + py::module m_slam = m.def_submodule("slam", "Tensor DenseSLAM pipeline."); + py::class_ model(m_slam, "Model", + "Volumetric model for Dense SLAM."); + py::class_ frame(m_slam, "Frame", + "A frame container that stores a map from keys " + "(color, depth) to tensor images."); +} +void pybind_slam_definitions(py::module &m) { + auto m_slam = static_cast(m.attr("slam")); + auto model = static_cast>(m_slam.attr("Model")); py::detail::bind_copy_functions(model); - model.def(py::init<>()); model.def(py::init(), "Constructor of a VoxelBlockGrid", "voxel_size"_a, @@ -65,7 +73,7 @@ void pybind_slam_model(py::module &m) { "transformation"_a = core::Tensor::Eye(4, core::Float64, core::Device("CPU:0")), "device"_a = core::Device("CUDA:0")); - docstring::ClassMethodDocInject(m, "Model", "__init__", + docstring::ClassMethodDocInject(m_slam, "Model", "__init__", map_shared_argument_docstrings); model.def("get_current_frame_pose", &Model::GetCurrentFramePose); @@ -77,7 +85,7 @@ void pybind_slam_model(py::module &m) { "model_frame"_a, "depth_scale"_a = 1000.0, "depth_min"_a = 0.1, "depth_max"_a = 3.0, "trunc_voxel_multiplier"_a = 8.0, "enable_color"_a = false, "weight_threshold"_a = -1.0); - docstring::ClassMethodDocInject(m, "Model", "synthesize_model_frame", + docstring::ClassMethodDocInject(m_slam, "Model", "synthesize_model_frame", map_shared_argument_docstrings); model.def( @@ -86,10 +94,11 @@ void pybind_slam_model(py::module &m) { "Track input frame against raycasted frame from model.", "input_frame"_a, "model_frame"_a, "depth_scale"_a = 1000.0, "depth_max"_a = 3.0, "depth_diff"_a = 0.07, - "method"_a = odometry::Method::PointToPlane, + py::arg_v("method", odometry::Method::PointToPlane, + "Method.PointToPlane"), "criteria"_a = (std::vector){ 6, 3, 1}); - docstring::ClassMethodDocInject(m, "Model", "track_frame_to_model", + docstring::ClassMethodDocInject(m_slam, "Model", "track_frame_to_model", map_shared_argument_docstrings); model.def("integrate", &Model::Integrate, @@ -97,21 +106,21 @@ void pybind_slam_model(py::module &m) { "Integrate an input frame to a volume.", "input_frame"_a, "depth_scale"_a = 1000.0, "depth_max"_a = 3.0, "trunc_voxel_multiplier"_a = 8.0); - docstring::ClassMethodDocInject(m, "Model", "integrate", + docstring::ClassMethodDocInject(m_slam, "Model", "integrate", map_shared_argument_docstrings); model.def("extract_pointcloud", &Model::ExtractPointCloud, py::call_guard(), "Extract point cloud from the volumetric model.", "weight_threshold"_a = 3.0, "estimated_number"_a = -1); - docstring::ClassMethodDocInject(m, "Model", "extract_pointcloud", + docstring::ClassMethodDocInject(m_slam, "Model", "extract_pointcloud", map_shared_argument_docstrings); model.def("extract_trianglemesh", &Model::ExtractTriangleMesh, py::call_guard(), "Extract triangle mesh from the volumetric model.", "weight_threshold"_a = 3.0, "estimated_number"_a = -1); - docstring::ClassMethodDocInject(m, "Model", "extract_trianglemesh", + docstring::ClassMethodDocInject(m_slam, "Model", "extract_trianglemesh", map_shared_argument_docstrings); model.def( @@ -127,17 +136,12 @@ void pybind_slam_model(py::module &m) { "frame to the world frame."); model.def_readwrite("frame_id", &Model::frame_id_, "Get the current frame index in a sequence."); -} - -void pybind_slam_frame(py::module &m) { - py::class_ frame(m, "Frame", - "A frame container that stores a map from keys " - "(color, depth) to tensor images."); + auto frame = static_cast>(m_slam.attr("Frame")); py::detail::bind_copy_functions(frame); frame.def(py::init(), "height"_a, "width"_a, "intrinsics"_a, "device"_a); - docstring::ClassMethodDocInject(m, "Frame", "__init__", + docstring::ClassMethodDocInject(m_slam, "Frame", "__init__", map_shared_argument_docstrings); frame.def("height", &Frame::GetHeight); @@ -153,13 +157,6 @@ void pybind_slam_frame(py::module &m) { "Get a 2D image from from the given key in the map."); } -void pybind_slam(py::module &m) { - py::module m_submodule = - m.def_submodule("slam", "Tensor DenseSLAM pipeline."); - pybind_slam_model(m_submodule); - pybind_slam_frame(m_submodule); -} - } // namespace slam } // namespace pipelines } // namespace t diff --git a/cpp/pybind/t/pipelines/slam/slam.h b/cpp/pybind/t/pipelines/slam/slam.h index eea3c937abf..4e281ed850c 100644 --- a/cpp/pybind/t/pipelines/slam/slam.h +++ b/cpp/pybind/t/pipelines/slam/slam.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -14,7 +14,8 @@ namespace t { namespace pipelines { namespace slam { -void pybind_slam(py::module &m); +void pybind_slam_declarations(py::module &m); +void pybind_slam_definitions(py::module &m); } // namespace slam } // namespace pipelines diff --git a/cpp/pybind/t/t.cpp b/cpp/pybind/t/t.cpp index b3a166efc1c..7f8f9e85ebb 100644 --- a/cpp/pybind/t/t.cpp +++ b/cpp/pybind/t/t.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -15,11 +15,17 @@ namespace open3d { namespace t { -void pybind_t(py::module& m) { - py::module m_submodule = m.def_submodule("t"); - pipelines::pybind_pipelines(m_submodule); - geometry::pybind_geometry(m_submodule); - io::pybind_io(m_submodule); +void pybind_t_declarations(py::module& m) { + py::module m_t = m.def_submodule("t"); + pipelines::pybind_pipelines_declarations(m_t); + geometry::pybind_geometry_declarations(m_t); + io::pybind_io_declarations(m_t); +} +void pybind_t_definitions(py::module& m) { + auto m_t = static_cast(m.attr("t")); + pipelines::pybind_pipelines_definitions(m_t); + geometry::pybind_geometry_definitions(m_t); + io::pybind_io_definitions(m_t); } } // namespace t diff --git a/cpp/pybind/t/t.h b/cpp/pybind/t/t.h index c941372b5b8..6585d208af9 100644 --- a/cpp/pybind/t/t.h +++ b/cpp/pybind/t/t.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -12,7 +12,8 @@ namespace open3d { namespace t { -void pybind_t(py::module& m); +void pybind_t_declarations(py::module& m); +void pybind_t_definitions(py::module& m); } // namespace t } // namespace open3d diff --git a/cpp/pybind/utility/eigen.cpp b/cpp/pybind/utility/eigen.cpp index f23e94060f3..1eb621772eb 100644 --- a/cpp/pybind/utility/eigen.cpp +++ b/cpp/pybind/utility/eigen.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -306,8 +306,17 @@ py::class_ pybind_eigen_vector_of_matrix( namespace open3d { namespace utility { -void pybind_eigen(py::module &m) { +void pybind_eigen_declarations(py::module &m) { auto intvector = pybind_eigen_vector_of_scalar(m, "IntVector"); + auto doublevector = + pybind_eigen_vector_of_scalar(m, "DoubleVector"); + auto vector3dvector = pybind_eigen_vector_of_vector( + m, "Vector3dVector", "std::vector", + py::py_array_to_vectors_double); +} +void pybind_eigen_definitions(py::module &m) { + auto intvector = static_cast( + m, "IntVector"))>(m.attr("IntVector")); intvector.attr("__doc__") = docstring::static_property( py::cpp_function([](py::handle arg) -> std::string { return R"(Convert int32 numpy array of shape ``(n,)`` to Open3D format.)"; @@ -315,16 +324,18 @@ void pybind_eigen(py::module &m) { py::none(), py::none(), ""); auto doublevector = - pybind_eigen_vector_of_scalar(m, "DoubleVector"); + static_cast( + m, "DoubleVector"))>(m.attr("DoubleVector")); doublevector.attr("__doc__") = docstring::static_property( py::cpp_function([](py::handle arg) -> std::string { return R"(Convert float64 numpy array of shape ``(n,)`` to Open3D format.)"; }), py::none(), py::none(), ""); - - auto vector3dvector = pybind_eigen_vector_of_vector( - m, "Vector3dVector", "std::vector", - py::py_array_to_vectors_double); + auto vector3dvector = + static_cast( + m, "Vector3dVector", "std::vector", + py::py_array_to_vectors_double))>( + m.attr("Vector3dVector")); vector3dvector.attr("__doc__") = docstring::static_property( py::cpp_function([](py::handle arg) -> std::string { return R"(Convert float64 numpy array of shape ``(n, 3)`` to Open3D format. diff --git a/cpp/pybind/utility/logging.cpp b/cpp/pybind/utility/logging.cpp index 2be3832c883..eaaabb27616 100644 --- a/cpp/pybind/utility/logging.cpp +++ b/cpp/pybind/utility/logging.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -13,7 +13,7 @@ namespace open3d { namespace utility { -void pybind_logging(py::module& m) { +void pybind_logging_declarations(py::module& m) { py::enum_ vl(m, "VerbosityLevel", py::arithmetic(), "VerbosityLevel"); vl.value("Error", VerbosityLevel::Error) @@ -27,7 +27,13 @@ void pybind_logging(py::module& m) { return "Enum class for VerbosityLevel."; }), py::none(), py::none(), ""); - + py::class_ verbosity_context_manager( + m, "VerbosityContextManager", + "A context manager to " + "temporally change the " + "verbosity level of Open3D"); +} +void pybind_logging_definitions(py::module& m) { m.def("set_verbosity_level", &SetVerbosityLevel, "Set global verbosity level of Open3D", py::arg("verbosity_level")); docstring::FunctionDocInject( @@ -44,11 +50,10 @@ void pybind_logging(py::module& m) { utility::LogInfo("Resetting default logger to print to terminal."); utility::Logger::GetInstance().ResetPrintFunction(); }); - - py::class_(m, "VerbosityContextManager", - "A context manager to " - "temporally change the " - "verbosity level of Open3D") + auto verbosity_context_manager = + static_cast>( + m.attr("VerbosityContextManager")); + verbosity_context_manager .def(py::init(), "Create a VerbosityContextManager with a given VerbosityLevel", "level"_a) diff --git a/cpp/pybind/utility/random.cpp b/cpp/pybind/utility/random.cpp index 38fefa7869f..fbecce49f0d 100644 --- a/cpp/pybind/utility/random.cpp +++ b/cpp/pybind/utility/random.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/pybind/utility/utility.cpp b/cpp/pybind/utility/utility.cpp index 315aa0a2125..eca65bcf2fb 100644 --- a/cpp/pybind/utility/utility.cpp +++ b/cpp/pybind/utility/utility.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -13,11 +13,16 @@ namespace open3d { namespace utility { -void pybind_utility(py::module &m) { - py::module m_submodule = m.def_submodule("utility"); - pybind_eigen(m_submodule); - pybind_logging(m_submodule); - random::pybind_random(m_submodule); +void pybind_utility_declarations(py::module &m) { + py::module m_utility = m.def_submodule("utility"); + pybind_eigen_declarations(m_utility); + pybind_logging_declarations(m_utility); + random::pybind_random(m_utility); +} +void pybind_utility_definitions(py::module &m) { + auto m_utility = static_cast(m.attr("utility")); + pybind_eigen_definitions(m_utility); + pybind_logging_definitions(m_utility); } } // namespace utility diff --git a/cpp/pybind/utility/utility.h b/cpp/pybind/utility/utility.h index eeb40cb4e8f..636d93547b9 100644 --- a/cpp/pybind/utility/utility.h +++ b/cpp/pybind/utility/utility.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -12,10 +12,12 @@ namespace open3d { namespace utility { -void pybind_utility(py::module &m); - -void pybind_eigen(py::module &m); -void pybind_logging(py::module &m); +void pybind_utility_declarations(py::module &m); +void pybind_eigen_declarations(py::module &m); +void pybind_logging_declarations(py::module &m); +void pybind_utility_definitions(py::module &m); +void pybind_eigen_definitions(py::module &m); +void pybind_logging_definitions(py::module &m); namespace random { void pybind_random(py::module &m); diff --git a/cpp/pybind/visualization/app/viewer.cpp b/cpp/pybind/visualization/app/viewer.cpp index 524d154d45e..37a3a03989c 100644 --- a/cpp/pybind/visualization/app/viewer.cpp +++ b/cpp/pybind/visualization/app/viewer.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -14,8 +14,13 @@ namespace open3d { namespace visualization { namespace app { -static void pybind_app_functions(py::module &m) { - m.def( +void pybind_app_declarations(py::module &m) { + py::module m_app = m.def_submodule( + "app", "Functionality for running the open3d viewer."); +} +void pybind_app_definitions(py::module &m) { + auto m_app = static_cast(m.attr("app")); + m_app.def( "run_viewer", [](const std::vector &args) { const char **argv = new const char *[args.size()]; @@ -26,21 +31,14 @@ static void pybind_app_functions(py::module &m) { delete[] argv; }, "args"_a); - docstring::FunctionDocInject( - m, "run_viewer", + m_app, "run_viewer", {{"args", "List of arguments containing the path of the calling program " "(which should be in the same directory as the gui resources " "folder) and the optional path of the geometry to visualize."}}); } -void pybind_app(py::module &m) { - py::module m_submodule = m.def_submodule( - "app", "Functionality for running the open3d viewer."); - pybind_app_functions(m_submodule); -} - } // namespace app } // namespace visualization } // namespace open3d diff --git a/cpp/pybind/visualization/app/viewer.h b/cpp/pybind/visualization/app/viewer.h index 8c62fdc71a0..5f726feacf4 100644 --- a/cpp/pybind/visualization/app/viewer.h +++ b/cpp/pybind/visualization/app/viewer.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -13,7 +13,8 @@ namespace open3d { namespace visualization { namespace app { -void pybind_app(py::module &m); +void pybind_app_declarations(py::module &m); +void pybind_app_definitions(py::module &m); } // namespace app } // namespace visualization diff --git a/cpp/pybind/visualization/gui/events.cpp b/cpp/pybind/visualization/gui/events.cpp index d35d1f7bf6d..62999d472ee 100644 --- a/cpp/pybind/visualization/gui/events.cpp +++ b/cpp/pybind/visualization/gui/events.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -15,9 +15,9 @@ namespace open3d { namespace visualization { namespace gui { -void pybind_gui_events(py::module& m) { - py::enum_ buttons(m, "MouseButton", "Mouse button identifiers", - py::arithmetic()); +void pybind_gui_events_declarations(py::module& m_gui) { + py::enum_ buttons( + m_gui, "MouseButton", "Mouse button identifiers", py::arithmetic()); buttons.value("NONE", MouseButton::NONE) .value("LEFT", MouseButton::LEFT) .value("MIDDLE", MouseButton::MIDDLE) @@ -25,17 +25,15 @@ void pybind_gui_events(py::module& m) { .value("BUTTON4", MouseButton::BUTTON4) .value("BUTTON5", MouseButton::BUTTON5) .export_values(); - - py::enum_ key_mod(m, "KeyModifier", "Key modifier identifiers", - py::arithmetic()); + py::enum_ key_mod( + m_gui, "KeyModifier", "Key modifier identifiers", py::arithmetic()); key_mod.value("NONE", KeyModifier::NONE) .value("SHIFT", KeyModifier::SHIFT) .value("CTRL", KeyModifier::CTRL) .value("ALT", KeyModifier::ALT) .value("META", KeyModifier::META) .export_values(); - - py::class_ mouse_event(m, "MouseEvent", + py::class_ mouse_event(m_gui, "MouseEvent", "Object that stores mouse events"); py::enum_ mouse_event_type(mouse_event, "Type", py::arithmetic()); @@ -45,115 +43,7 @@ void pybind_gui_events(py::module& m) { .value("BUTTON_UP", MouseEvent::Type::BUTTON_UP) .value("WHEEL", MouseEvent::Type::WHEEL) .export_values(); - mouse_event.def_readwrite("type", &MouseEvent::type, "Mouse event type") - .def_readwrite("x", &MouseEvent::x, - "x coordinate of the mouse event") - .def_readwrite("y", &MouseEvent::y, - "y coordinate of the mouse event") - .def( - "is_modifier_down", - [](const MouseEvent& e, KeyModifier mod) { - return ((e.modifiers & int(mod)) != 0); - }, - "Convenience function to more easily deterimine if a " - "modifier " - "key is down") - .def( - "is_button_down", - [](const MouseEvent& e, MouseButton b) { - if (e.type == MouseEvent::Type::WHEEL) { - return false; - } else if (e.type == MouseEvent::Type::BUTTON_DOWN) { - return (e.button.button == b); - } else { - return ((e.move.buttons & int(b)) != 0); - } - }, - "Convenience function to more easily deterimine if a mouse " - "button is pressed") - .def_readwrite("modifiers", &MouseEvent::modifiers, - "ORed mouse modifiers") - .def_property( - "buttons", - [](const MouseEvent& e) -> int { - if (e.type == MouseEvent::Type::WHEEL) { - return int(MouseButton::NONE); - } else if (e.type == MouseEvent::Type::BUTTON_DOWN) { - return int(e.button.button); - } else { - return e.move.buttons; - } - }, - [](MouseEvent& e, int new_value) { - if (e.type == MouseEvent::Type::WHEEL) { - ; // no button value for wheel events - } else if (e.type == MouseEvent::Type::BUTTON_DOWN) { - e.button.button = MouseButton(new_value); - } else { - e.move.buttons = new_value; - } - }, - "ORed mouse buttons") - .def_property( - "wheel_dx", - [](const MouseEvent& e) -> int { - if (e.type == MouseEvent::Type::WHEEL) { - return e.wheel.dx; - } else { - return 0; - } - }, - [](MouseEvent& e, int new_value) { - if (e.type == MouseEvent::Type::WHEEL) { - e.wheel.dx = new_value; - } else { - utility::LogWarning( - "Cannot set MouseEvent.wheel_dx unless " - "MouseEvent.type == MouseEvent.Type.WHEEL"); - } - }, - "Mouse wheel horizontal motion") - .def_property( - "wheel_dy", - [](const MouseEvent& e) -> int { - if (e.type == MouseEvent::Type::WHEEL) { - return e.wheel.dy; - } else { - return 0; - } - }, - [](MouseEvent& e, int new_value) { - if (e.type == MouseEvent::Type::WHEEL) { - e.wheel.dy = new_value; - } else { - utility::LogWarning( - "Cannot set MouseEvent.wheel_dy unless " - "MouseEvent.type == MouseEvent.Type.WHEEL"); - } - }, - "Mouse wheel vertical motion") - .def_property( - "wheel_is_trackpad", - [](const MouseEvent& e) -> bool { - if (e.type == MouseEvent::Type::WHEEL) { - return e.wheel.isTrackpad; - } else { - return false; - } - }, - [](MouseEvent& e, bool new_value) { - if (e.type == MouseEvent::Type::WHEEL) { - e.wheel.isTrackpad = new_value; - } else { - utility::LogWarning( - "Cannot set MouseEvent.wheel_is_trackpad " - "unless MouseEvent.type == " - "MouseEvent.Type.WHEEL"); - } - }, - "Is mouse wheel event from a trackpad"); - - py::enum_ key_name(m, "KeyName", + py::enum_ key_name(m_gui, "KeyName", "Names of keys. Used by KeyEvent.key"); key_name.value("NONE", KeyName::KEY_NONE) .value("BACKSPACE", KeyName::KEY_BACKSPACE) @@ -260,14 +150,125 @@ void pybind_gui_events(py::module& m) { .value("F12", KeyName::KEY_F12) .value("UNKNOWN", KeyName::KEY_UNKNOWN) .export_values(); - - py::class_ key_event(m, "KeyEvent", + py::class_ key_event(m_gui, "KeyEvent", "Object that stores key events"); py::enum_ key_event_type(key_event, "Type", py::arithmetic()); key_event_type.value("DOWN", KeyEvent::Type::DOWN) .value("UP", KeyEvent::Type::UP) .export_values(); +} +void pybind_gui_events_definitions(py::module& m_gui) { + auto mouse_event = + static_cast>(m_gui.attr("MouseEvent")); + mouse_event.def_readwrite("type", &MouseEvent::type, "Mouse event type") + .def_readwrite("x", &MouseEvent::x, + "x coordinate of the mouse event") + .def_readwrite("y", &MouseEvent::y, + "y coordinate of the mouse event") + .def( + "is_modifier_down", + [](const MouseEvent& e, KeyModifier mod) { + return ((e.modifiers & int(mod)) != 0); + }, + "Convenience function to more easily deterimine if a " + "modifier " + "key is down") + .def( + "is_button_down", + [](const MouseEvent& e, MouseButton b) { + if (e.type == MouseEvent::Type::WHEEL) { + return false; + } else if (e.type == MouseEvent::Type::BUTTON_DOWN) { + return (e.button.button == b); + } else { + return ((e.move.buttons & int(b)) != 0); + } + }, + "Convenience function to more easily deterimine if a mouse " + "button is pressed") + .def_readwrite("modifiers", &MouseEvent::modifiers, + "ORed mouse modifiers") + .def_property( + "buttons", + [](const MouseEvent& e) -> int { + if (e.type == MouseEvent::Type::WHEEL) { + return int(MouseButton::NONE); + } else if (e.type == MouseEvent::Type::BUTTON_DOWN) { + return int(e.button.button); + } else { + return e.move.buttons; + } + }, + [](MouseEvent& e, int new_value) { + if (e.type == MouseEvent::Type::WHEEL) { + ; // no button value for wheel events + } else if (e.type == MouseEvent::Type::BUTTON_DOWN) { + e.button.button = MouseButton(new_value); + } else { + e.move.buttons = new_value; + } + }, + "ORed mouse buttons") + .def_property( + "wheel_dx", + [](const MouseEvent& e) -> int { + if (e.type == MouseEvent::Type::WHEEL) { + return e.wheel.dx; + } else { + return 0; + } + }, + [](MouseEvent& e, int new_value) { + if (e.type == MouseEvent::Type::WHEEL) { + e.wheel.dx = new_value; + } else { + utility::LogWarning( + "Cannot set MouseEvent.wheel_dx unless " + "MouseEvent.type == MouseEvent.Type.WHEEL"); + } + }, + "Mouse wheel horizontal motion") + .def_property( + "wheel_dy", + [](const MouseEvent& e) -> int { + if (e.type == MouseEvent::Type::WHEEL) { + return e.wheel.dy; + } else { + return 0; + } + }, + [](MouseEvent& e, int new_value) { + if (e.type == MouseEvent::Type::WHEEL) { + e.wheel.dy = new_value; + } else { + utility::LogWarning( + "Cannot set MouseEvent.wheel_dy unless " + "MouseEvent.type == MouseEvent.Type.WHEEL"); + } + }, + "Mouse wheel vertical motion") + .def_property( + "wheel_is_trackpad", + [](const MouseEvent& e) -> bool { + if (e.type == MouseEvent::Type::WHEEL) { + return e.wheel.isTrackpad; + } else { + return false; + } + }, + [](MouseEvent& e, bool new_value) { + if (e.type == MouseEvent::Type::WHEEL) { + e.wheel.isTrackpad = new_value; + } else { + utility::LogWarning( + "Cannot set MouseEvent.wheel_is_trackpad " + "unless MouseEvent.type == " + "MouseEvent.Type.WHEEL"); + } + }, + "Is mouse wheel event from a trackpad"); + auto key_event = static_cast>(m_gui.attr("KeyEvent")); key_event.def_readwrite("type", &KeyEvent::type, "Key event type") .def_readwrite("key", &KeyEvent::key, "This is the actual key that was pressed, not the " diff --git a/cpp/pybind/visualization/gui/gui.cpp b/cpp/pybind/visualization/gui/gui.cpp index a211d233a05..5bd67a951ad 100644 --- a/cpp/pybind/visualization/gui/gui.cpp +++ b/cpp/pybind/visualization/gui/gui.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -173,22 +173,372 @@ std::shared_ptr RenderToDepthImageWithoutWindow( enum class EventCallbackResult { IGNORED = 0, HANDLED, CONSUMED }; -void pybind_gui_classes(py::module &m) { - // ---- FontStyle ---- - py::enum_ font_style(m, "FontStyle", "Font style"); +class PyImageWidget : public ImageWidget { + using Super = ImageWidget; + +public: + PyImageWidget() : Super() {} + /// Uses image from the specified path. Each ImageWidget will use one + /// draw call. + explicit PyImageWidget(const char *image_path) : Super(image_path) {} + /// Uses existing image. Each ImageWidget will use one draw call. + explicit PyImageWidget(std::shared_ptr image) + : Super(image) {} + /// Uses existing image. Each ImageWidget will use one draw call. + explicit PyImageWidget(std::shared_ptr image) + : Super(image) {} + /// Uses an existing texture, using texture coordinates + /// (u0, v0) to (u1, v1). Does not deallocate texture on destruction. + /// This is useful for using an icon atlas to reduce draw calls. + explicit PyImageWidget( + open3d::visualization::rendering::TextureHandle texture_id, + float u0 = 0.0f, + float v0 = 0.0f, + float u1 = 1.0f, + float v1 = 1.0f) + : Super(texture_id, u0, v0, u1, v1) {} + + ~PyImageWidget() = default; + + void SetOnMouse(std::function f) { on_mouse_ = f; } + void SetOnKey(std::function f) { on_key_ = f; } + + Widget::EventResult Mouse(const MouseEvent &e) override { + if (on_mouse_) { + switch (EventCallbackResult(on_mouse_(e))) { + case EventCallbackResult::CONSUMED: + return Widget::EventResult::CONSUMED; + case EventCallbackResult::HANDLED: { + auto result = Super::Mouse(e); + if (result == Widget::EventResult::IGNORED) { + result = Widget::EventResult::CONSUMED; + } + return result; + } + case EventCallbackResult::IGNORED: + default: + return Super::Mouse(e); + } + } else { + return Super::Mouse(e); + } + } + + Widget::EventResult Key(const KeyEvent &e) override { + if (on_key_) { + switch (EventCallbackResult(on_key_(e))) { + case EventCallbackResult::CONSUMED: + return Widget::EventResult::CONSUMED; + case EventCallbackResult::HANDLED: { + auto result = Super::Key(e); + if (result == Widget::EventResult::IGNORED) { + result = Widget::EventResult::CONSUMED; + } + return result; + } + case EventCallbackResult::IGNORED: + default: + return Super::Key(e); + } + } else { + return Super::Key(e); + } + } + +private: + std::function on_mouse_; + std::function on_key_; +}; + +class PySceneWidget : public SceneWidget { + using Super = SceneWidget; + +public: + void SetOnMouse(std::function f) { on_mouse_ = f; } + void SetOnKey(std::function f) { on_key_ = f; } + + Widget::EventResult Mouse(const MouseEvent &e) override { + if (on_mouse_) { + switch (EventCallbackResult(on_mouse_(e))) { + case EventCallbackResult::CONSUMED: + return Widget::EventResult::CONSUMED; + case EventCallbackResult::HANDLED: { + auto result = Super::Mouse(e); + if (result == Widget::EventResult::IGNORED) { + result = Widget::EventResult::CONSUMED; + } + return result; + } + case EventCallbackResult::IGNORED: + default: + return Super::Mouse(e); + } + } else { + return Super::Mouse(e); + } + } + + Widget::EventResult Key(const KeyEvent &e) override { + if (on_key_) { + switch (EventCallbackResult(on_key_(e))) { + case EventCallbackResult::CONSUMED: + return Widget::EventResult::CONSUMED; + case EventCallbackResult::HANDLED: { + auto result = Super::Key(e); + if (result == Widget::EventResult::IGNORED) { + result = Widget::EventResult::CONSUMED; + } + return result; + } + case EventCallbackResult::IGNORED: + default: + return Super::Key(e); + } + } else { + return Super::Key(e); + } + } + +private: + std::function on_mouse_; + std::function on_key_; +}; + +void pybind_gui_declarations(py::module &m) { + py::module m_gui = m.def_submodule("gui"); + pybind_gui_events_declarations(m_gui); + py::enum_ font_style(m_gui, "FontStyle", "Font style"); font_style.value("NORMAL", FontStyle::NORMAL) .value("BOLD", FontStyle::BOLD) .value("ITALIC", FontStyle::ITALIC) .value("BOLD_ITALIC", FontStyle::BOLD_ITALIC); - - // ---- FontDescription ---- - py::class_ fd(m, "FontDescription", + py::class_ fd(m_gui, "FontDescription", "Class to describe a custom font"); + py::class_ application(m_gui, "Application", + "Global application singleton. This " + "owns the menubar, windows, and event " + "loop"); + py::class_ lc( + m_gui, "LayoutContext", + "Context passed to Window's on_layout callback"); + // Pybind appears to need to know about the base class. It doesn't have + // to be named the same as the C++ class, though. The holder object cannot + // be a shared_ptr or we can crash (see comment for UnownedPointer). + py::class_> window_base( + m_gui, "WindowBase", "Application window"); + py::class_, Window> window( + m_gui, "Window", + "Application window. Create with " + "Application.instance.create_window()."); + py::class_> menu(m_gui, "Menu", + "A menu, possibly a menu tree"); + py::class_ color(m_gui, "Color", "Stores color for gui classes"); + py::class_ theme(m_gui, "Theme", + "Theme parameters such as colors used for drawing " + "widgets (read-only)"); + py::class_ rect(m_gui, "Rect", "Represents a widget frame"); + py::class_ size(m_gui, "Size", "Size object"); + py::class_> widget(m_gui, "Widget", + "Base widget class"); + py::enum_ widget_event_callback_result( + widget, "EventCallbackResult", "Returned by event handlers", + py::arithmetic()); + widget_event_callback_result + .value("IGNORED", EventCallbackResult::IGNORED, + "Event handler ignored the event, widget will " + "handle event normally") + .value("HANDLED", EventCallbackResult::HANDLED, + "Event handler handled the event, but widget " + "will still handle the event normally. This is " + "useful when you are augmenting base " + "functionality") + .value("CONSUMED", EventCallbackResult::CONSUMED, + "Event handler consumed the event, event " + "handling stops, widget will not handle the " + "event. This is useful when you are replacing " + "functionality") + .export_values(); + py::class_ constraints( + widget, "Constraints", + "Constraints object for Widget.calc_preferred_size()"); + py::class_, Widget> widgetProxy( + m_gui, "WidgetProxy", + "Widget container to delegate any widget dynamically." + " Widget can not be managed dynamically. Although it is allowed" + " to add more child widgets, it's impossible to replace some child" + " with new on or remove children. WidgetProxy is designed to solve" + " this problem." + " When WidgetProxy is created, it's invisible and disabled, so it" + " won't be drawn or layout, seeming like it does not exist. When" + " a widget is set by set_widget, all Widget's APIs will be" + " conducted to that child widget. It looks like WidgetProxy is" + " that widget." + " At any time, a new widget could be set, to replace the old one." + " and the old widget will be destroyed." + " Due to the content changing after a new widget is set or cleared," + " a relayout of Window might be called after set_widget." + " The delegated widget could be retrieved by get_widget in case" + " you need to access it directly, like get check status of a" + " CheckBox. API other than set_widget and get_widget has" + " completely same functions as Widget."); + py::class_, WidgetProxy> + widget_stack(m_gui, "WidgetStack", + "A widget stack saves all widgets pushed into by " + "push_widget and always shows the top one. The " + "WidgetStack is a subclass of WidgetProxy, in other" + "words, the topmost widget will delegate itself to " + "WidgetStack. pop_widget will remove the topmost " + "widget and callback set by set_on_top taking the " + "new topmost widget will be called. The WidgetStack " + "disappears in GUI if there is no widget in stack."); + py::class_, Widget> button(m_gui, "Button", + "Button"); + py::class_, Widget> checkbox( + m_gui, "Checkbox", "Checkbox"); + py::class_, Widget> coloredit( + m_gui, "ColorEdit", "Color picker"); + py::class_, Widget> combobox( + m_gui, "Combobox", "Exclusive selection from a pull-down menu"); + py::class_, Widget> radiobtn( + m_gui, "RadioButton", "Exclusive selection from radio button list"); + py::enum_ radiobtn_type(radiobtn, "Type", + py::arithmetic()); + // Trick to write docs without listing the members in the enum class again. + radiobtn_type.attr("__doc__") = docstring::static_property( + py::cpp_function([](py::handle arg) -> std::string { + return "Enum class for RadioButton types."; + }), + py::none(), py::none(), ""); + radiobtn_type.value("VERT", RadioButton::Type::VERT) + .value("HORIZ", RadioButton::Type::HORIZ) + .export_values(); + py::class_> uiimage( + m_gui, "UIImage", + "A bitmap suitable for displaying with ImageWidget"); + py::enum_ uiimage_scaling(uiimage, "Scaling", + py::arithmetic()); + uiimage_scaling.value("NONE", UIImage::Scaling::NONE) + .value("ANY", UIImage::Scaling::ANY) + .value("ASPECT", UIImage::Scaling::ASPECT); + py::class_, Widget> + imagewidget(m_gui, "ImageWidget", "Displays a bitmap"); + py::class_, Widget> label(m_gui, "Label", + "Displays text"); + py::class_> label3d( + m_gui, "Label3D", "Displays text in a 3D scene"); + py::class_, Widget> listview( + m_gui, "ListView", "Displays a list of text"); + py::class_, Widget> numedit( + m_gui, "NumberEdit", "Allows the user to enter a number."); + py::enum_ numedit_type(numedit, "Type", py::arithmetic()); + // Trick to write docs without listing the members in the enum class again. + numedit_type.attr("__doc__") = docstring::static_property( + py::cpp_function([](py::handle arg) -> std::string { + return "Enum class for NumberEdit types."; + }), + py::none(), py::none(), ""); + numedit_type.value("INT", NumberEdit::Type::INT) + .value("DOUBLE", NumberEdit::Type::DOUBLE) + .export_values(); + py::class_, Widget> progress( + m_gui, "ProgressBar", "Displays a progress bar"); + py::class_, Widget> scene( + m_gui, "SceneWidget", "Displays 3D content"); + py::enum_ scene_ctrl(scene, "Controls", + py::arithmetic()); + // Trick to write docs without listing the members in the enum class again. + scene_ctrl.attr("__doc__") = docstring::static_property( + py::cpp_function([](py::handle arg) -> std::string { + return "Enum class describing mouse interaction."; + }), + py::none(), py::none(), ""); + scene_ctrl.value("ROTATE_CAMERA", SceneWidget::Controls::ROTATE_CAMERA) + .value("ROTATE_CAMERA_SPHERE", + SceneWidget::Controls::ROTATE_CAMERA_SPHERE) + .value("FLY", SceneWidget::Controls::FLY) + .value("ROTATE_SUN", SceneWidget::Controls::ROTATE_SUN) + .value("ROTATE_IBL", SceneWidget::Controls::ROTATE_IBL) + .value("ROTATE_MODEL", SceneWidget::Controls::ROTATE_MODEL) + .value("PICK_POINTS", SceneWidget::Controls::PICK_POINTS) + .export_values(); + py::class_, Widget> slider( + m_gui, "Slider", "A slider widget for visually selecting numbers"); + py::enum_ slider_type(slider, "Type", py::arithmetic()); + // Trick to write docs without listing the members in the enum class again. + slider_type.attr("__doc__") = docstring::static_property( + py::cpp_function([](py::handle arg) -> std::string { + return "Enum class for Slider types."; + }), + py::none(), py::none(), ""); + slider_type.value("INT", Slider::Type::INT) + .value("DOUBLE", Slider::Type::DOUBLE) + .export_values(); + py::class_, Widget> stacked( + m_gui, "StackedWidget", "Like a TabControl but without the tabs"); + py::class_, Widget> tabctrl( + m_gui, "TabControl", "Tab control"); + py::class_, Widget> textedit( + m_gui, "TextEdit", "Allows the user to enter or modify text"); + py::class_, Widget> toggle( + m_gui, "ToggleSwitch", "ToggleSwitch"); + py::class_, Widget> treeview( + m_gui, "TreeView", "Hierarchical list"); + py::class_, + Widget> + checkable_cell(m_gui, "CheckableTextTreeCell", + "TreeView cell with a checkbox and text"); + py::class_, Widget> lut_cell( + m_gui, "LUTTreeCell", + "TreeView cell with checkbox, text, and color edit"); + py::class_, Widget> + colormap_cell(m_gui, "ColormapTreeCell", + "TreeView cell with a number edit and color edit"); + py::class_, Widget> vectoredit( + m_gui, "VectorEdit", "Allows the user to edit a 3-space vector"); + py::class_> margins(m_gui, "Margins", + "Margins for layouts"); + py::class_, Widget> layout1d( + m_gui, "Layout1D", "Layout base class"); + py::class_, Layout1D> vlayout(m_gui, "Vert", + "Vertical layout"); + py::class_, Vert> + collapsable(m_gui, "CollapsableVert", + "Vertical layout with title, whose contents are " + "collapsable"); + py::class_, Vert> slayout( + m_gui, "ScrollableVert", "Scrollable vertical layout"); + py::class_, Layout1D> hlayout( + m_gui, "Horiz", "Horizontal layout"); + py::class_, Widget> vgrid(m_gui, "VGrid", + "Grid layout"); + py::class_, Widget> dialog(m_gui, "Dialog", + "Dialog"); + py::class_, Dialog> filedlg( + m_gui, "FileDialog", "File picker dialog"); + py::enum_ filedlg_mode(filedlg, "Mode", py::arithmetic()); + // Trick to write docs without listing the members in the enum class again. + filedlg_mode.attr("__doc__") = docstring::static_property( + py::cpp_function([](py::handle arg) -> std::string { + return "Enum class for FileDialog modes."; + }), + py::none(), py::none(), ""); + filedlg_mode.value("OPEN", FileDialog::Mode::OPEN) + .value("SAVE", FileDialog::Mode::SAVE) + .value("OPEN_DIR", FileDialog::Mode::OPEN_DIR) + .export_values(); +} +void pybind_gui_definitions(py::module &m) { + auto m_gui = static_cast(m.attr("gui")); + pybind_gui_events_definitions(m_gui); + // ---- FontDescription ---- + auto fd = static_cast>( + m_gui.attr("FontDescription")); fd.attr("SANS_SERIF") = FontDescription::SANS_SERIF; fd.attr("MONOSPACE") = FontDescription::MONOSPACE; fd.def(py::init(), "typeface"_a = FontDescription::SANS_SERIF, - "style"_a = FontStyle::NORMAL, "point_size"_a = 0, + py::arg_v("style", FontStyle::NORMAL, "open3d.gui.FontStyle.NORMAL"), + "point_size"_a = 0, "Creates a FontDescription. 'typeface' is a path to a " "TrueType (.ttf), TrueType Collection (.ttc), or " "OpenType (.otf) file, or it is the name of the font, " @@ -222,10 +572,8 @@ void pybind_gui_classes(py::module &m) { "font."); // ---- Application ---- - py::class_ application(m, "Application", - "Global application singleton. This " - "owns the menubar, windows, and event " - "loop"); + auto application = + static_cast>(m_gui.attr("Application")); application.attr("DEFAULT_FONT_ID") = Application::DEFAULT_FONT_ID; application .def("__repr__", @@ -376,9 +724,8 @@ void pybind_gui_classes(py::module &m) { "resources directory"); // ---- LayoutContext ---- - py::class_ lc( - m, "LayoutContext", - "Context passed to Window's on_layout callback"); + auto lc = + static_cast>(m_gui.attr("LayoutContext")); // lc.def_readonly("theme", &LayoutContext::theme); // Pybind can't return a reference (since Theme is a unique_ptr), so // return a copy instead. @@ -388,15 +735,9 @@ void pybind_gui_classes(py::module &m) { }); // ---- Window ---- - // Pybind appears to need to know about the base class. It doesn't have - // to be named the same as the C++ class, though. The holder object cannot - // be a shared_ptr or we can crash (see comment for UnownedPointer). - py::class_> window_base( - m, "WindowBase", "Application window"); - py::class_, Window> window( - m, "Window", - "Application window. Create with " - "Application.instance.create_window()."); + auto window = + static_cast, Window>>( + m_gui.attr("Window")); window.def("__repr__", [](const PyWindow &w) { return "Application window"; }) .def( @@ -489,8 +830,8 @@ void pybind_gui_classes(py::module &m) { "Gets the rendering.Renderer object for the Window"); // ---- Menu ---- - py::class_> menu(m, "Menu", - "A menu, possibly a menu tree"); + auto menu = static_cast>>( + m_gui.attr("Menu")); menu.def(py::init<>()) .def( "add_item", @@ -526,7 +867,7 @@ void pybind_gui_classes(py::module &m) { "Sets menu item (un)checked"); // ---- Color ---- - py::class_ color(m, "Color", "Stores color for gui classes"); + auto color = static_cast>(m_gui.attr("Color")); color.def(py::init([](float r, float g, float b, float a) { return new Color(r, g, b, a); }), @@ -554,9 +895,7 @@ void pybind_gui_classes(py::module &m) { // ---- Theme ---- // Note: no constructor because themes are created by Open3D - py::class_ theme(m, "Theme", - "Theme parameters such as colors used for drawing " - "widgets (read-only)"); + auto theme = static_cast>(m_gui.attr("Theme")); theme.def_readonly("font_size", &Theme::font_size, "Font size (which is also the conventional size of the " "em unit) (read-only)") @@ -569,7 +908,7 @@ void pybind_gui_classes(py::module &m) { "(read-only)"); // ---- Rect ---- - py::class_ rect(m, "Rect", "Represents a widget frame"); + auto rect = static_cast>(m_gui.attr("Rect")); rect.def(py::init<>()) .def(py::init()) .def(py::init([](float x, float y, float w, float h) { @@ -593,7 +932,7 @@ void pybind_gui_classes(py::module &m) { .def("get_bottom", &Rect::GetBottom); // ---- Size ---- - py::class_ size(m, "Size", "Size object"); + auto size = static_cast>(m_gui.attr("Size")); size.def(py::init<>()) .def(py::init()) .def(py::init([](float w, float h) { @@ -617,34 +956,13 @@ void pybind_gui_classes(py::module &m) { // 1) adding an object to multiple objects will cause multiple shared_ptrs // to think they own it, leading to a double-free and crash, and // 2) if the object is never added, the memory will be leaked. - py::class_> widget(m, "Widget", - "Base widget class"); - py::enum_ widget_event_callback_result( - widget, "EventCallbackResult", "Returned by event handlers", - py::arithmetic()); - widget_event_callback_result - .value("IGNORED", EventCallbackResult::IGNORED, - "Event handler ignored the event, widget will " - "handle event normally") - .value("HANDLED", EventCallbackResult::HANDLED, - "Event handler handled the event, but widget " - "will still handle the event normally. This is " - "useful when you are augmenting base " - "functionality") - .value("CONSUMED", EventCallbackResult::CONSUMED, - "Event handler consumed the event, event " - "handling stops, widget will not handle the " - "event. This is useful when you are replacing " - "functionality") - .export_values(); - - py::class_ constraints( - widget, "Constraints", - "Constraints object for Widget.calc_preferred_size()"); + auto widget = static_cast>>( + m_gui.attr("Widget")); + auto constraints = static_cast>( + widget.attr("Constraints")); constraints.def(py::init<>()) .def_readwrite("width", &Widget::Constraints::width) .def_readwrite("height", &Widget::Constraints::height); - widget.def(py::init<>()) .def("__repr__", [](const Widget &w) { @@ -682,26 +1000,9 @@ void pybind_gui_classes(py::module &m) { "properly"); // ---- WidgetProxy ---- - py::class_, Widget> widgetProxy( - m, "WidgetProxy", - "Widget container to delegate any widget dynamically." - " Widget can not be managed dynamically. Although it is allowed" - " to add more child widgets, it's impossible to replace some child" - " with new on or remove children. WidgetProxy is designed to solve" - " this problem." - " When WidgetProxy is created, it's invisible and disabled, so it" - " won't be drawn or layout, seeming like it does not exist. When" - " a widget is set by set_widget, all Widget's APIs will be" - " conducted to that child widget. It looks like WidgetProxy is" - " that widget." - " At any time, a new widget could be set, to replace the old one." - " and the old widget will be destroyed." - " Due to the content changing after a new widget is set or cleared," - " a relayout of Window might be called after set_widget." - " The delegated widget could be retrieved by get_widget in case" - " you need to access it directly, like get check status of a" - " CheckBox. API other than set_widget and get_widget has" - " completely same functions as Widget."); + auto widgetProxy = static_cast< + py::class_, Widget>>( + m_gui.attr("WidgetProxy")); widgetProxy.def(py::init<>(), "Creates a widget proxy") .def("__repr__", [](const WidgetProxy &c) { @@ -730,17 +1031,10 @@ void pybind_gui_classes(py::module &m) { "if there is none."); // ---- WidgetStack ---- - py::class_, WidgetProxy> - widgetStack(m, "WidgetStack", - "A widget stack saves all widgets pushed into by " - "push_widget and always shows the top one. The " - "WidgetStack is a subclass of WidgetProxy, in other" - "words, the topmost widget will delegate itself to " - "WidgetStack. pop_widget will remove the topmost " - "widget and callback set by set_on_top taking the " - "new topmost widget will be called. The WidgetStack " - "disappears in GUI if there is no widget in stack."); - widgetStack + auto widget_stack = static_cast< + py::class_, WidgetProxy>>( + m_gui.attr("WidgetStack")); + widget_stack .def(py::init<>(), "Creates a widget stack. The widget stack without any" "widget will not be shown in GUI until set_widget is" @@ -766,8 +1060,9 @@ void pybind_gui_classes(py::module &m) { "out. It won't be called if a widget is pushed into stack" "by set_widget."); // ---- Button ---- - py::class_, Widget> button(m, "Button", - "Button"); + auto button = + static_cast, Widget>>( + m_gui.attr("Button")); button.def(py::init(), "Creates a button with the given text") .def("__repr__", [](const Button &b) { @@ -823,8 +1118,9 @@ void pybind_gui_classes(py::module &m) { "Calls passed function when button is pressed"); // ---- Checkbox ---- - py::class_, Widget> checkbox( - m, "Checkbox", "Checkbox"); + auto checkbox = + static_cast, Widget>>( + m_gui.attr("Checkbox")); checkbox.def(py::init(), "Creates a checkbox with the given text") .def("__repr__", @@ -842,8 +1138,9 @@ void pybind_gui_classes(py::module &m) { "Calls passed function when checkbox changes state"); // ---- ColorEdit ---- - py::class_, Widget> coloredit( - m, "ColorEdit", "Color picker"); + auto coloredit = static_cast< + py::class_, Widget>>( + m_gui.attr("ColorEdit")); coloredit.def(py::init<>()) .def("__repr__", [](const ColorEdit &c) { @@ -864,8 +1161,9 @@ void pybind_gui_classes(py::module &m) { "Calls f(Color) when color changes by user input"); // ---- Combobox ---- - py::class_, Widget> combobox( - m, "Combobox", "Exclusive selection from a pull-down menu"); + auto combobox = + static_cast, Widget>>( + m_gui.attr("Combobox")); combobox.def(py::init<>(), "Creates an empty combobox. Use add_item() to add items") .def("clear_items", &Combobox::ClearItems, "Removes all items") @@ -902,19 +1200,9 @@ void pybind_gui_classes(py::module &m) { "respectively"); // ---- RadioButton ---- - py::class_, Widget> radiobtn( - m, "RadioButton", "Exclusive selection from radio button list"); - py::enum_ radiobtn_type(radiobtn, "Type", - py::arithmetic()); - // Trick to write docs without listing the members in the enum class again. - radiobtn_type.attr("__doc__") = docstring::static_property( - py::cpp_function([](py::handle arg) -> std::string { - return "Enum class for RadioButton types."; - }), - py::none(), py::none(), ""); - radiobtn_type.value("VERT", RadioButton::Type::VERT) - .value("HORIZ", RadioButton::Type::HORIZ) - .export_values(); + auto radiobtn = static_cast< + py::class_, Widget>>( + m_gui.attr("RadioButton")); radiobtn.def(py::init(), "Creates an empty radio buttons. Use set_items() to add items") .def("set_items", &RadioButton::SetItems, @@ -930,95 +1218,8 @@ void pybind_gui_classes(py::module &m) { "Calls f(new_idx) when user changes selection"); // ---- ImageWidget ---- - class PyImageWidget : public ImageWidget { - using Super = ImageWidget; - - public: - PyImageWidget() : Super() {} - /// Uses image from the specified path. Each ImageWidget will use one - /// draw call. - explicit PyImageWidget(const char *image_path) : Super(image_path) {} - /// Uses existing image. Each ImageWidget will use one draw call. - explicit PyImageWidget(std::shared_ptr image) - : Super(image) {} - /// Uses existing image. Each ImageWidget will use one draw call. - explicit PyImageWidget( - std::shared_ptr image) - : Super(image) {} - /// Uses an existing texture, using texture coordinates - /// (u0, v0) to (u1, v1). Does not deallocate texture on destruction. - /// This is useful for using an icon atlas to reduce draw calls. - explicit PyImageWidget( - open3d::visualization::rendering::TextureHandle texture_id, - float u0 = 0.0f, - float v0 = 0.0f, - float u1 = 1.0f, - float v1 = 1.0f) - : Super(texture_id, u0, v0, u1, v1) {} - - ~PyImageWidget() = default; - - void SetOnMouse(std::function f) { - on_mouse_ = f; - } - void SetOnKey(std::function f) { on_key_ = f; } - - Widget::EventResult Mouse(const MouseEvent &e) override { - if (on_mouse_) { - switch (EventCallbackResult(on_mouse_(e))) { - case EventCallbackResult::CONSUMED: - return Widget::EventResult::CONSUMED; - case EventCallbackResult::HANDLED: { - auto result = Super::Mouse(e); - if (result == Widget::EventResult::IGNORED) { - result = Widget::EventResult::CONSUMED; - } - return result; - } - case EventCallbackResult::IGNORED: - default: - return Super::Mouse(e); - } - } else { - return Super::Mouse(e); - } - } - - Widget::EventResult Key(const KeyEvent &e) override { - if (on_key_) { - switch (EventCallbackResult(on_key_(e))) { - case EventCallbackResult::CONSUMED: - return Widget::EventResult::CONSUMED; - case EventCallbackResult::HANDLED: { - auto result = Super::Key(e); - if (result == Widget::EventResult::IGNORED) { - result = Widget::EventResult::CONSUMED; - } - return result; - } - case EventCallbackResult::IGNORED: - default: - return Super::Key(e); - } - } else { - return Super::Key(e); - } - } - - private: - std::function on_mouse_; - std::function on_key_; - }; - - py::class_> uiimage( - m, "UIImage", "A bitmap suitable for displaying with ImageWidget"); - - py::enum_ uiimage_scaling(uiimage, "Scaling", - py::arithmetic()); - uiimage_scaling.value("NONE", UIImage::Scaling::NONE) - .value("ANY", UIImage::Scaling::ANY) - .value("ASPECT", UIImage::Scaling::ASPECT); - + auto uiimage = static_cast>>( + m_gui.attr("UIImage")); uiimage.def(py::init<>([](const char *path) { return new UIImage(path); }), "Creates a UIImage from the image at the specified path") .def(py::init<>([](std::shared_ptr image) { @@ -1032,9 +1233,9 @@ void pybind_gui_classes(py::module &m) { "gui.UIImage.Scaling.ANY: scaled to fit\n" "gui.UIImage.Scaling.ASPECT: scaled to fit but " "keeping the image's aspect ratio"); - - py::class_, Widget> - imagewidget(m, "ImageWidget", "Displays a bitmap"); + auto imagewidget = static_cast< + py::class_, Widget>>( + m_gui.attr("ImageWidget")); imagewidget .def(py::init<>([]() { return new PyImageWidget(); }), "Creates an ImageWidget with no image") @@ -1099,8 +1300,8 @@ void pybind_gui_classes(py::module &m) { "as you will exhaust internal texture resources."); // ---- Label ---- - py::class_, Widget> label(m, "Label", - "Displays text"); + auto label = static_cast, Widget>>( + m_gui.attr("Label")); label.def(py::init([](const char *title = "") { return new Label(title); }), "Creates a Label with the given text") .def("__repr__", @@ -1123,8 +1324,8 @@ void pybind_gui_classes(py::module &m) { "Application.add_font()"); // ---- Label3D ---- - py::class_> label3d( - m, "Label3D", "Displays text in a 3D scene"); + auto label3d = static_cast>>( + m_gui.attr("Label3D")); label3d.def(py::init([](const char *text = "", const Eigen::Vector3f &pos = {0.f, 0.f, 0.f}) { return new Label3D(pos, text); @@ -1147,8 +1348,9 @@ void pybind_gui_classes(py::module &m) { "blurry text as the underlying font is not resized."); // ---- ListView ---- - py::class_, Widget> listview( - m, "ListView", "Displays a list of text"); + auto listview = + static_cast, Widget>>( + m_gui.attr("ListView")); listview.def(py::init<>(), "Creates an empty list") .def("__repr__", [](const ListView &lv) { @@ -1176,19 +1378,9 @@ void pybind_gui_classes(py::module &m) { "selection"); // ---- NumberEdit ---- - py::class_, Widget> numedit( - m, "NumberEdit", "Allows the user to enter a number."); - py::enum_ numedit_type(numedit, "Type", py::arithmetic()); - // Trick to write docs without listing the members in the enum class again. - numedit_type.attr("__doc__") = docstring::static_property( - py::cpp_function([](py::handle arg) -> std::string { - return "Enum class for NumberEdit types."; - }), - py::none(), py::none(), ""); - numedit_type.value("INT", NumberEdit::Type::INT) - .value("DOUBLE", NumberEdit::Type::DOUBLE) - .export_values(); - + auto numedit = static_cast< + py::class_, Widget>>( + m_gui.attr("NumberEdit")); numedit.def(py::init(), "Creates a NumberEdit that is either integers (INT) or " "floating point (DOUBLE). The initial value is 0 and the " @@ -1237,8 +1429,9 @@ void pybind_gui_classes(py::module &m) { "Sets the preferred width of the NumberEdit"); // ---- ProgressBar---- - py::class_, Widget> progress( - m, "ProgressBar", "Displays a progress bar"); + auto progress = static_cast< + py::class_, Widget>>( + m_gui.attr("ProgressBar")); progress.def(py::init<>()) .def("__repr__", [](const ProgressBar &pb) { @@ -1253,82 +1446,9 @@ void pybind_gui_classes(py::module &m) { "The value of the progress bar, ranges from 0.0 to 1.0"); // ---- SceneWidget ---- - class PySceneWidget : public SceneWidget { - using Super = SceneWidget; - - public: - void SetOnMouse(std::function f) { - on_mouse_ = f; - } - void SetOnKey(std::function f) { on_key_ = f; } - - Widget::EventResult Mouse(const MouseEvent &e) override { - if (on_mouse_) { - switch (EventCallbackResult(on_mouse_(e))) { - case EventCallbackResult::CONSUMED: - return Widget::EventResult::CONSUMED; - case EventCallbackResult::HANDLED: { - auto result = Super::Mouse(e); - if (result == Widget::EventResult::IGNORED) { - result = Widget::EventResult::CONSUMED; - } - return result; - } - case EventCallbackResult::IGNORED: - default: - return Super::Mouse(e); - } - } else { - return Super::Mouse(e); - } - } - - Widget::EventResult Key(const KeyEvent &e) override { - if (on_key_) { - switch (EventCallbackResult(on_key_(e))) { - case EventCallbackResult::CONSUMED: - return Widget::EventResult::CONSUMED; - case EventCallbackResult::HANDLED: { - auto result = Super::Key(e); - if (result == Widget::EventResult::IGNORED) { - result = Widget::EventResult::CONSUMED; - } - return result; - } - case EventCallbackResult::IGNORED: - default: - return Super::Key(e); - } - } else { - return Super::Key(e); - } - } - - private: - std::function on_mouse_; - std::function on_key_; - }; - - py::class_, Widget> scene( - m, "SceneWidget", "Displays 3D content"); - py::enum_ scene_ctrl(scene, "Controls", - py::arithmetic()); - // Trick to write docs without listing the members in the enum class again. - scene_ctrl.attr("__doc__") = docstring::static_property( - py::cpp_function([](py::handle arg) -> std::string { - return "Enum class describing mouse interaction."; - }), - py::none(), py::none(), ""); - scene_ctrl.value("ROTATE_CAMERA", SceneWidget::Controls::ROTATE_CAMERA) - .value("ROTATE_CAMERA_SPHERE", - SceneWidget::Controls::ROTATE_CAMERA_SPHERE) - .value("FLY", SceneWidget::Controls::FLY) - .value("ROTATE_SUN", SceneWidget::Controls::ROTATE_SUN) - .value("ROTATE_IBL", SceneWidget::Controls::ROTATE_IBL) - .value("ROTATE_MODEL", SceneWidget::Controls::ROTATE_MODEL) - .value("PICK_POINTS", SceneWidget::Controls::PICK_POINTS) - .export_values(); - + auto scene = static_cast< + py::class_, Widget>>( + m_gui.attr("SceneWidget")); scene.def(py::init<>(), "Creates an empty SceneWidget. Assign a Scene with the 'scene' " "property") @@ -1396,19 +1516,9 @@ void pybind_gui_classes(py::module &m) { "Removes the 3D text label from the scene"); // ---- Slider ---- - py::class_, Widget> slider( - m, "Slider", "A slider widget for visually selecting numbers"); - py::enum_ slider_type(slider, "Type", py::arithmetic()); - // Trick to write docs without listing the members in the enum class again. - slider_type.attr("__doc__") = docstring::static_property( - py::cpp_function([](py::handle arg) -> std::string { - return "Enum class for Slider types."; - }), - py::none(), py::none(), ""); - slider_type.value("INT", Slider::Type::INT) - .value("DOUBLE", Slider::Type::DOUBLE) - .export_values(); - + auto slider = + static_cast, Widget>>( + m_gui.attr("Slider")); slider.def(py::init(), "Creates a NumberEdit that is either integers (INT) or " "floating point (DOUBLE). The initial value is 0 and the limits " @@ -1445,16 +1555,18 @@ void pybind_gui_classes(py::module &m) { "changes widget's value"); // ---- StackedWidget ---- - py::class_, Widget> stacked( - m, "StackedWidget", "Like a TabControl but without the tabs"); + auto stacked = static_cast< + py::class_, Widget>>( + m_gui.attr("StackedWidget")); stacked.def(py::init<>()) .def_property("selected_index", &StackedWidget::GetSelectedIndex, &StackedWidget::SetSelectedIndex, "Selects the index of the child to display"); // ---- TabControl ---- - py::class_, Widget> tabctrl( - m, "TabControl", "Tab control"); + auto tabctrl = static_cast< + py::class_, Widget>>( + m_gui.attr("TabControl")); tabctrl.def(py::init<>()) .def( "add_tab", @@ -1476,8 +1588,9 @@ void pybind_gui_classes(py::module &m) { "different tab"); // ---- TextEdit ---- - py::class_, Widget> textedit( - m, "TextEdit", "Allows the user to enter or modify text"); + auto textedit = + static_cast, Widget>>( + m_gui.attr("TextEdit")); textedit.def(py::init<>(), "Creates a TextEdit widget with an initial value of an empty " "string.") @@ -1504,8 +1617,9 @@ void pybind_gui_classes(py::module &m) { "user completes text editing"); // ---- ToggleSwitch ---- - py::class_, Widget> toggle( - m, "ToggleSwitch", "ToggleSwitch"); + auto toggle = static_cast< + py::class_, Widget>>( + m_gui.attr("ToggleSwitch")); toggle.def(py::init(), "Creates a toggle switch with the given text") .def("__repr__", @@ -1523,8 +1637,9 @@ void pybind_gui_classes(py::module &m) { "state."); // ---- TreeView ---- - py::class_, Widget> treeview( - m, "TreeView", "Hierarchical list"); + auto treeview = + static_cast, Widget>>( + m_gui.attr("TreeView")); treeview.def(py::init<>(), "Creates an empty TreeView widget") .def("__repr__", [](const TreeView &tv) { @@ -1572,10 +1687,10 @@ void pybind_gui_classes(py::module &m) { "changes the selection."); // ---- TreeView cells ---- - py::class_, - Widget> - checkable_cell(m, "CheckableTextTreeCell", - "TreeView cell with a checkbox and text"); + auto checkable_cell = static_cast< + py::class_, Widget>>( + m_gui.attr("CheckableTextTreeCell")); checkable_cell .def(py::init<>([](const char *text, bool checked, std::function on_toggled) { @@ -1592,10 +1707,9 @@ void pybind_gui_classes(py::module &m) { .def_property_readonly("label", &CheckableTextTreeCell::GetLabel, "Returns the label widget " "(property is read-only)"); - - py::class_, Widget> lut_cell( - m, "LUTTreeCell", - "TreeView cell with checkbox, text, and color edit"); + auto lut_cell = static_cast< + py::class_, Widget>>( + m_gui.attr("LUTTreeCell")); lut_cell.def(py::init<>([](const char *text, bool checked, const Color &color, std::function on_enabled, @@ -1618,10 +1732,10 @@ void pybind_gui_classes(py::module &m) { .def_property_readonly("color_edit", &LUTTreeCell::GetColorEdit, "Returns the ColorEdit widget " "(property is read-only)"); - - py::class_, Widget> - colormap_cell(m, "ColormapTreeCell", - "TreeView cell with a number edit and color edit"); + auto colormap_cell = + static_cast, Widget>>( + m_gui.attr("ColormapTreeCell")); colormap_cell .def(py::init<>([](float value, const Color &color, std::function on_value_changed, @@ -1645,8 +1759,9 @@ void pybind_gui_classes(py::module &m) { "(property is read-only)"); // ---- VectorEdit ---- - py::class_, Widget> vectoredit( - m, "VectorEdit", "Allows the user to edit a 3-space vector"); + auto vectoredit = static_cast< + py::class_, Widget>>( + m_gui.attr("VectorEdit")); vectoredit.def(py::init<>()) .def("__repr__", [](const VectorEdit &ve) { @@ -1665,8 +1780,8 @@ void pybind_gui_classes(py::module &m) { "changes the value of a component"); // ---- Margins ---- - py::class_> margins(m, "Margins", - "Margins for layouts"); + auto margins = static_cast>>( + m_gui.attr("Margins")); margins.def(py::init([](int left, int top, int right, int bottom) { return new Margins(left, top, right, bottom); }), @@ -1695,11 +1810,24 @@ void pybind_gui_classes(py::module &m) { .def_readwrite("right", &Margins::right) .def_readwrite("bottom", &Margins::bottom) .def("get_horiz", &Margins::GetHoriz) - .def("get_vert", &Margins::GetVert); + .def("get_vert", &Margins::GetVert) + .def("__repr__", [](const Margins &m) -> std::string { + if (m.left == 0 && m.top == 0 && m.right == 0 && m.bottom == 0) + return "Margins()"; + else if (m.left == m.top && m.top == m.right && + m.right == m.bottom) + return fmt::format("Margins({})", m.left); + else if (m.left == m.right && m.top == m.bottom) + return fmt::format("Margins({}, {})", m.left, m.top); + else + return fmt::format("Margins({}, {}, {}, {})", m.left, m.top, + m.right, m.bottom); + }); // ---- Layout1D ---- - py::class_, Widget> layout1d( - m, "Layout1D", "Layout base class"); + auto layout1d = + static_cast, Widget>>( + m_gui.attr("Layout1D")); layout1d // TODO: write the proper constructor // .def(py::init([]() { return new Layout1D(Layout1D::VERT, @@ -1717,8 +1845,9 @@ void pybind_gui_classes(py::module &m) { "extra space as there is available in the layout"); // ---- Vert ---- - py::class_, Layout1D> vlayout(m, "Vert", - "Vertical layout"); + auto vlayout = + static_cast, Layout1D>>( + m_gui.attr("Vert")); vlayout.def(py::init([](int spacing, const Margins &margins) { return new Vert(spacing, margins); }), @@ -1740,10 +1869,9 @@ void pybind_gui_classes(py::module &m) { "Sets the preferred width of the layout"); // ---- CollapsableVert ---- - py::class_, Vert> - collapsable(m, "CollapsableVert", - "Vertical layout with title, whose contents are " - "collapsable"); + auto collapsable = static_cast< + py::class_, Vert>>( + m_gui.attr("CollapsableVert")); collapsable .def(py::init([](const char *text, int spacing, const Margins &margins) { @@ -1772,14 +1900,19 @@ void pybind_gui_classes(py::module &m) { "window is visible") .def("get_is_open", &CollapsableVert::GetIsOpen, "Check if widget is open.") + .def("set_text", &CollapsableVert::SetText, "text"_a, + "Sets the text for the CollapsableVert") + .def("get_text", &CollapsableVert::GetText, + "Gets the text for the CollapsableVert") .def_property("font_id", &CollapsableVert::GetFontId, &CollapsableVert::SetFontId, "Set the font using the FontId returned from " "Application.add_font()"); // ---- ScrollableVert ---- - py::class_, Vert> slayout( - m, "ScrollableVert", "Scrollable vertical layout"); + auto slayout = static_cast< + py::class_, Vert>>( + m_gui.attr("ScrollableVert")); slayout.def(py::init([](int spacing, const Margins &margins) { return new ScrollableVert(spacing, margins); }), @@ -1799,8 +1932,9 @@ void pybind_gui_classes(py::module &m) { "is the margins. Both default to 0."); // ---- Horiz ---- - py::class_, Layout1D> hlayout( - m, "Horiz", "Horizontal layout"); + auto hlayout = + static_cast, Layout1D>>( + m_gui.attr("Horiz")); hlayout.def(py::init([](int spacing, const Margins &margins) { return new Horiz(spacing, margins); }), @@ -1824,8 +1958,8 @@ void pybind_gui_classes(py::module &m) { "Sets the preferred height of the layout"); // ---- VGrid ---- - py::class_, Widget> vgrid(m, "VGrid", - "Grid layout"); + auto vgrid = static_cast, Widget>>( + m_gui.attr("VGrid")); vgrid.def(py::init([](int n_cols, int spacing, const Margins &margins) { return new VGrid(n_cols, spacing, margins); }), @@ -1859,25 +1993,16 @@ void pybind_gui_classes(py::module &m) { "Sets the preferred width of the layout"); // ---- Dialog ---- - py::class_, Widget> dialog(m, "Dialog", - "Dialog"); + auto dialog = + static_cast, Widget>>( + m_gui.attr("Dialog")); dialog.def(py::init(), "Creates a dialog with the given title"); // ---- FileDialog ---- - py::class_, Dialog> filedlg( - m, "FileDialog", "File picker dialog"); - py::enum_ filedlg_mode(filedlg, "Mode", py::arithmetic()); - // Trick to write docs without listing the members in the enum class again. - filedlg_mode.attr("__doc__") = docstring::static_property( - py::cpp_function([](py::handle arg) -> std::string { - return "Enum class for FileDialog modes."; - }), - py::none(), py::none(), ""); - filedlg_mode.value("OPEN", FileDialog::Mode::OPEN) - .value("SAVE", FileDialog::Mode::SAVE) - .value("OPEN_DIR", FileDialog::Mode::OPEN_DIR) - .export_values(); + auto filedlg = static_cast< + py::class_, Dialog>>( + m_gui.attr("FileDialog")); filedlg.def(py::init(), "Creates either an open or save file dialog. The first " "parameter is either FileDialog.OPEN or FileDialog.SAVE. The " @@ -1896,12 +2021,6 @@ void pybind_gui_classes(py::module &m) { "Done callback; required"); } -void pybind_gui(py::module &m) { - py::module m_gui = m.def_submodule("gui"); - pybind_gui_events(m_gui); - pybind_gui_classes(m_gui); -} - } // namespace gui } // namespace visualization } // namespace open3d diff --git a/cpp/pybind/visualization/gui/gui.h b/cpp/pybind/visualization/gui/gui.h index 7e5a7972c26..45cb8b4a62e 100644 --- a/cpp/pybind/visualization/gui/gui.h +++ b/cpp/pybind/visualization/gui/gui.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -30,10 +30,11 @@ std::shared_ptr RenderToDepthImageWithoutWindow( int height, bool z_in_view_space = false); -void pybind_gui(py::module &m); +void pybind_gui_declarations(py::module &m); +void pybind_gui_definitions(py::module &m); -void pybind_gui_events(py::module &m); -void pybind_gui_classes(py::module &m); +void pybind_gui_events_declarations(py::module &m); +void pybind_gui_events_definitions(py::module &m); } // namespace gui } // namespace visualization diff --git a/cpp/pybind/visualization/o3dvisualizer.cpp b/cpp/pybind/visualization/o3dvisualizer.cpp index a97d108f918..89a09b73203 100644 --- a/cpp/pybind/visualization/o3dvisualizer.cpp +++ b/cpp/pybind/visualization/o3dvisualizer.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -21,32 +21,10 @@ namespace visualization { using namespace visualizer; -void pybind_o3dvisualizer(py::module& m) { +void pybind_o3dvisualizer_declarations(py::module& m) { py::class_ selected_index( m, "SelectedIndex", "Information about a point or vertex that was selected"); - selected_index - .def("__repr__", - [](const O3DVisualizerSelections::SelectedIndex& idx) { - std::stringstream s; - s << "{ index: " << idx.index << ", order: " << idx.order - << ", point: (" << idx.point.x() << ", " << idx.point.y() - << ", " << idx.point.z() << ") }"; - return s.str(); - }) - .def_readonly("index", - &O3DVisualizerSelections::SelectedIndex::index, - "The index of this point in the point/vertex " - "array") - .def_readonly("order", - &O3DVisualizerSelections::SelectedIndex::order, - "A monotonically increasing value that can be " - "used to determine in what order the points " - "were selected") - .def_readonly("point", - &O3DVisualizerSelections::SelectedIndex::point, - "The (x, y, z) value of this point"); - py::class_, gui::Window> o3dvis(m, "O3DVisualizer", "Visualization object used by draw()"); @@ -75,6 +53,37 @@ void pybind_o3dvisualizer(py::module& m) { o3dvis, "DrawObject", "Information about an object that is drawn. Do not modify this, it " "can lead to unexpected results."); +} +void pybind_o3dvisualizer_definitions(py::module& m) { + auto selected_index = + static_cast>( + m.attr("SelectedIndex")); + selected_index + .def("__repr__", + [](const O3DVisualizerSelections::SelectedIndex& idx) { + std::stringstream s; + s << "{ index: " << idx.index << ", order: " << idx.order + << ", point: (" << idx.point.x() << ", " << idx.point.y() + << ", " << idx.point.z() << ") }"; + return s.str(); + }) + .def_readonly("index", + &O3DVisualizerSelections::SelectedIndex::index, + "The index of this point in the point/vertex " + "array") + .def_readonly("order", + &O3DVisualizerSelections::SelectedIndex::order, + "A monotonically increasing value that can be " + "used to determine in what order the points " + "were selected") + .def_readonly("point", + &O3DVisualizerSelections::SelectedIndex::point, + "The (x, y, z) value of this point"); + auto o3dvis = + static_cast, + gui::Window>>(m.attr("O3DVisualizer")); + auto drawobj = static_cast>( + o3dvis.attr("DrawObject")); drawobj.def_readonly("name", &O3DVisualizer::DrawObject::name, "The name of the object") .def_property_readonly( @@ -344,6 +353,9 @@ void pybind_o3dvisualizer(py::module& m) { "enable"_a) .def("show_skybox", &O3DVisualizer::ShowSkybox, "Show/Hide the skybox", "show"_a) + .def("set_panel_open", &O3DVisualizer::SetPanelOpen, + "Expand/Collapse verts(panels) within the settings panel", + "name"_a, "open"_a) .def_property( "show_settings", [](const O3DVisualizer& dv) { diff --git a/cpp/pybind/visualization/rendering/material.cpp b/cpp/pybind/visualization/rendering/material.cpp index 3e109dcdbb3..004c9590574 100644 --- a/cpp/pybind/visualization/rendering/material.cpp +++ b/cpp/pybind/visualization/rendering/material.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -27,18 +27,20 @@ namespace open3d { namespace visualization { namespace rendering { -void pybind_material(py::module& m) { +void pybind_material_declarations(py::module& m) { py::bind_map>( m, "TextureMaps"); py::bind_map>(m, "ScalarProperties"); py::bind_map(m, "VectorProperties"); - py::class_> mat( m, "Material", "Properties (texture maps, scalar and vector) related to " "visualization. Materials are optionally set for 3D geometries " "such as TriangleMesh, LineSets, and PointClouds"); - +} +void pybind_material_definitions(py::module& m) { + auto mat = static_cast>>( + m.attr("Material")); mat.def(py::init<>()) .def(py::init(), "", "mat"_a) .def(py::init(), "", "material_name"_a) diff --git a/cpp/pybind/visualization/rendering/material.h b/cpp/pybind/visualization/rendering/material.h index dd9e7404759..a15e9fa33f4 100644 --- a/cpp/pybind/visualization/rendering/material.h +++ b/cpp/pybind/visualization/rendering/material.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -13,8 +13,9 @@ namespace open3d { namespace visualization { namespace rendering { -void pybind_material(py::module &m); +void pybind_material_declarations(py::module &m); +void pybind_material_definitions(py::module &m); -} +} // namespace rendering } // namespace visualization } // namespace open3d diff --git a/cpp/pybind/visualization/rendering/rendering.cpp b/cpp/pybind/visualization/rendering/rendering.cpp index b243531d859..513a0f09934 100644 --- a/cpp/pybind/visualization/rendering/rendering.cpp +++ b/cpp/pybind/visualization/rendering/rendering.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -109,10 +109,126 @@ class PyOffscreenRenderer { Open3DScene *scene_; }; -void pybind_rendering_classes(py::module &m) { +void pybind_rendering_declarations(py::module &m) { + py::module m_rendering = m.def_submodule("rendering"); + py::class_ texture_handle(m_rendering, "TextureHandle", + "Handle to a texture"); py::class_ renderer( - m, "Renderer", + m_rendering, "Renderer", "Renderer class that manages 3D resources. Get from gui.Window."); + // It would be nice to have this inherit from Renderer, but the problem is + // that Python needs to own this class and Python needs to not own Renderer, + // and pybind does not let us mix the two styles of ownership. + py::class_> + offscreen(m_rendering, "OffscreenRenderer", + "Renderer instance that can be used for rendering to an " + "image"); + py::class_> cam(m_rendering, "Camera", + "Camera object"); + py::enum_ fov_type(cam, "FovType", py::arithmetic(), + "Enum class for Camera field of view " + "types."); + fov_type.value("Vertical", Camera::FovType::Vertical) + .value("Horizontal", Camera::FovType::Horizontal) + .export_values(); + + py::enum_ proj_type(cam, "Projection", py::arithmetic(), + "Enum class for Camera projection " + "types."); + proj_type.value("Perspective", Camera::Projection::Perspective) + .value("Ortho", Camera::Projection::Ortho) + .export_values(); + py::class_> gradient( + m_rendering, "Gradient", + "Manages a gradient for the unlitGradient shader." + "In gradient mode, the array of points specifies points along " + "the gradient, from 0 to 1 (inclusive). These do need to be " + "evenly spaced." + "Simple greyscale:" + " [ ( 0.0, black )," + " ( 1.0, white ) ]" + "Rainbow (note the gaps around green):" + " [ ( 0.000, blue )," + " ( 0.125, cornflower blue )," + " ( 0.250, cyan )," + " ( 0.500, green )," + " ( 0.750, yellow )," + " ( 0.875, orange )," + " ( 1.000, red ) ]" + "The gradient will generate a largish texture, so it should " + "be fairly smooth, but the boundaries may not be exactly as " + "specified due to quantization imposed by the fixed size of " + "the texture." + " The points *must* be sorted from the smallest value to the " + "largest. The values must be in the range [0, 1]."); + py::enum_ gradient_mode(gradient, "Mode", py::arithmetic()); + gradient_mode.value("GRADIENT", Gradient::Mode::kGradient) + .value("LUT", Gradient::Mode::kLUT) + .export_values(); + py::class_ gpt(gradient, "Point"); + py::class_ mat( + m_rendering, "MaterialRecord", + "Describes the real-world, physically based (PBR) " + "material used to render a geometry"); + py::class_> tri_model( + m_rendering, "TriangleMeshModel", + "A list of geometry.TriangleMesh and Material that can describe a " + "complex model with multiple meshes, such as might be stored in an " + "FBX, OBJ, or GLTF file"); + py::class_ tri_model_info(tri_model, + "MeshInfo", ""); + py::class_ color_grading( + m_rendering, "ColorGrading", + "Parameters to control color grading options"); + py::enum_ cgp_quality( + color_grading, "Quality", + "Quality level of color grading operations"); + cgp_quality.value("LOW", ColorGradingParams::Quality::kLow) + .value("MEDIUM", ColorGradingParams::Quality::kMedium) + .value("HIGH", ColorGradingParams::Quality::kHigh) + .value("ULTRA", ColorGradingParams::Quality::kUltra); + py::enum_ cgp_tone( + color_grading, "ToneMapping", + "Specifies the tone-mapping algorithm"); + cgp_tone.value("LINEAR", ColorGradingParams::ToneMapping::kLinear) + .value("ACES_LEGACY", ColorGradingParams::ToneMapping::kAcesLegacy) + .value("ACES", ColorGradingParams::ToneMapping::kAces) + .value("FILMIC", ColorGradingParams::ToneMapping::kFilmic) + .value("UCHIMURA", ColorGradingParams::ToneMapping::kUchimura) + .value("REINHARD", ColorGradingParams::ToneMapping::kReinhard) + .value("DISPLAY_RANGE", + ColorGradingParams::ToneMapping::kDisplayRange); + py::class_> view(m_rendering, "View", + "Low-level view class"); + py::enum_ shadow_type( + view, "ShadowType", "Available shadow mapping algorithm options"); + shadow_type.value("PCF", View::ShadowType::kPCF) + .value("VSM", View::ShadowType::kVSM); + py::class_> scene(m_rendering, "Scene", + "Low-level rendering scene"); + py::enum_ ground_plane( + scene, "GroundPlane", py::arithmetic(), + "Plane on which to show ground plane: XZ, XY, or YZ"); + ground_plane.value("XZ", Scene::GroundPlane::XZ) + .value("XY", Scene::GroundPlane::XY) + .value("YZ", Scene::GroundPlane::YZ) + .export_values(); + py::class_> o3dscene( + m_rendering, "Open3DScene", "High-level scene for rending"); + py::enum_ lighting( + o3dscene, "LightingProfile", py::arithmetic(), + "Enum for conveniently setting lighting"); + lighting.value("HARD_SHADOWS", Open3DScene::LightingProfile::HARD_SHADOWS) + .value("DARK_SHADOWS", Open3DScene::LightingProfile::DARK_SHADOWS) + .value("MED_SHADOWS", Open3DScene::LightingProfile::MED_SHADOWS) + .value("SOFT_SHADOWS", Open3DScene::LightingProfile::SOFT_SHADOWS) + .value("NO_SHADOWS", Open3DScene::LightingProfile::NO_SHADOWS) + .export_values(); +} +void pybind_rendering_definitions(py::module &m) { + auto m_rendering = static_cast(m.attr("rendering")); + auto renderer = + static_cast>(m_rendering.attr("Renderer")); renderer.def("set_clear_color", &Renderer::SetClearColor, "Sets the background color for the renderer, [r, g, b, a]. " "Applies to everything being rendered, so it essentially acts " @@ -143,14 +259,10 @@ void pybind_rendering_classes(py::module &m) { "Deletes the texture. This does not remove the texture from " "any existing materials or GUI widgets, and must be done " "prior to this call."); - - // It would be nice to have this inherit from Renderer, but the problem is - // that Python needs to own this class and Python needs to not own Renderer, - // and pybind does not let us mix the two styles of ownership. - py::class_> - offscreen(m, "OffscreenRenderer", - "Renderer instance that can be used for rendering to an " - "image"); + auto offscreen = + static_cast>>( + m_rendering.attr("OffscreenRenderer")); offscreen .def(py::init([](int w, int h, const std::string &resource_path) { return std::make_shared( @@ -201,22 +313,8 @@ void pybind_rendering_classes(py::module &m) { "camera)."); // ---- Camera ---- - py::class_> cam(m, "Camera", - "Camera object"); - py::enum_ fov_type(cam, "FovType", py::arithmetic(), - "Enum class for Camera field of view " - "types."); - fov_type.value("Vertical", Camera::FovType::Vertical) - .value("Horizontal", Camera::FovType::Horizontal) - .export_values(); - - py::enum_ proj_type(cam, "Projection", py::arithmetic(), - "Enum class for Camera projection " - "types."); - proj_type.value("Perspective", Camera::Projection::Perspective) - .value("Ortho", Camera::Projection::Ortho) - .export_values(); - + auto cam = static_cast>>( + m_rendering.attr("Camera")); cam.def("set_projection", (void (Camera::*)(double, double, double, double, Camera::FovType)) & @@ -279,34 +377,10 @@ void pybind_rendering_classes(py::module &m) { "Returns the model matrix of the camera"); // ---- Gradient ---- - py::class_> gradient( - m, "Gradient", - "Manages a gradient for the unlitGradient shader." - "In gradient mode, the array of points specifies points along " - "the gradient, from 0 to 1 (inclusive). These do need to be " - "evenly spaced." - "Simple greyscale:" - " [ ( 0.0, black )," - " ( 1.0, white ) ]" - "Rainbow (note the gaps around green):" - " [ ( 0.000, blue )," - " ( 0.125, cornflower blue )," - " ( 0.250, cyan )," - " ( 0.500, green )," - " ( 0.750, yellow )," - " ( 0.875, orange )," - " ( 1.000, red ) ]" - "The gradient will generate a largish texture, so it should " - "be fairly smooth, but the boundaries may not be exactly as " - "specified due to quantization imposed by the fixed size of " - "the texture." - " The points *must* be sorted from the smallest value to the " - "largest. The values must be in the range [0, 1]."); - py::enum_ gradient_mode(gradient, "Mode", py::arithmetic()); - gradient_mode.value("GRADIENT", Gradient::Mode::kGradient) - .value("LUT", Gradient::Mode::kLUT) - .export_values(); - py::class_ gpt(gradient, "Point"); + auto gradient = + static_cast>>( + m_rendering.attr("Gradient")); + auto gpt = static_cast>(gradient.attr("Point")); gpt.def(py::init()) .def("__repr__", [](const Gradient::Point &p) { @@ -326,10 +400,8 @@ void pybind_rendering_classes(py::module &m) { .def_property("mode", &Gradient::GetMode, &Gradient::SetMode); // ---- Material ---- - py::class_ mat( - m, "MaterialRecord", - "Describes the real-world, physically based (PBR) " - "material used to render a geometry"); + auto mat = static_cast>( + m_rendering.attr("MaterialRecord")); mat.def(py::init<>()) .def_readwrite("has_alpha", &MaterialRecord::has_alpha) .def_readwrite("base_color", &MaterialRecord::base_color) @@ -375,13 +447,11 @@ void pybind_rendering_classes(py::module &m) { .def_readwrite("shader", &MaterialRecord::shader); // ---- TriangleMeshModel ---- - py::class_> tri_model( - m, "TriangleMeshModel", - "A list of geometry.TriangleMesh and Material that can describe a " - "complex model with multiple meshes, such as might be stored in an " - "FBX, OBJ, or GLTF file"); - py::class_ tri_model_info(tri_model, - "MeshInfo", ""); + auto tri_model = static_cast< + py::class_>>( + m_rendering.attr("TriangleMeshModel")); + auto tri_model_info = static_cast>( + tri_model.attr("MeshInfo")); tri_model_info .def(py::init([](std::shared_ptr mesh, const std::string &name, @@ -397,29 +467,8 @@ void pybind_rendering_classes(py::module &m) { .def_readwrite("materials", &TriangleMeshModel::materials_); // ---- ColorGradingParams --- - py::class_ color_grading( - m, "ColorGrading", "Parameters to control color grading options"); - - py::enum_ cgp_quality( - color_grading, "Quality", - "Quality level of color grading operations"); - cgp_quality.value("LOW", ColorGradingParams::Quality::kLow) - .value("MEDIUM", ColorGradingParams::Quality::kMedium) - .value("HIGH", ColorGradingParams::Quality::kHigh) - .value("ULTRA", ColorGradingParams::Quality::kUltra); - - py::enum_ cgp_tone( - color_grading, "ToneMapping", - "Specifies the tone-mapping algorithm"); - cgp_tone.value("LINEAR", ColorGradingParams::ToneMapping::kLinear) - .value("ACES_LEGACY", ColorGradingParams::ToneMapping::kAcesLegacy) - .value("ACES", ColorGradingParams::ToneMapping::kAces) - .value("FILMIC", ColorGradingParams::ToneMapping::kFilmic) - .value("UCHIMURA", ColorGradingParams::ToneMapping::kUchimura) - .value("REINHARD", ColorGradingParams::ToneMapping::kReinhard) - .value("DISPLAY_RANGE", - ColorGradingParams::ToneMapping::kDisplayRange); - + auto color_grading = static_cast>( + m_rendering.attr("ColorGrading")); color_grading .def(py::init([](ColorGradingParams::Quality q, ColorGradingParams::ToneMapping algorithm) { @@ -443,14 +492,8 @@ void pybind_rendering_classes(py::module &m) { "Tint on the green/magenta axis. Ranges from -1.0 to 1.0."); // ---- View ---- - py::class_> view(m, "View", - "Low-level view class"); - // ---- Shadow Types ---- - py::enum_ shadow_type( - view, "ShadowType", "Available shadow mapping algorithm options"); - shadow_type.value("PCF", View::ShadowType::kPCF) - .value("VSM", View::ShadowType::kVSM); - + auto view = static_cast>>( + m_rendering.attr("View")); view.def("set_color_grading", &View::SetColorGrading, "Sets the parameters to be used for the color grading algorithms") .def("set_post_processing", &View::SetPostProcessing, @@ -473,7 +516,9 @@ void pybind_rendering_classes(py::module &m) { "Typical values are 2, 4 or 8. The maximum possible value " "depends on the underlying GPU and OpenGL driver.") .def("set_shadowing", &View::SetShadowing, "enabled"_a, - "type"_a = View::ShadowType::kPCF, + py::arg_v( + "type", View::ShadowType::kPCF, + "open3d.visualization.rendering.View.ShadowType.PCF"), "True to enable, false to enable all shadow mapping when " "rendering this View. When enabling shadow mapping you may " "also specify one of two shadow mapping algorithms: PCF " @@ -483,15 +528,8 @@ void pybind_rendering_classes(py::module &m) { "Returns the Camera associated with this View."); // ---- Scene ---- - py::class_> scene(m, "Scene", - "Low-level rendering scene"); - py::enum_ ground_plane( - scene, "GroundPlane", py::arithmetic(), - "Plane on which to show ground plane: XZ, XY, or YZ"); - ground_plane.value("XZ", Scene::GroundPlane::XZ) - .value("XY", Scene::GroundPlane::XY) - .value("YZ", Scene::GroundPlane::YZ) - .export_values(); + auto scene = static_cast>>( + m_rendering.attr("Scene")); scene.def("add_camera", &Scene::AddCamera, "name"_a, "camera"_a, "Adds a camera to the scene") .def("remove_camera", &Scene::RemoveCamera, "name"_a, @@ -606,18 +644,9 @@ void pybind_rendering_classes(py::module &m) { scene.attr("UPDATE_UV0_FLAG") = py::int_(Scene::kUpdateUv0Flag); // ---- Open3DScene ---- - py::class_> o3dscene( - m, "Open3DScene", "High-level scene for rending"); - py::enum_ lighting( - o3dscene, "LightingProfile", py::arithmetic(), - "Enum for conveniently setting lighting"); - lighting.value("HARD_SHADOWS", Open3DScene::LightingProfile::HARD_SHADOWS) - .value("DARK_SHADOWS", Open3DScene::LightingProfile::DARK_SHADOWS) - .value("MED_SHADOWS", Open3DScene::LightingProfile::MED_SHADOWS) - .value("SOFT_SHADOWS", Open3DScene::LightingProfile::SOFT_SHADOWS) - .value("NO_SHADOWS", Open3DScene::LightingProfile::NO_SHADOWS) - .export_values(); - + auto o3dscene = + static_cast>>( + m_rendering.attr("Open3DScene")); o3dscene.def(py::init()) .def("show_skybox", &Open3DScene::ShowSkybox, "enable"_a, "Toggles display of the skybox") @@ -715,11 +744,6 @@ void pybind_rendering_classes(py::module &m) { "is important"); } -void pybind_rendering(py::module &m) { - py::module m_rendering = m.def_submodule("rendering"); - pybind_rendering_classes(m_rendering); -} - } // namespace rendering } // namespace visualization } // namespace open3d diff --git a/cpp/pybind/visualization/rendering/rendering.h b/cpp/pybind/visualization/rendering/rendering.h index 007ba2fbce2..c432bb20975 100644 --- a/cpp/pybind/visualization/rendering/rendering.h +++ b/cpp/pybind/visualization/rendering/rendering.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -13,8 +13,9 @@ namespace open3d { namespace visualization { namespace rendering { -void pybind_rendering(py::module &m); +void pybind_rendering_declarations(py::module &m); +void pybind_rendering_definitions(py::module &m); -} +} // namespace rendering } // namespace visualization } // namespace open3d diff --git a/cpp/pybind/visualization/renderoption.cpp b/cpp/pybind/visualization/renderoption.cpp index 903e2db6135..5e66621e358 100644 --- a/cpp/pybind/visualization/renderoption.cpp +++ b/cpp/pybind/visualization/renderoption.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -15,10 +15,63 @@ namespace open3d { namespace visualization { -void pybind_renderoption(py::module &m) { - // open3d.visualization.RenderOption +void pybind_renderoption_declarations(py::module &m) { py::class_> renderoption( m, "RenderOption", "Defines rendering options for visualizer."); + // This is a nested class, but now it's bind to the module + // o3d.visualization.PointColorOption + py::enum_ enum_point_color_option( + m, "PointColorOption", py::arithmetic(), "PointColorOption"); + enum_point_color_option.attr("__doc__") = docstring::static_property( + py::cpp_function([](py::handle arg) -> std::string { + return "Enum class for point color for ``PointCloud``."; + }), + py::none(), py::none(), ""); + enum_point_color_option + .value("Default", RenderOption::PointColorOption::Default) + .value("Color", RenderOption::PointColorOption::Color) + .value("XCoordinate", RenderOption::PointColorOption::XCoordinate) + .value("YCoordinate", RenderOption::PointColorOption::YCoordinate) + .value("ZCoordinate", RenderOption::PointColorOption::ZCoordinate) + .value("Normal", RenderOption::PointColorOption::Normal) + .export_values(); + // This is a nested class, but now it's bind to the module + // o3d.visualization.MeshShadeOption + py::enum_ enum_mesh_shade_option( + m, "MeshShadeOption", py::arithmetic(), "MeshShadeOption"); + enum_mesh_shade_option.attr("__doc__") = docstring::static_property( + py::cpp_function([](py::handle arg) -> std::string { + return "Enum class for mesh shading for ``TriangleMesh``."; + }), + py::none(), py::none(), ""); + enum_mesh_shade_option + .value("Default", RenderOption::MeshShadeOption::FlatShade) + .value("Color", RenderOption::MeshShadeOption::SmoothShade) + .export_values(); + + // This is a nested class, but now it's bind to the module + // o3d.visualization.MeshColorOption + py::enum_ enum_mesh_clor_option( + m, "MeshColorOption", py::arithmetic(), "MeshColorOption"); + enum_mesh_clor_option.attr("__doc__") = docstring::static_property( + py::cpp_function([](py::handle arg) -> std::string { + return "Enum class for color for ``TriangleMesh``."; + }), + py::none(), py::none(), ""); + enum_mesh_clor_option + .value("Default", RenderOption::MeshColorOption::Default) + .value("Color", RenderOption::MeshColorOption::Color) + .value("XCoordinate", RenderOption::MeshColorOption::XCoordinate) + .value("YCoordinate", RenderOption::MeshColorOption::YCoordinate) + .value("ZCoordinate", RenderOption::MeshColorOption::ZCoordinate) + .value("Normal", RenderOption::MeshColorOption::Normal) + .export_values(); +} +void pybind_renderoption_definitions(py::module &m) { + // open3d.visualization.RenderOption + auto renderoption = static_cast< + py::class_>>( + m.attr("RenderOption")); py::detail::bind_default_constructor(renderoption); renderoption .def("__repr__", @@ -77,59 +130,7 @@ void pybind_renderoption(py::module &m) { {{"filename", "Path to file."}}); docstring::ClassMethodDocInject(m, "RenderOption", "save_to_json", {{"filename", "Path to file."}}); - - // This is a nested class, but now it's bind to the module - // o3d.visualization.PointColorOption - py::enum_ enum_point_color_option( - m, "PointColorOption", py::arithmetic(), "PointColorOption"); - enum_point_color_option.attr("__doc__") = docstring::static_property( - py::cpp_function([](py::handle arg) -> std::string { - return "Enum class for point color for ``PointCloud``."; - }), - py::none(), py::none(), ""); - enum_point_color_option - .value("Default", RenderOption::PointColorOption::Default) - .value("Color", RenderOption::PointColorOption::Color) - .value("XCoordinate", RenderOption::PointColorOption::XCoordinate) - .value("YCoordinate", RenderOption::PointColorOption::YCoordinate) - .value("ZCoordinate", RenderOption::PointColorOption::ZCoordinate) - .value("Normal", RenderOption::PointColorOption::Normal) - .export_values(); - - // This is a nested class, but now it's bind to the module - // o3d.visualization.MeshShadeOption - py::enum_ enum_mesh_shade_option( - m, "MeshShadeOption", py::arithmetic(), "MeshShadeOption"); - enum_mesh_shade_option.attr("__doc__") = docstring::static_property( - py::cpp_function([](py::handle arg) -> std::string { - return "Enum class for mesh shading for ``TriangleMesh``."; - }), - py::none(), py::none(), ""); - enum_mesh_shade_option - .value("Default", RenderOption::MeshShadeOption::FlatShade) - .value("Color", RenderOption::MeshShadeOption::SmoothShade) - .export_values(); - - // This is a nested class, but now it's bind to the module - // o3d.visualization.MeshColorOption - py::enum_ enum_mesh_clor_option( - m, "MeshColorOption", py::arithmetic(), "MeshColorOption"); - enum_mesh_clor_option.attr("__doc__") = docstring::static_property( - py::cpp_function([](py::handle arg) -> std::string { - return "Enum class for color for ``TriangleMesh``."; - }), - py::none(), py::none(), ""); - enum_mesh_clor_option - .value("Default", RenderOption::MeshColorOption::Default) - .value("Color", RenderOption::MeshColorOption::Color) - .value("XCoordinate", RenderOption::MeshColorOption::XCoordinate) - .value("YCoordinate", RenderOption::MeshColorOption::YCoordinate) - .value("ZCoordinate", RenderOption::MeshColorOption::ZCoordinate) - .value("Normal", RenderOption::MeshColorOption::Normal) - .export_values(); } -void pybind_renderoption_method(py::module &m) {} - } // namespace visualization } // namespace open3d diff --git a/cpp/pybind/visualization/utility.cpp b/cpp/pybind/visualization/utility.cpp index 603e78bb947..77d63d5e100 100644 --- a/cpp/pybind/visualization/utility.cpp +++ b/cpp/pybind/visualization/utility.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -18,10 +18,15 @@ namespace open3d { namespace visualization { -void pybind_visualization_utility(py::module &m) { +void pybind_visualization_utility_declarations(py::module &m) { py::class_ selection_volume( m, "SelectionPolygonVolume", "Select a polygon volume for cropping."); +} + +void pybind_visualization_utility_definitions(py::module &m) { + auto selection_volume = static_cast>( + m.attr("SelectionPolygonVolume")); py::detail::bind_default_constructor( selection_volume); py::detail::bind_copy_functions(selection_volume); @@ -75,36 +80,34 @@ void pybind_visualization_utility(py::module &m) { docstring::ClassMethodDocInject(m, "SelectionPolygonVolume", "crop_in_polygon", {{"input", "The input point cloud xyz."}}); -} - -// Visualization util functions have similar arguments, sharing arg docstrings -static const std::unordered_map - map_shared_argument_docstrings = { - {"callback_function", - "Call back function to be triggered at a key press event."}, - {"filename", "The file path."}, - {"geometry_list", "List of geometries to be visualized."}, - {"height", "The height of the visualization window."}, - {"key_to_callback", "Map of key to call back functions."}, - {"left", "The left margin of the visualization window."}, - {"optional_view_trajectory_json_file", - "Camera trajectory json file path for custom animation."}, - {"top", "The top margin of the visualization window."}, - {"width", "The width of the visualization window."}, - {"point_show_normal", - "Visualize point normals if set to true."}, - {"mesh_show_wireframe", - "Visualize mesh wireframe if set to true."}, - {"mesh_show_back_face", - "Visualize also the back face of the mesh triangles."}, - {"window_name", - "The displayed title of the visualization window."}, - {"lookat", "The lookat vector of the camera."}, - {"up", "The up vector of the camera."}, - {"front", "The front vector of the camera."}, - {"zoom", "The zoom of the camera."}}; - -void pybind_visualization_utility_methods(py::module &m) { + // Visualization util functions have similar arguments, sharing arg + // docstrings + static const std::unordered_map + map_shared_argument_docstrings = { + {"callback_function", + "Call back function to be triggered at a key press " + "event."}, + {"filename", "The file path."}, + {"geometry_list", "List of geometries to be visualized."}, + {"height", "The height of the visualization window."}, + {"key_to_callback", "Map of key to call back functions."}, + {"left", "The left margin of the visualization window."}, + {"optional_view_trajectory_json_file", + "Camera trajectory json file path for custom animation."}, + {"top", "The top margin of the visualization window."}, + {"width", "The width of the visualization window."}, + {"point_show_normal", + "Visualize point normals if set to true."}, + {"mesh_show_wireframe", + "Visualize mesh wireframe if set to true."}, + {"mesh_show_back_face", + "Visualize also the back face of the mesh triangles."}, + {"window_name", + "The displayed title of the visualization window."}, + {"lookat", "The lookat vector of the camera."}, + {"up", "The up vector of the camera."}, + {"front", "The front vector of the camera."}, + {"zoom", "The zoom of the camera."}}; m.def( "draw_geometries", [](const std::vector> diff --git a/cpp/pybind/visualization/viewcontrol.cpp b/cpp/pybind/visualization/viewcontrol.cpp index 80a8aaa7895..ceb95addda4 100644 --- a/cpp/pybind/visualization/viewcontrol.cpp +++ b/cpp/pybind/visualization/viewcontrol.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -29,9 +29,14 @@ static const std::unordered_map {"z_far", "The depth of the far z-plane of the visualizer."}, }; -void pybind_viewcontrol(py::module &m) { +void pybind_viewcontrol_declarations(py::module &m) { py::class_, std::shared_ptr> viewcontrol(m, "ViewControl", "View controller for visualizer."); +} +void pybind_viewcontrol_definitions(py::module &m) { + auto viewcontrol = static_cast, + std::shared_ptr>>( + m.attr("ViewControl")); py::detail::bind_default_constructor(viewcontrol); viewcontrol .def("__repr__", @@ -123,7 +128,5 @@ void pybind_viewcontrol(py::module &m) { map_view_control_docstrings); } -void pybind_viewcontrol_method(py::module &m) {} - } // namespace visualization } // namespace open3d diff --git a/cpp/pybind/visualization/visualization.cpp b/cpp/pybind/visualization/visualization.cpp index b6e3455fa6d..44c3770f598 100644 --- a/cpp/pybind/visualization/visualization.cpp +++ b/cpp/pybind/visualization/visualization.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -19,27 +19,41 @@ namespace open3d { namespace visualization { -void pybind_visualization(py::module &m) { +void pybind_visualization_declarations(py::module &m) { py::module m_visualization = m.def_submodule("visualization"); - pybind_renderoption(m_visualization); - pybind_viewcontrol(m_visualization); - pybind_visualizer(m_visualization); - pybind_visualization_utility(m_visualization); - pybind_renderoption_method(m_visualization); - pybind_viewcontrol_method(m_visualization); - pybind_visualizer_method(m_visualization); - pybind_visualization_utility_methods(m_visualization); - rendering::pybind_material(m_visualization); // For RPC serialization - + pybind_renderoption_declarations(m_visualization); + pybind_viewcontrol_declarations(m_visualization); + pybind_visualizer_declarations(m_visualization); + pybind_visualization_utility_declarations(m_visualization); + // For RPC serialization + rendering::pybind_material_declarations(m_visualization); #ifdef BUILD_GUI - rendering::pybind_rendering(m_visualization); - gui::pybind_gui(m_visualization); - pybind_o3dvisualizer(m_visualization); - app::pybind_app(m_visualization); + rendering::pybind_rendering_declarations(m_visualization); + gui::pybind_gui_declarations(m_visualization); + pybind_o3dvisualizer_declarations(m_visualization); + app::pybind_app_declarations(m_visualization); +#endif +#ifdef BUILD_WEBRTC + webrtc_server::pybind_webrtc_server_declarations(m_visualization); #endif +} +void pybind_visualization_definitions(py::module &m) { + auto m_visualization = static_cast(m.attr("visualization")); + pybind_renderoption_definitions(m_visualization); + pybind_viewcontrol_definitions(m_visualization); + pybind_visualizer_definitions(m_visualization); + pybind_visualization_utility_definitions(m_visualization); + // For RPC serialization + rendering::pybind_material_definitions(m_visualization); +#ifdef BUILD_GUI + rendering::pybind_rendering_definitions(m_visualization); + gui::pybind_gui_definitions(m_visualization); + pybind_o3dvisualizer_definitions(m_visualization); + app::pybind_app_definitions(m_visualization); +#endif #ifdef BUILD_WEBRTC - webrtc_server::pybind_webrtc_server(m_visualization); + webrtc_server::pybind_webrtc_server_definitions(m_visualization); #endif } diff --git a/cpp/pybind/visualization/visualization.h b/cpp/pybind/visualization/visualization.h index de6d7aa5757..be6d8ef703c 100644 --- a/cpp/pybind/visualization/visualization.h +++ b/cpp/pybind/visualization/visualization.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -53,19 +53,19 @@ std::shared_ptr TakeOwnership(UnownedPointer x) { // Please update docs/python_api_in/open3d.visualization.rst when adding / // reorganizing submodules to open3d.visualization. -void pybind_visualization(py::module &m); +void pybind_visualization_declarations(py::module &m); +void pybind_renderoption_declarations(py::module &m); +void pybind_viewcontrol_declarations(py::module &m); +void pybind_visualizer_declarations(py::module &m); +void pybind_visualization_utility_declarations(py::module &m); +void pybind_o3dvisualizer_declarations(py::module &m); -void pybind_renderoption(py::module &m); -void pybind_viewcontrol(py::module &m); -void pybind_visualizer(py::module &m); -void pybind_visualization_utility(py::module &m); - -void pybind_renderoption_method(py::module &m); -void pybind_viewcontrol_method(py::module &m); -void pybind_visualizer_method(py::module &m); -void pybind_visualization_utility_methods(py::module &m); - -void pybind_o3dvisualizer(py::module &m); +void pybind_visualization_definitions(py::module &m); +void pybind_renderoption_definitions(py::module &m); +void pybind_viewcontrol_definitions(py::module &m); +void pybind_visualizer_definitions(py::module &m); +void pybind_visualization_utility_definitions(py::module &m); +void pybind_o3dvisualizer_definitions(py::module &m); } // namespace visualization } // namespace open3d diff --git a/cpp/pybind/visualization/visualization_trampoline.h b/cpp/pybind/visualization/visualization_trampoline.h index bb605a2fb4d..8a6a5509abe 100644 --- a/cpp/pybind/visualization/visualization_trampoline.h +++ b/cpp/pybind/visualization/visualization_trampoline.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/pybind/visualization/visualizer.cpp b/cpp/pybind/visualization/visualizer.cpp index 990727dd45c..1305fa49202 100644 --- a/cpp/pybind/visualization/visualizer.cpp +++ b/cpp/pybind/visualization/visualizer.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -38,9 +38,32 @@ static const std::unordered_map {"reset_bounding_box", "Set to ``False`` to keep current viewpoint"}}; -void pybind_visualizer(py::module &m) { +void pybind_visualizer_declarations(py::module &m) { py::class_, std::shared_ptr> visualizer(m, "Visualizer", "The main Visualizer class."); + py::class_, + std::shared_ptr> + visualizer_key(m, "VisualizerWithKeyCallback", visualizer, + "Visualizer with custom key callback capabilities."); + py::class_, + std::shared_ptr> + visualizer_edit(m, "VisualizerWithEditing", visualizer, + "Visualizer with editing capabilities."); + py::class_, + std::shared_ptr> + visualizer_vselect( + m, "VisualizerWithVertexSelection", visualizer, + "Visualizer with vertex selection capabilities."); + py::class_ + visualizer_vselect_pickedpoint(m, "PickedPoint"); +} + +void pybind_visualizer_definitions(py::module &m) { + auto visualizer = static_cast, + std::shared_ptr>>( + m.attr("Visualizer")); py::detail::bind_default_constructor(visualizer); visualizer .def("__repr__", @@ -145,12 +168,11 @@ void pybind_visualizer(py::module &m) { "Set the current view status from a json string of " "ViewTrajectory.", "view_status_str"_a); - - py::class_, - std::shared_ptr> - visualizer_key(m, "VisualizerWithKeyCallback", visualizer, - "Visualizer with custom key callback capabilities."); + auto visualizer_key = + static_cast, + std::shared_ptr>>( + m.attr("VisualizerWithKeyCallback")); py::detail::bind_default_constructor( visualizer_key); visualizer_key @@ -212,10 +234,11 @@ void pybind_visualizer(py::module &m) { "key `__.", "callback_func"_a); - py::class_, - std::shared_ptr> - visualizer_edit(m, "VisualizerWithEditing", visualizer, - "Visualizer with editing capabilities."); + auto visualizer_edit = + static_cast, + std::shared_ptr>>( + m.attr("VisualizerWithEditing")); py::detail::bind_default_constructor( visualizer_edit); visualizer_edit @@ -232,12 +255,11 @@ void pybind_visualizer(py::module &m) { &VisualizerWithEditing::GetCroppedGeometry, "Function to get cropped geometry"); - py::class_, - std::shared_ptr> - visualizer_vselect( - m, "VisualizerWithVertexSelection", visualizer, - "Visualizer with vertex selection capabilities."); + auto visualizer_vselect = static_cast< + py::class_, + std::shared_ptr>>( + m.attr("VisualizerWithVertexSelection")); py::detail::bind_default_constructor( visualizer_vselect); visualizer_vselect.def(py::init<>()) @@ -279,8 +301,9 @@ void pybind_visualizer(py::module &m) { "Registers a function to be called after selection moves", "f"_a); - py::class_ - visualizer_vselect_pickedpoint(m, "PickedPoint"); + auto visualizer_vselect_pickedpoint = + static_cast>( + m.attr("PickedPoint")); visualizer_vselect_pickedpoint.def(py::init<>()) .def_readwrite("index", &VisualizerWithVertexSelection::PickedPoint::index) @@ -337,7 +360,5 @@ void pybind_visualizer(py::module &m) { map_visualizer_docstrings); } -void pybind_visualizer_method(py::module &m) {} - } // namespace visualization } // namespace open3d diff --git a/cpp/pybind/visualization/webrtc_server/webrtc_window_system.cpp b/cpp/pybind/visualization/webrtc_server/webrtc_window_system.cpp index 84ae5d391c2..abccf5f043f 100644 --- a/cpp/pybind/visualization/webrtc_server/webrtc_window_system.cpp +++ b/cpp/pybind/visualization/webrtc_server/webrtc_window_system.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -15,8 +15,15 @@ namespace open3d { namespace visualization { namespace webrtc_server { -static void pybind_webrtc_server_functions(py::module &m) { - m.def( +void pybind_webrtc_server_declarations(py::module &m) { + py::module m_submodule = m.def_submodule( + "webrtc_server", + "Functionality for remote visualization over WebRTC."); +} + +void pybind_webrtc_server_definitions(py::module &m) { + auto m_webrtc_server = static_cast(m.attr("webrtc_server")); + m_webrtc_server.def( "call_http_api", [](const std::string &entry_point, const std::string &query_string, const std::string &data) { @@ -27,18 +34,18 @@ static void pybind_webrtc_server_functions(py::module &m) { "Emulates Open3D WebRTCWindowSystem's HTTP API calls. This is used " "when the HTTP handshake server is disabled (e.g. in Jupyter), and " "handshakes are done by this function."); - m.def( + m_webrtc_server.def( "enable_webrtc", []() { WebRTCWindowSystem::GetInstance()->EnableWebRTC(); }, "Use WebRTC streams to display rendered gui window."); - m.def( + m_webrtc_server.def( "disable_http_handshake", []() { WebRTCWindowSystem::GetInstance()->DisableHttpHandshake(); }, "Disables the HTTP handshake server. In Jupyter environment, " "WebRTC handshake is performed by call_http_api() with " "Jupyter's own COMMS interface, thus the HTTP server shall " "be turned off."); - m.def( + m_webrtc_server.def( "register_data_channel_message_callback", [](const std::string &class_name, std::function callback) { @@ -78,7 +85,7 @@ if it is not empty. )"); docstring::FunctionDocInject( - m, "register_data_channel_message_callback", + m_webrtc_server, "register_data_channel_message_callback", {{"class_name", "The value of of the ``class_name`` property of the JSON " "object."}, @@ -90,13 +97,6 @@ if it is not empty. "value of a slider) and return a ``string``."}}); } -void pybind_webrtc_server(py::module &m) { - py::module m_submodule = m.def_submodule( - "webrtc_server", - "Functionality for remote visualization over WebRTC."); - pybind_webrtc_server_functions(m_submodule); -} - } // namespace webrtc_server } // namespace visualization } // namespace open3d diff --git a/cpp/pybind/visualization/webrtc_server/webrtc_window_system.h b/cpp/pybind/visualization/webrtc_server/webrtc_window_system.h index cae067d7e85..94580d4406a 100644 --- a/cpp/pybind/visualization/webrtc_server/webrtc_window_system.h +++ b/cpp/pybind/visualization/webrtc_server/webrtc_window_system.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -13,7 +13,8 @@ namespace open3d { namespace visualization { namespace webrtc_server { -void pybind_webrtc_server(py::module &m); +void pybind_webrtc_server_declarations(py::module &m); +void pybind_webrtc_server_definitions(py::module &m); } // namespace webrtc_server } // namespace visualization diff --git a/cpp/tests/CMakeLists.txt b/cpp/tests/CMakeLists.txt index 9d8d118e792..3d58a53ad84 100644 --- a/cpp/tests/CMakeLists.txt +++ b/cpp/tests/CMakeLists.txt @@ -28,7 +28,7 @@ else() target_compile_definitions(tests PRIVATE GPU_CONDITIONAL_TEST_STR=DISABLED_) endif() -if (WITH_IPPICV) +if (WITH_IPP) target_compile_definitions(tests PRIVATE IPP_CONDITIONAL_TEST_STR=) # Empty string (test not disabled) else() target_compile_definitions(tests PRIVATE IPP_CONDITIONAL_TEST_STR=DISABLED_) @@ -51,6 +51,14 @@ endif() open3d_show_and_abort_on_warning(tests) open3d_set_global_properties(tests) +# On Windows, running tests from the build folder needs tbb.dll to be in the same folder. +if (WIN32) + add_custom_command( + TARGET tests + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different $ "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$/" + ) +endif() if (BUILD_AZURE_KINECT) # K4A headers are directly used in test. Currently we don't need to link diff --git a/cpp/tests/Main.cpp b/cpp/tests/Main.cpp index f839dc3556b..ece271ee137 100644 --- a/cpp/tests/Main.cpp +++ b/cpp/tests/Main.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/Tests.cpp b/cpp/tests/Tests.cpp index ee6fcdead6b..af0df371df8 100644 --- a/cpp/tests/Tests.cpp +++ b/cpp/tests/Tests.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/Tests.h b/cpp/tests/Tests.h index 10e8ca6cbb4..f5c0cfd5b97 100644 --- a/cpp/tests/Tests.h +++ b/cpp/tests/Tests.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/camera/PinholeCameraIntrinsic.cpp b/cpp/tests/camera/PinholeCameraIntrinsic.cpp index 6da9cd85594..ccb274f23e5 100644 --- a/cpp/tests/camera/PinholeCameraIntrinsic.cpp +++ b/cpp/tests/camera/PinholeCameraIntrinsic.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/camera/PinholeCameraParameters.cpp b/cpp/tests/camera/PinholeCameraParameters.cpp index e979acfe616..47c7a06222d 100644 --- a/cpp/tests/camera/PinholeCameraParameters.cpp +++ b/cpp/tests/camera/PinholeCameraParameters.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/camera/PinholeCameraTrajectory.cpp b/cpp/tests/camera/PinholeCameraTrajectory.cpp index 01c4002ee44..3d771f1ea26 100644 --- a/cpp/tests/camera/PinholeCameraTrajectory.cpp +++ b/cpp/tests/camera/PinholeCameraTrajectory.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/core/Blob.cpp b/cpp/tests/core/Blob.cpp index 7996c744468..85be95d31cc 100644 --- a/cpp/tests/core/Blob.cpp +++ b/cpp/tests/core/Blob.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/core/CUDAUtils.cpp b/cpp/tests/core/CUDAUtils.cpp index 10cda864d95..3a0634fe3d7 100644 --- a/cpp/tests/core/CUDAUtils.cpp +++ b/cpp/tests/core/CUDAUtils.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/core/CoreTest.cpp b/cpp/tests/core/CoreTest.cpp index 3bb29941993..8f1486ce4c6 100644 --- a/cpp/tests/core/CoreTest.cpp +++ b/cpp/tests/core/CoreTest.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -105,7 +105,11 @@ PermuteDevicePairsWithSYCL::TestCases() { std::vector devices; devices.insert(devices.end(), cpu_devices.begin(), cpu_devices.end()); devices.insert(devices.end(), cuda_devices.begin(), cuda_devices.end()); - devices.insert(devices.end(), sycl_devices.begin(), sycl_devices.end()); + // Skip the last SYCL device - this is the CPU fallback + if (sycl_devices.size() > 1) { + devices.insert(devices.end(), sycl_devices.begin(), + sycl_devices.end() - 1); + } // Self-pairs and cross pairs (bidirectional). std::vector> device_pairs; diff --git a/cpp/tests/core/CoreTest.h b/cpp/tests/core/CoreTest.h index 3b2f6f6dd29..ab874b8b485 100644 --- a/cpp/tests/core/CoreTest.h +++ b/cpp/tests/core/CoreTest.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/core/Device.cpp b/cpp/tests/core/Device.cpp index a93aba7caf7..0f54a962d4e 100644 --- a/cpp/tests/core/Device.cpp +++ b/cpp/tests/core/Device.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/core/EigenConverter.cpp b/cpp/tests/core/EigenConverter.cpp index 41a810ede47..7754657cc13 100644 --- a/cpp/tests/core/EigenConverter.cpp +++ b/cpp/tests/core/EigenConverter.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/core/FixedRadiusIndex.cpp b/cpp/tests/core/FixedRadiusIndex.cpp index 04a457a23dc..fb735b799e0 100644 --- a/cpp/tests/core/FixedRadiusIndex.cpp +++ b/cpp/tests/core/FixedRadiusIndex.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/core/HashMap.cpp b/cpp/tests/core/HashMap.cpp index 3d048e68883..c3077ebef16 100644 --- a/cpp/tests/core/HashMap.cpp +++ b/cpp/tests/core/HashMap.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/core/Indexer.cpp b/cpp/tests/core/Indexer.cpp index bc53c4f3c59..305c08693a0 100644 --- a/cpp/tests/core/Indexer.cpp +++ b/cpp/tests/core/Indexer.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/core/Indexer.ispc b/cpp/tests/core/Indexer.ispc index 19c9d41e4a9..c25ba876f26 100644 --- a/cpp/tests/core/Indexer.ispc +++ b/cpp/tests/core/Indexer.ispc @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/core/KnnIndex.cpp b/cpp/tests/core/KnnIndex.cpp index d8af7c72983..1ceb32d4835 100644 --- a/cpp/tests/core/KnnIndex.cpp +++ b/cpp/tests/core/KnnIndex.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- #include "open3d/core/nns/KnnIndex.h" diff --git a/cpp/tests/core/Linalg.cpp b/cpp/tests/core/Linalg.cpp index 20dce1117f5..2c8be12323b 100644 --- a/cpp/tests/core/Linalg.cpp +++ b/cpp/tests/core/Linalg.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/core/MemoryManager.cpp b/cpp/tests/core/MemoryManager.cpp index c4904bb2f1c..9e3570a5af0 100644 --- a/cpp/tests/core/MemoryManager.cpp +++ b/cpp/tests/core/MemoryManager.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/core/NanoFlannIndex.cpp b/cpp/tests/core/NanoFlannIndex.cpp index 83daf3b8916..6deb8bca639 100644 --- a/cpp/tests/core/NanoFlannIndex.cpp +++ b/cpp/tests/core/NanoFlannIndex.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/core/NearestNeighborSearch.cpp b/cpp/tests/core/NearestNeighborSearch.cpp index 57722b83ab0..a53e33642e1 100644 --- a/cpp/tests/core/NearestNeighborSearch.cpp +++ b/cpp/tests/core/NearestNeighborSearch.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/core/ParallelFor.cpp b/cpp/tests/core/ParallelFor.cpp index 36d0dfc3c87..db366758b18 100644 --- a/cpp/tests/core/ParallelFor.cpp +++ b/cpp/tests/core/ParallelFor.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/core/ParallelFor.cu b/cpp/tests/core/ParallelFor.cu index c5806c264dc..b83517b8f45 100644 --- a/cpp/tests/core/ParallelFor.cu +++ b/cpp/tests/core/ParallelFor.cu @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/core/ParallelFor.ispc b/cpp/tests/core/ParallelFor.ispc index 3eb68daa00a..f3d9edfa8fb 100644 --- a/cpp/tests/core/ParallelFor.ispc +++ b/cpp/tests/core/ParallelFor.ispc @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/core/SYCLUtils.cpp b/cpp/tests/core/SYCLUtils.cpp index d10d99f09fa..0d626f83417 100644 --- a/cpp/tests/core/SYCLUtils.cpp +++ b/cpp/tests/core/SYCLUtils.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -18,18 +18,18 @@ namespace open3d { namespace tests { -TEST(SYCLUtils, SYCLDemo) { core::sycl::SYCLDemo(); } +TEST(SYCLUtils, SYCLDemo) { core::sy::SYCLDemo(); } TEST(SYCLUtils, PrintAllSYCLDevices) { - core::sycl::PrintSYCLDevices(/*print_all=*/true); + core::sy::PrintSYCLDevices(/*print_all=*/true); } TEST(SYCLUtils, PrintSYCLDevices) { - core::sycl::PrintSYCLDevices(/*print_all=*/false); + core::sy::PrintSYCLDevices(/*print_all=*/false); } TEST(SYCLUtils, SYCLUnifiedSharedMemory) { - if (!core::sycl::IsAvailable()) { + if (!core::sy::IsAvailable()) { return; } diff --git a/cpp/tests/core/Scalar.cpp b/cpp/tests/core/Scalar.cpp index f3148facc20..12d538aa244 100644 --- a/cpp/tests/core/Scalar.cpp +++ b/cpp/tests/core/Scalar.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/core/ShapeUtil.cpp b/cpp/tests/core/ShapeUtil.cpp index 3991c4b988e..77b7c90801a 100644 --- a/cpp/tests/core/ShapeUtil.cpp +++ b/cpp/tests/core/ShapeUtil.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/core/SizeVector.cpp b/cpp/tests/core/SizeVector.cpp index c551a170e77..a3e6724103e 100644 --- a/cpp/tests/core/SizeVector.cpp +++ b/cpp/tests/core/SizeVector.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/core/Tensor.cpp b/cpp/tests/core/Tensor.cpp index e4a4b14cf9d..9f788116be7 100644 --- a/cpp/tests/core/Tensor.cpp +++ b/cpp/tests/core/Tensor.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/core/TensorCheck.cpp b/cpp/tests/core/TensorCheck.cpp index f65be5ddaef..8b789b481b6 100644 --- a/cpp/tests/core/TensorCheck.cpp +++ b/cpp/tests/core/TensorCheck.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/core/TensorFunction.cpp b/cpp/tests/core/TensorFunction.cpp index d1ba5be783d..0d25b941dfd 100644 --- a/cpp/tests/core/TensorFunction.cpp +++ b/cpp/tests/core/TensorFunction.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/core/TensorList.cpp b/cpp/tests/core/TensorList.cpp index 305879927c3..39091f3d386 100644 --- a/cpp/tests/core/TensorList.cpp +++ b/cpp/tests/core/TensorList.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/core/TensorObject.cpp b/cpp/tests/core/TensorObject.cpp index f5383885535..0ff294dbc88 100644 --- a/cpp/tests/core/TensorObject.cpp +++ b/cpp/tests/core/TensorObject.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/data/Dataset.cpp b/cpp/tests/data/Dataset.cpp index 49feb3de8b6..6f7e1e4561c 100644 --- a/cpp/tests/data/Dataset.cpp +++ b/cpp/tests/data/Dataset.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/geometry/AccumulatedPoint.cpp b/cpp/tests/geometry/AccumulatedPoint.cpp index 4088e0a48d4..8cf19130437 100644 --- a/cpp/tests/geometry/AccumulatedPoint.cpp +++ b/cpp/tests/geometry/AccumulatedPoint.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/geometry/AxisAlignedBoundingBox.cpp b/cpp/tests/geometry/AxisAlignedBoundingBox.cpp index 9cf7db8f241..449f1dc378f 100644 --- a/cpp/tests/geometry/AxisAlignedBoundingBox.cpp +++ b/cpp/tests/geometry/AxisAlignedBoundingBox.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/geometry/EstimateNormals.cpp b/cpp/tests/geometry/EstimateNormals.cpp index 559ffc2f666..cecb57de182 100644 --- a/cpp/tests/geometry/EstimateNormals.cpp +++ b/cpp/tests/geometry/EstimateNormals.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/geometry/HalfEdgeTriangleMesh.cpp b/cpp/tests/geometry/HalfEdgeTriangleMesh.cpp index 7b71fb38080..d6d23cf5f1b 100644 --- a/cpp/tests/geometry/HalfEdgeTriangleMesh.cpp +++ b/cpp/tests/geometry/HalfEdgeTriangleMesh.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/geometry/Image.cpp b/cpp/tests/geometry/Image.cpp index f6e5741cba1..f7ca53c67bf 100644 --- a/cpp/tests/geometry/Image.cpp +++ b/cpp/tests/geometry/Image.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/geometry/IntersectionTest.cpp b/cpp/tests/geometry/IntersectionTest.cpp index 73539a9f443..8911e42936c 100644 --- a/cpp/tests/geometry/IntersectionTest.cpp +++ b/cpp/tests/geometry/IntersectionTest.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/geometry/KDTreeFlann.cpp b/cpp/tests/geometry/KDTreeFlann.cpp index 25a7822e487..43d62eddf71 100644 --- a/cpp/tests/geometry/KDTreeFlann.cpp +++ b/cpp/tests/geometry/KDTreeFlann.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/geometry/Line3D.cpp b/cpp/tests/geometry/Line3D.cpp index f3944645b52..14c3dc33975 100644 --- a/cpp/tests/geometry/Line3D.cpp +++ b/cpp/tests/geometry/Line3D.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/geometry/LineSet.cpp b/cpp/tests/geometry/LineSet.cpp index 8a68120598f..efbec0d91e2 100644 --- a/cpp/tests/geometry/LineSet.cpp +++ b/cpp/tests/geometry/LineSet.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/geometry/Octree.cpp b/cpp/tests/geometry/Octree.cpp index edcfac1a8f7..9ed6f4cf33f 100644 --- a/cpp/tests/geometry/Octree.cpp +++ b/cpp/tests/geometry/Octree.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/geometry/PointCloud.cpp b/cpp/tests/geometry/PointCloud.cpp index 21bfe5659bf..64e1bee0248 100644 --- a/cpp/tests/geometry/PointCloud.cpp +++ b/cpp/tests/geometry/PointCloud.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -878,11 +878,17 @@ TEST(PointCloud, FarthestPointDownSample) { {1.0, 1.0, 1.5}}); std::shared_ptr pcd_down = pcd.FarthestPointDownSample(4); - ExpectEQ(pcd_down->points_, std::vector({{0, 2.0, 0}, - {1.0, 1.0, 0}, - {1.0, 0, 1.0}, - {0, 1.0, 1.0}})); -} // namespace tests + std::vector expected = { + {0, 2.0, 0}, {1.0, 1.0, 0}, {1.0, 0, 1.0}, {0, 1.0, 1.0}}; + + std::shared_ptr pcd_down_2 = + pcd.FarthestPointDownSample(4, 4); + std::vector expected_2 = { + {0, 2.0, 0}, {1.0, 1.0, 0}, {0, 0, 1.0}, {1.0, 1.0, 1.5}}; + + ExpectEQ(pcd_down->points_, expected); + ExpectEQ(pcd_down_2->points_, expected_2); +} TEST(PointCloud, Crop_AxisAlignedBoundingBox) { geometry::AxisAlignedBoundingBox aabb({0, 0, 0}, {2, 2, 2}); diff --git a/cpp/tests/geometry/RGBDImage.cpp b/cpp/tests/geometry/RGBDImage.cpp index 433feb1a4c6..e4944981669 100644 --- a/cpp/tests/geometry/RGBDImage.cpp +++ b/cpp/tests/geometry/RGBDImage.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/geometry/TetraMesh.cpp b/cpp/tests/geometry/TetraMesh.cpp index 5b5e29db246..00e8dd3f9de 100644 --- a/cpp/tests/geometry/TetraMesh.cpp +++ b/cpp/tests/geometry/TetraMesh.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -9,6 +9,7 @@ #include +#include "open3d/geometry/BoundingVolume.h" #include "open3d/geometry/PointCloud.h" #include "open3d/geometry/TriangleMesh.h" #include "tests/Tests.h" @@ -119,6 +120,229 @@ TEST(TetraMesh, GetMaxBound) { tm.GetMaxBound()); } +TEST(TetraMesh, GetCenter) { + int size = 100; + + Eigen::Vector3d dmin(0.0, 0.0, 0.0); + Eigen::Vector3d dmax(1000.0, 1000.0, 1000.0); + + geometry::TetraMesh tm; + + tm.vertices_.resize(size); + Rand(tm.vertices_, dmin, dmax, 0); + + ExpectEQ(tm.GetCenter(), + Eigen::Vector3d(531.137254, 535.176470, 501.882352)); + + geometry::TetraMesh tm_empty; + ExpectEQ(tm_empty.GetCenter(), Eigen::Vector3d(0, 0, 0)); +} + +TEST(TetraMesh, GetAxisAlignedBoundingBox) { + geometry::TetraMesh tm; + geometry::AxisAlignedBoundingBox aabb; + + tm = geometry::TetraMesh(); + aabb = tm.GetAxisAlignedBoundingBox(); + EXPECT_EQ(aabb.min_bound_, Eigen::Vector3d(0, 0, 0)); + EXPECT_EQ(aabb.max_bound_, Eigen::Vector3d(0, 0, 0)); + EXPECT_EQ(aabb.color_, Eigen::Vector3d(1, 1, 1)); + + tm = geometry::TetraMesh({{0, 0, 0}}, {{0, 0, 0, 0}}); + aabb = tm.GetAxisAlignedBoundingBox(); + EXPECT_EQ(aabb.min_bound_, Eigen::Vector3d(0, 0, 0)); + EXPECT_EQ(aabb.max_bound_, Eigen::Vector3d(0, 0, 0)); + EXPECT_EQ(aabb.color_, Eigen::Vector3d(1, 1, 1)); + + tm = geometry::TetraMesh({{0, 2, 0}, + {1, 1, 2}, + {1, 0, 3}, + {0, 1, 4}, + {1, 2, 5}, + {1, 3, 6}, + {0, 0, 7}, + {0, 3, 8}, + {1, 0, 9}, + {0, 2, 10}}, + {{0, 1, 2, 3}, + {4, 0, 1, 2}, + {4, 5, 2, 3}, + {4, 0, 2, 3}, + {4, 0, 5, 3}, + {6, 0, 5, 3}, + {6, 7, 8, 5}, + {9, 4, 7, 1}, + {9, 4, 0, 1}, + {9, 0, 1, 3}, + {9, 6, 7, 8}, + {9, 4, 7, 5}, + {9, 6, 7, 5}, + {9, 4, 0, 5}, + {9, 6, 0, 5}}); + aabb = tm.GetAxisAlignedBoundingBox(); + EXPECT_EQ(aabb.min_bound_, Eigen::Vector3d(0, 0, 0)); + EXPECT_EQ(aabb.max_bound_, Eigen::Vector3d(1, 3, 10)); + EXPECT_EQ(aabb.color_, Eigen::Vector3d(1, 1, 1)); +} + +TEST(TetraMesh, GetOrientedBoundingBox) { + geometry::TetraMesh tm; + geometry::OrientedBoundingBox obb; + + // Empty (GetOrientedBoundingBox requires >=4 points) + tm = geometry::TetraMesh(); + EXPECT_ANY_THROW(tm.GetOrientedBoundingBox()); + + // Point + tm = geometry::TetraMesh({{0, 0, 0}}, {{0, 0, 0, 0}}); + EXPECT_ANY_THROW(tm.GetOrientedBoundingBox()); + tm = geometry::TetraMesh({{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}, + {{0, 1, 2, 3}}); + EXPECT_ANY_THROW(tm.GetOrientedBoundingBox()); + EXPECT_NO_THROW(tm.GetOrientedBoundingBox(true)); + + // Plane + tm = geometry::TetraMesh({{0, 0, 0}, {0, 0, 1}, {0, 1, 0}, {0, 1, 1}}, + {{0, 1, 2, 3}}); + EXPECT_ANY_THROW(tm.GetOrientedBoundingBox()); + EXPECT_NO_THROW(tm.GetOrientedBoundingBox(true)); + + // Valid 4 points + tm = geometry::TetraMesh({{0, 0, 0}, {0, 0, 1}, {0, 1, 0}, {1, 1, 1}}, + {{0, 1, 2, 3}}); + tm.GetOrientedBoundingBox(); + + // 8 points with known ground truth + tm = geometry::TetraMesh({{0, 0, 0}, + {0, 0, 1}, + {0, 2, 0}, + {0, 2, 1}, + {3, 0, 0}, + {3, 0, 1}, + {3, 2, 0}, + {3, 2, 1}}, + {{0, 1, 2, 3}, + {4, 5, 6, 7}, + {0, 1, 4, 5}, + {2, 3, 6, 7}, + {0, 2, 4, 6}, + {1, 3, 5, 7}}); + obb = tm.GetOrientedBoundingBox(); + EXPECT_EQ(obb.center_, Eigen::Vector3d(1.5, 1, 0.5)); + EXPECT_EQ(obb.extent_, Eigen::Vector3d(3, 2, 1)); + EXPECT_EQ(obb.color_, Eigen::Vector3d(1, 1, 1)); + EXPECT_EQ(obb.R_, Eigen::Matrix3d::Identity()); + ExpectEQ(Sort(obb.GetBoxPoints()), + Sort(std::vector({{0, 0, 0}, + {0, 0, 1}, + {0, 2, 0}, + {0, 2, 1}, + {3, 0, 0}, + {3, 0, 1}, + {3, 2, 0}, + {3, 2, 1}}))); + + // Check for a bug where the OBB rotation contained a reflection for this + // example. + tm = geometry::TetraMesh({{0, 2, 4}, {7, 9, 1}, {5, 2, 0}, {3, 8, 7}}, + {{0, 1, 2, 3}}); + obb = tm.GetOrientedBoundingBox(); + EXPECT_GT(obb.R_.determinant(), 0.999); +} + +TEST(TetraMesh, GetMinimalOrientedBoundingBox) { + geometry::TetraMesh tm; + geometry::OrientedBoundingBox obb; + + // Empty (GetOrientedBoundingBox requires >=4 points) + tm = geometry::TetraMesh(); + EXPECT_ANY_THROW(tm.GetMinimalOrientedBoundingBox()); + + // Point + tm = geometry::TetraMesh({{0, 0, 0}}, {{0, 0, 0, 0}}); + EXPECT_ANY_THROW(tm.GetMinimalOrientedBoundingBox()); + tm = geometry::TetraMesh({{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}, + {{0, 1, 2, 3}}); + EXPECT_ANY_THROW(tm.GetMinimalOrientedBoundingBox()); + EXPECT_NO_THROW(tm.GetMinimalOrientedBoundingBox(true)); + + // Plane + tm = geometry::TetraMesh({{0, 0, 0}, {0, 0, 1}, {0, 1, 0}, {0, 1, 1}}, + {{0, 1, 2, 3}}); + EXPECT_ANY_THROW(tm.GetMinimalOrientedBoundingBox()); + EXPECT_NO_THROW(tm.GetMinimalOrientedBoundingBox(true)); + + // Valid 4 points + tm = geometry::TetraMesh({{0, 0, 0}, {0, 0, 1}, {0, 1, 0}, {1, 1, 1}}, + {{0, 1, 2, 3}}); + tm.GetMinimalOrientedBoundingBox(); + + // 8 points with known ground truth + tm = geometry::TetraMesh({{0, 0, 0}, + {0, 0, 1}, + {0, 2, 0}, + {0, 2, 1}, + {3, 0, 0}, + {3, 0, 1}, + {3, 2, 0}, + {3, 2, 1}}, + {{0, 1, 2, 3}, + {4, 5, 6, 7}, + {0, 1, 4, 5}, + {2, 3, 6, 7}, + {0, 2, 4, 6}, + {1, 3, 5, 7}}); + obb = tm.GetMinimalOrientedBoundingBox(); + EXPECT_EQ(obb.center_, Eigen::Vector3d(1.5, 1, 0.5)); + EXPECT_EQ(obb.extent_, Eigen::Vector3d(3, 2, 1)); + EXPECT_EQ(obb.color_, Eigen::Vector3d(1, 1, 1)); + ExpectEQ(Sort(obb.GetBoxPoints()), + Sort(std::vector({{0, 0, 0}, + {0, 0, 1}, + {0, 2, 0}, + {0, 2, 1}, + {3, 0, 0}, + {3, 0, 1}, + {3, 2, 0}, + {3, 2, 1}}))); + + // Check for a bug where the OBB rotation contained a reflection for this + // example. + tm = geometry::TetraMesh({{0, 2, 4}, {7, 9, 1}, {5, 2, 0}, {3, 8, 7}}, + {{0, 1, 2, 3}}); + obb = tm.GetMinimalOrientedBoundingBox(); + EXPECT_GT(obb.R_.determinant(), 0.999); + + // should always be equal/smaller than axis aligned- & oriented bounding box + tm = geometry::TetraMesh({{0.866, 0.474, 0.659}, + {0.943, 0.025, 0.789}, + {0.386, 0.264, 0.691}, + {0.938, 0.588, 0.496}, + {0.221, 0.116, 0.257}, + {0.744, 0.182, 0.052}, + {0.019, 0.525, 0.699}, + {0.722, 0.134, 0.668}}, + {{0, 1, 2, 3}, + {4, 0, 2, 3}, + {4, 0, 1, 2}, + {5, 4, 6, 3}, + {5, 4, 2, 3}, + {5, 4, 1, 2}, + {7, 1, 2, 6}, + {7, 5, 2, 6}, + {7, 5, 1, 2}, + {7, 5, 4, 6}, + {7, 5, 4, 1}, + {7, 0, 1, 6}, + {7, 4, 0, 6}, + {7, 4, 0, 1}}); + geometry::OrientedBoundingBox mobb = tm.GetMinimalOrientedBoundingBox(); + obb = tm.GetOrientedBoundingBox(); + geometry::AxisAlignedBoundingBox aabb = tm.GetAxisAlignedBoundingBox(); + EXPECT_GT(obb.Volume(), mobb.Volume()); + EXPECT_GT(aabb.Volume(), mobb.Volume()); +} + TEST(TetraMesh, Transform) { std::vector ref_vertices = { {1.411252, 4.274168, 3.130918}, {1.231757, 4.154505, 3.183678}, diff --git a/cpp/tests/geometry/TriangleMesh.cpp b/cpp/tests/geometry/TriangleMesh.cpp index ff6d75f6c8c..6131cc5b36a 100644 --- a/cpp/tests/geometry/TriangleMesh.cpp +++ b/cpp/tests/geometry/TriangleMesh.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -22,8 +22,8 @@ namespace tests { /// \param eq_triangle_vertex_order If true then triangles are only equal if the /// order of the vertices is the same. If false any permutation of the triangle /// indices is allowed. -void ExpectMeshEQ(const open3d::geometry::TriangleMesh& mesh0, - const open3d::geometry::TriangleMesh& mesh1, +void ExpectMeshEQ(const open3d::geometry::TriangleMesh &mesh0, + const open3d::geometry::TriangleMesh &mesh1, double threshold = 1e-6, bool eq_triangle_vertex_order = true) { ExpectEQ(mesh0.vertices_, mesh1.vertices_, threshold); @@ -168,6 +168,232 @@ TEST(TriangleMesh, GetMaxBound) { tm.GetMaxBound()); } +TEST(TriangleMesh, GetCenter) { + int size = 100; + + Eigen::Vector3d dmin(0.0, 0.0, 0.0); + Eigen::Vector3d dmax(1000.0, 1000.0, 1000.0); + + geometry::TriangleMesh tm; + + tm.vertices_.resize(size); + Rand(tm.vertices_, dmin, dmax, 0); + + ExpectEQ(tm.GetCenter(), + Eigen::Vector3d(531.137254, 535.176470, 501.882352)); + + geometry::TriangleMesh tm_empty; + ExpectEQ(tm_empty.GetCenter(), Eigen::Vector3d(0, 0, 0)); +} + +TEST(TriangleMesh, GetAxisAlignedBoundingBox) { + geometry::TriangleMesh tm; + geometry::AxisAlignedBoundingBox aabb; + + tm = geometry::TriangleMesh(); + aabb = tm.GetAxisAlignedBoundingBox(); + EXPECT_EQ(aabb.min_bound_, Eigen::Vector3d(0, 0, 0)); + EXPECT_EQ(aabb.max_bound_, Eigen::Vector3d(0, 0, 0)); + EXPECT_EQ(aabb.color_, Eigen::Vector3d(1, 1, 1)); + + tm = geometry::TriangleMesh({{0, 0, 0}}, {{0, 0, 0}}); + aabb = tm.GetAxisAlignedBoundingBox(); + EXPECT_EQ(aabb.min_bound_, Eigen::Vector3d(0, 0, 0)); + EXPECT_EQ(aabb.max_bound_, Eigen::Vector3d(0, 0, 0)); + EXPECT_EQ(aabb.color_, Eigen::Vector3d(1, 1, 1)); + + tm = geometry::TriangleMesh({{0, 2, 0}, + {1, 1, 2}, + {1, 0, 3}, + {0, 1, 4}, + {1, 2, 5}, + {1, 3, 6}, + {0, 0, 7}, + {0, 3, 8}, + {1, 0, 9}, + {0, 2, 10}}, + {{3, 1, 0}, + {3, 2, 1}, + {1, 2, 4}, + {5, 4, 2}, + {2, 3, 5}, + {6, 3, 0}, + {6, 5, 3}, + {5, 6, 8}, + {8, 7, 5}, + {1, 7, 9}, + {1, 4, 7}, + {0, 1, 9}, + {9, 8, 6}, + {7, 8, 9}, + {4, 5, 7}, + {9, 6, 0}}); + aabb = tm.GetAxisAlignedBoundingBox(); + EXPECT_EQ(aabb.min_bound_, Eigen::Vector3d(0, 0, 0)); + EXPECT_EQ(aabb.max_bound_, Eigen::Vector3d(1, 3, 10)); + EXPECT_EQ(aabb.color_, Eigen::Vector3d(1, 1, 1)); +} + +TEST(TriangleMesh, GetOrientedBoundingBox) { + geometry::TriangleMesh tm; + geometry::OrientedBoundingBox obb; + + // Empty (GetOrientedBoundingBox requires >=4 points) + tm = geometry::TriangleMesh(); + EXPECT_ANY_THROW(tm.GetOrientedBoundingBox()); + + // Point + tm = geometry::TriangleMesh({{0, 0, 0}}, {{0, 0, 0}}); + EXPECT_ANY_THROW(tm.GetOrientedBoundingBox()); + tm = geometry::TriangleMesh({{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}, + {{0, 1, 2}, {1, 2, 3}}); + EXPECT_ANY_THROW(tm.GetOrientedBoundingBox()); + EXPECT_NO_THROW(tm.GetOrientedBoundingBox(true)); + + // Plane + tm = geometry::TriangleMesh({{0, 0, 0}, {0, 0, 1}, {0, 1, 0}, {0, 1, 1}}, + {{0, 1, 2}, {1, 2, 3}}); + EXPECT_ANY_THROW(tm.GetOrientedBoundingBox()); + EXPECT_NO_THROW(tm.GetOrientedBoundingBox(true)); + + // Valid 4 points + tm = geometry::TriangleMesh({{0, 0, 0}, {0, 0, 1}, {0, 1, 0}, {1, 1, 1}}, + {{0, 1, 2}, {1, 2, 3}}); + tm.GetOrientedBoundingBox(); + + // 8 points with known ground truth + tm = geometry::TriangleMesh({{0, 0, 0}, + {0, 0, 1}, + {0, 2, 0}, + {0, 2, 1}, + {3, 0, 0}, + {3, 0, 1}, + {3, 2, 0}, + {3, 2, 1}}, + {{0, 1, 2}, + {1, 2, 3}, + {4, 5, 6}, + {5, 6, 7}, + {0, 1, 4}, + {1, 4, 5}, + {2, 3, 6}, + {3, 6, 7}}); + obb = tm.GetOrientedBoundingBox(); + EXPECT_EQ(obb.center_, Eigen::Vector3d(1.5, 1, 0.5)); + EXPECT_EQ(obb.extent_, Eigen::Vector3d(3, 2, 1)); + EXPECT_EQ(obb.color_, Eigen::Vector3d(1, 1, 1)); + EXPECT_EQ(obb.R_, Eigen::Matrix3d::Identity()); + ExpectEQ(Sort(obb.GetBoxPoints()), + Sort(std::vector({{0, 0, 0}, + {0, 0, 1}, + {0, 2, 0}, + {0, 2, 1}, + {3, 0, 0}, + {3, 0, 1}, + {3, 2, 0}, + {3, 2, 1}}))); + + // Check for a bug where the OBB rotation contained a reflection for this + // example. + tm = geometry::TriangleMesh({{0, 2, 4}, {7, 9, 1}, {5, 2, 0}, {3, 8, 7}}, + {{0, 1, 2}, {1, 2, 3}}); + obb = tm.GetOrientedBoundingBox(); + EXPECT_GT(obb.R_.determinant(), 0.999); +} + +TEST(TriangleMesh, GetMinimalOrientedBoundingBox) { + geometry::TriangleMesh tm; + geometry::OrientedBoundingBox obb; + + // Empty (GetOrientedBoundingBox requires >=4 points) + tm = geometry::TriangleMesh(); + EXPECT_ANY_THROW(tm.GetMinimalOrientedBoundingBox()); + + // Point + tm = geometry::TriangleMesh({{0, 0, 0}}, {{0, 0, 0}}); + EXPECT_ANY_THROW(tm.GetMinimalOrientedBoundingBox()); + tm = geometry::TriangleMesh({{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}, + {{0, 1, 2}, {1, 2, 3}}); + EXPECT_ANY_THROW(tm.GetMinimalOrientedBoundingBox()); + EXPECT_NO_THROW(tm.GetMinimalOrientedBoundingBox(true)); + + // Plane + tm = geometry::TriangleMesh({{0, 0, 0}, {0, 0, 1}, {0, 1, 0}, {0, 1, 1}}, + {{0, 1, 2}, {1, 2, 3}}); + EXPECT_ANY_THROW(tm.GetMinimalOrientedBoundingBox()); + EXPECT_NO_THROW(tm.GetMinimalOrientedBoundingBox(true)); + + // Valid 4 points + tm = geometry::TriangleMesh({{0, 0, 0}, {0, 0, 1}, {0, 1, 0}, {1, 1, 1}}, + {{0, 1, 2}, {1, 2, 3}}); + tm.GetMinimalOrientedBoundingBox(); + + // 8 points with known ground truth + tm = geometry::TriangleMesh({{0, 0, 0}, + {0, 0, 1}, + {0, 2, 0}, + {0, 2, 1}, + {3, 0, 0}, + {3, 0, 1}, + {3, 2, 0}, + {3, 2, 1}}, + {{0, 1, 2}, + {1, 2, 3}, + {4, 5, 6}, + {5, 6, 7}, + {0, 1, 4}, + {1, 4, 5}, + {2, 3, 6}, + {3, 6, 7}}); + obb = tm.GetMinimalOrientedBoundingBox(); + EXPECT_EQ(obb.center_, Eigen::Vector3d(1.5, 1, 0.5)); + EXPECT_EQ(obb.extent_, Eigen::Vector3d(3, 2, 1)); + EXPECT_EQ(obb.color_, Eigen::Vector3d(1, 1, 1)); + ExpectEQ(Sort(obb.GetBoxPoints()), + Sort(std::vector({{0, 0, 0}, + {0, 0, 1}, + {0, 2, 0}, + {0, 2, 1}, + {3, 0, 0}, + {3, 0, 1}, + {3, 2, 0}, + {3, 2, 1}}))); + + // Check for a bug where the OBB rotation contained a reflection for this + // example. + tm = geometry::TriangleMesh({{0, 2, 4}, {7, 9, 1}, {5, 2, 0}, {3, 8, 7}}, + {{0, 1, 2}, {1, 2, 3}}); + obb = tm.GetMinimalOrientedBoundingBox(); + EXPECT_GT(obb.R_.determinant(), 0.999); + + // should always be equal/smaller than axis aligned- & oriented bounding box + tm = geometry::TriangleMesh({{0.866, 0.474, 0.659}, + {0.943, 0.025, 0.789}, + {0.386, 0.264, 0.691}, + {0.938, 0.588, 0.496}, + {0.221, 0.116, 0.257}, + {0.744, 0.182, 0.052}, + {0.019, 0.525, 0.699}, + {0.722, 0.134, 0.668}}, + {{6, 5, 4}, + {6, 3, 5}, + {2, 6, 4}, + {6, 2, 0}, + {3, 6, 0}, + {5, 3, 1}, + {3, 0, 1}, + {7, 1, 2}, + {1, 0, 2}, + {4, 1, 7}, + {4, 5, 1}, + {7, 2, 4}}); + geometry::OrientedBoundingBox mobb = tm.GetMinimalOrientedBoundingBox(); + obb = tm.GetOrientedBoundingBox(); + geometry::AxisAlignedBoundingBox aabb = tm.GetAxisAlignedBoundingBox(); + EXPECT_GT(obb.Volume(), mobb.Volume()); + EXPECT_GT(aabb.Volume(), mobb.Volume()); +} + TEST(TriangleMesh, Transform) { std::vector ref_vertices = { {1.411252, 4.274168, 3.130918}, {1.231757, 4.154505, 3.183678}, @@ -373,6 +599,125 @@ TEST(TriangleMesh, OperatorADD) { } } +TEST(TriangleMesh, OperatorAdditionAssignment) { + const size_t size = 100; + const size_t texture_size = 10; + + // Define the minimum and maximum bounds for random data generation + Eigen::Vector3d dmin(0.0, 0.0, 0.0); + Eigen::Vector3d dmax(1000.0, 1000.0, 1000.0); + Eigen::Vector3i imin(0, 0, 0); + Eigen::Vector3i imax(size - 1, size - 1, size - 1); + Eigen::Vector2d uvmin(0.0, 0.0); + Eigen::Vector2d uvmax(1.0, 1.0); + + // Mesh 0 contains only UVs but no textures and material ids + geometry::TriangleMesh tm0; + tm0.vertices_.resize(size); + tm0.triangles_.resize(size); + tm0.triangle_uvs_.resize(3 * size); + + // Mesh 1 contains all of UVS, textures and material ids + geometry::TriangleMesh tm1; + tm1.vertices_.resize(size); + tm1.triangles_.resize(size); + tm1.triangle_uvs_.resize(3 * size); + tm1.triangle_material_ids_.resize(size); + tm1.textures_.resize(texture_size); + + // Mesh 2 does not contains any of UVs, textures or material ids + geometry::TriangleMesh tm2; + tm2.vertices_.resize(size); + tm2.triangles_.resize(size); + + // Randomly generate data for tm0, tm1 and tm2 + Rand(tm0.vertices_, dmin, dmax, 0); + Rand(tm0.triangles_, imin, imax, 0); + std::vector + tm0_triangle_uvs(3 * size); + Rand(tm0_triangle_uvs, uvmin, uvmax, 0); + tm0.triangle_uvs_ = std::vector(tm0_triangle_uvs.begin(), + tm0_triangle_uvs.end()); + + Rand(tm1.vertices_, dmin, dmax, 0); + Rand(tm1.triangles_, imin, imax, 0); + std::vector + tm1_triangle_uvs(3 * size); + Rand(tm1_triangle_uvs, uvmin, uvmax, 0); + tm1.triangle_uvs_ = std::vector(tm1_triangle_uvs.begin(), + tm1_triangle_uvs.end()); + for (size_t i = 0; i < texture_size; i++) { + geometry::Image texture_image; + texture_image.Prepare(100, 100, 3, 1); + Rand(texture_image.data_, 0, 255, 0); + tm1.textures_[i] = texture_image; + } + Rand(tm1.triangle_material_ids_, 0, texture_size, 0); + + Rand(tm2.vertices_, dmin, dmax, 0); + Rand(tm2.triangles_, imin, imax, 0); + + geometry::TriangleMesh temp_tm0 = tm0; + geometry::TriangleMesh temp_tm1 = tm1; + geometry::TriangleMesh temp_tm2 = tm2; + // Function to reset values of temp_tm0, temp_tm1 and temp_tm2 + auto reset_values = [&tm0, &tm1, &tm2](geometry::TriangleMesh &temp_tm0, + geometry::TriangleMesh &temp_tm1, + geometry::TriangleMesh &temp_tm2) { + temp_tm0 = tm0; + temp_tm1 = tm1; + temp_tm2 = tm2; + }; + + // Test addition of tm1 with itself + temp_tm1 += tm1; + EXPECT_EQ(temp_tm1.triangles_.size(), 2 * size); + EXPECT_EQ(temp_tm1.triangle_uvs_.size(), 6 * size); + EXPECT_EQ(temp_tm1.vertices_.size(), 2 * size); + EXPECT_EQ(temp_tm1.textures_.size(), 2 * texture_size); + EXPECT_EQ(temp_tm1.triangle_material_ids_.size(), 2 * size); + for (size_t i = 0; i < size; i++) { + ExpectEQ(temp_tm1.vertices_[i], temp_tm1.vertices_[i + size]); + ExpectEQ(temp_tm1.triangles_[i], + (Eigen::Vector3i)(temp_tm1.triangles_[i + size] - + Eigen::Vector3i(size, size, size))); + EXPECT_EQ(temp_tm1.triangle_material_ids_[i], + temp_tm1.triangle_material_ids_[i + size] - texture_size); + } + for (size_t i = 0; i < 3 * size; i++) { + ExpectEQ(temp_tm1.triangle_uvs_[i], + temp_tm1.triangle_uvs_[i + 3 * size]); + } + for (size_t i = 0; i < texture_size; i++) { + ExpectEQ(temp_tm1.textures_[i].data_, + temp_tm1.textures_[i + texture_size].data_); + } + + // Test addition of tm0 and tm1 + reset_values(temp_tm0, temp_tm1, temp_tm2); + temp_tm0 += tm1; + temp_tm1 += tm0; + ExpectMeshEQ(temp_tm0, temp_tm1); + EXPECT_EQ(temp_tm0.textures_.size(), 0); + EXPECT_EQ(temp_tm0.triangle_material_ids_.size(), 0); + + // Test addition of tm1 and tm2 + reset_values(temp_tm0, temp_tm1, temp_tm2); + temp_tm1 += tm2; + temp_tm2 += tm1; + ExpectMeshEQ(temp_tm1, temp_tm2); + EXPECT_EQ(temp_tm0.textures_.size(), 0); + EXPECT_EQ(temp_tm0.triangle_material_ids_.size(), 0); + + // Test addition of tm2 and tm0 + reset_values(temp_tm0, temp_tm1, temp_tm2); + temp_tm2 += tm0; + temp_tm0 += tm2; + ExpectMeshEQ(temp_tm2, temp_tm0); + EXPECT_EQ(temp_tm0.textures_.size(), 0); + EXPECT_EQ(temp_tm0.triangle_material_ids_.size(), 0); +} + TEST(TriangleMesh, ComputeTriangleNormals) { std::vector ref = {{-0.119231, 0.738792, 0.663303}, {-0.115181, 0.730934, 0.672658}, diff --git a/cpp/tests/geometry/VoxelGrid.cpp b/cpp/tests/geometry/VoxelGrid.cpp index 3108f591dbb..51e13b720a1 100644 --- a/cpp/tests/geometry/VoxelGrid.cpp +++ b/cpp/tests/geometry/VoxelGrid.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/io/FeatureIO.cpp b/cpp/tests/io/FeatureIO.cpp index d4b797dcef6..f747054f80a 100644 --- a/cpp/tests/io/FeatureIO.cpp +++ b/cpp/tests/io/FeatureIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/io/IJsonConvertibleIO.cpp b/cpp/tests/io/IJsonConvertibleIO.cpp index 63a1591a88d..a7761df3a86 100644 --- a/cpp/tests/io/IJsonConvertibleIO.cpp +++ b/cpp/tests/io/IJsonConvertibleIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/io/ImageIO.cpp b/cpp/tests/io/ImageIO.cpp index 4f935503f48..c8950403122 100644 --- a/cpp/tests/io/ImageIO.cpp +++ b/cpp/tests/io/ImageIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/io/OctreeIO.cpp b/cpp/tests/io/OctreeIO.cpp index 1cd425e9582..b7b7b083cf9 100644 --- a/cpp/tests/io/OctreeIO.cpp +++ b/cpp/tests/io/OctreeIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/io/PinholeCameraTrajectoryIO.cpp b/cpp/tests/io/PinholeCameraTrajectoryIO.cpp index a3f8b56cbdb..06eb6681748 100644 --- a/cpp/tests/io/PinholeCameraTrajectoryIO.cpp +++ b/cpp/tests/io/PinholeCameraTrajectoryIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/io/PointCloudIO.cpp b/cpp/tests/io/PointCloudIO.cpp index 78bbcee8eac..5464ad2241b 100644 --- a/cpp/tests/io/PointCloudIO.cpp +++ b/cpp/tests/io/PointCloudIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/io/PoseGraphIO.cpp b/cpp/tests/io/PoseGraphIO.cpp index b54ce26e409..969e9c4f825 100644 --- a/cpp/tests/io/PoseGraphIO.cpp +++ b/cpp/tests/io/PoseGraphIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/io/TriangleMeshIO.cpp b/cpp/tests/io/TriangleMeshIO.cpp index b0ff9814889..48fb541a01f 100644 --- a/cpp/tests/io/TriangleMeshIO.cpp +++ b/cpp/tests/io/TriangleMeshIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/io/VoxelGridIO.cpp b/cpp/tests/io/VoxelGridIO.cpp index 6ae783c1b4e..3fe300da2a5 100644 --- a/cpp/tests/io/VoxelGridIO.cpp +++ b/cpp/tests/io/VoxelGridIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/io/file_format/FileBIN.cpp b/cpp/tests/io/file_format/FileBIN.cpp index a3b8fca4c92..adb4ce3dae4 100644 --- a/cpp/tests/io/file_format/FileBIN.cpp +++ b/cpp/tests/io/file_format/FileBIN.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/io/file_format/FileGLTF.cpp b/cpp/tests/io/file_format/FileGLTF.cpp index 1b5a2a47a64..8a6920276ee 100644 --- a/cpp/tests/io/file_format/FileGLTF.cpp +++ b/cpp/tests/io/file_format/FileGLTF.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/io/file_format/FileJPG.cpp b/cpp/tests/io/file_format/FileJPG.cpp index 45828ad9e37..0ab112ca13a 100644 --- a/cpp/tests/io/file_format/FileJPG.cpp +++ b/cpp/tests/io/file_format/FileJPG.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/io/file_format/FileJSON.cpp b/cpp/tests/io/file_format/FileJSON.cpp index 7db0044a91f..81fa11334f0 100644 --- a/cpp/tests/io/file_format/FileJSON.cpp +++ b/cpp/tests/io/file_format/FileJSON.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/io/file_format/FileLOG.cpp b/cpp/tests/io/file_format/FileLOG.cpp index 05c8a2cd616..222510084bb 100644 --- a/cpp/tests/io/file_format/FileLOG.cpp +++ b/cpp/tests/io/file_format/FileLOG.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/io/file_format/FilePCD.cpp b/cpp/tests/io/file_format/FilePCD.cpp index 66f33d86739..c47caf56546 100644 --- a/cpp/tests/io/file_format/FilePCD.cpp +++ b/cpp/tests/io/file_format/FilePCD.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/io/file_format/FilePLY.cpp b/cpp/tests/io/file_format/FilePLY.cpp index e27e87d13fd..cc74fcbbe40 100644 --- a/cpp/tests/io/file_format/FilePLY.cpp +++ b/cpp/tests/io/file_format/FilePLY.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/io/file_format/FilePNG.cpp b/cpp/tests/io/file_format/FilePNG.cpp index 829fa832feb..e407194dfde 100644 --- a/cpp/tests/io/file_format/FilePNG.cpp +++ b/cpp/tests/io/file_format/FilePNG.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/io/file_format/FilePTS.cpp b/cpp/tests/io/file_format/FilePTS.cpp index 467f24095ae..886055d5ef0 100644 --- a/cpp/tests/io/file_format/FilePTS.cpp +++ b/cpp/tests/io/file_format/FilePTS.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/io/file_format/FileSTL.cpp b/cpp/tests/io/file_format/FileSTL.cpp index 267e4d2fa70..7e16e8f4bd7 100644 --- a/cpp/tests/io/file_format/FileSTL.cpp +++ b/cpp/tests/io/file_format/FileSTL.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/io/file_format/FileXYZ.cpp b/cpp/tests/io/file_format/FileXYZ.cpp index 6a689bcec73..a9d662790ed 100644 --- a/cpp/tests/io/file_format/FileXYZ.cpp +++ b/cpp/tests/io/file_format/FileXYZ.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/io/file_format/FileXYZN.cpp b/cpp/tests/io/file_format/FileXYZN.cpp index 5b9ce27fe07..819d305c983 100644 --- a/cpp/tests/io/file_format/FileXYZN.cpp +++ b/cpp/tests/io/file_format/FileXYZN.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/io/file_format/FileXYZRGB.cpp b/cpp/tests/io/file_format/FileXYZRGB.cpp index 70d1cc1933d..9b83f512633 100644 --- a/cpp/tests/io/file_format/FileXYZRGB.cpp +++ b/cpp/tests/io/file_format/FileXYZRGB.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/io/rpc/RemoteFunctions.cpp b/cpp/tests/io/rpc/RemoteFunctions.cpp index 38e3c61d25f..989d3e5e510 100644 --- a/cpp/tests/io/rpc/RemoteFunctions.cpp +++ b/cpp/tests/io/rpc/RemoteFunctions.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/io/sensor/AzureKinect/AzureKinectSensorConfig.cpp b/cpp/tests/io/sensor/AzureKinect/AzureKinectSensorConfig.cpp index f50ddc14770..ea8a0be6d62 100644 --- a/cpp/tests/io/sensor/AzureKinect/AzureKinectSensorConfig.cpp +++ b/cpp/tests/io/sensor/AzureKinect/AzureKinectSensorConfig.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/ml/ShapeChecking.cpp b/cpp/tests/ml/ShapeChecking.cpp index 75dd57764a0..9095bd0bd66 100644 --- a/cpp/tests/ml/ShapeChecking.cpp +++ b/cpp/tests/ml/ShapeChecking.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/pipelines/integration/ScalableTSDFVolume.cpp b/cpp/tests/pipelines/integration/ScalableTSDFVolume.cpp index ea511904c91..dbf0b4015ae 100644 --- a/cpp/tests/pipelines/integration/ScalableTSDFVolume.cpp +++ b/cpp/tests/pipelines/integration/ScalableTSDFVolume.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/pipelines/integration/UniformTSDFVolume.cpp b/cpp/tests/pipelines/integration/UniformTSDFVolume.cpp index f7b247c5844..a9036f5c2fa 100644 --- a/cpp/tests/pipelines/integration/UniformTSDFVolume.cpp +++ b/cpp/tests/pipelines/integration/UniformTSDFVolume.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/pipelines/odometry/Odometry.cpp b/cpp/tests/pipelines/odometry/Odometry.cpp index 2e598aa8519..3d5e51ffc5d 100644 --- a/cpp/tests/pipelines/odometry/Odometry.cpp +++ b/cpp/tests/pipelines/odometry/Odometry.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/pipelines/odometry/OdometryOption.cpp b/cpp/tests/pipelines/odometry/OdometryOption.cpp index fba8096b164..70ef4c3115a 100644 --- a/cpp/tests/pipelines/odometry/OdometryOption.cpp +++ b/cpp/tests/pipelines/odometry/OdometryOption.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/pipelines/odometry/OdometryTools.cpp b/cpp/tests/pipelines/odometry/OdometryTools.cpp index e72fb2c8d91..5da3d6132c9 100644 --- a/cpp/tests/pipelines/odometry/OdometryTools.cpp +++ b/cpp/tests/pipelines/odometry/OdometryTools.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/pipelines/odometry/OdometryTools.h b/cpp/tests/pipelines/odometry/OdometryTools.h index e435345793c..f690d087800 100644 --- a/cpp/tests/pipelines/odometry/OdometryTools.h +++ b/cpp/tests/pipelines/odometry/OdometryTools.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/pipelines/odometry/RGBDOdometryJacobianFromColorTerm.cpp b/cpp/tests/pipelines/odometry/RGBDOdometryJacobianFromColorTerm.cpp index 02bea126a8b..1e65a8d0121 100644 --- a/cpp/tests/pipelines/odometry/RGBDOdometryJacobianFromColorTerm.cpp +++ b/cpp/tests/pipelines/odometry/RGBDOdometryJacobianFromColorTerm.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/pipelines/odometry/RGBDOdometryJacobianFromHybridTerm.cpp b/cpp/tests/pipelines/odometry/RGBDOdometryJacobianFromHybridTerm.cpp index e71fd432d83..a79ddbf2da5 100644 --- a/cpp/tests/pipelines/odometry/RGBDOdometryJacobianFromHybridTerm.cpp +++ b/cpp/tests/pipelines/odometry/RGBDOdometryJacobianFromHybridTerm.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/pipelines/registration/CorrespondenceChecker.cpp b/cpp/tests/pipelines/registration/CorrespondenceChecker.cpp index 6a5a060e7d4..f8c95b0cb1a 100644 --- a/cpp/tests/pipelines/registration/CorrespondenceChecker.cpp +++ b/cpp/tests/pipelines/registration/CorrespondenceChecker.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/pipelines/registration/FastGlobalRegistration.cpp b/cpp/tests/pipelines/registration/FastGlobalRegistration.cpp index 99f1722c260..c2b4367a77f 100644 --- a/cpp/tests/pipelines/registration/FastGlobalRegistration.cpp +++ b/cpp/tests/pipelines/registration/FastGlobalRegistration.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/pipelines/registration/Feature.cpp b/cpp/tests/pipelines/registration/Feature.cpp index 359a7530c77..77beaaf55c9 100644 --- a/cpp/tests/pipelines/registration/Feature.cpp +++ b/cpp/tests/pipelines/registration/Feature.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/pipelines/registration/GeneralizedICP.cpp b/cpp/tests/pipelines/registration/GeneralizedICP.cpp index a8601b24e71..60ec8479992 100644 --- a/cpp/tests/pipelines/registration/GeneralizedICP.cpp +++ b/cpp/tests/pipelines/registration/GeneralizedICP.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // @author Ignacio Vizzo [ivizzo@uni-bonn.de] diff --git a/cpp/tests/pipelines/registration/GlobalOptimization.cpp b/cpp/tests/pipelines/registration/GlobalOptimization.cpp index 9016c716acb..8c3290dbec1 100644 --- a/cpp/tests/pipelines/registration/GlobalOptimization.cpp +++ b/cpp/tests/pipelines/registration/GlobalOptimization.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/pipelines/registration/GlobalOptimizationConvergenceCriteria.cpp b/cpp/tests/pipelines/registration/GlobalOptimizationConvergenceCriteria.cpp index eca671b1d45..e05e7a0c45b 100644 --- a/cpp/tests/pipelines/registration/GlobalOptimizationConvergenceCriteria.cpp +++ b/cpp/tests/pipelines/registration/GlobalOptimizationConvergenceCriteria.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/pipelines/registration/PoseGraph.cpp b/cpp/tests/pipelines/registration/PoseGraph.cpp index e286e66be0b..41e27e85422 100644 --- a/cpp/tests/pipelines/registration/PoseGraph.cpp +++ b/cpp/tests/pipelines/registration/PoseGraph.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/pipelines/registration/Registration.cpp b/cpp/tests/pipelines/registration/Registration.cpp index e160d2a2588..3d66e393e8c 100644 --- a/cpp/tests/pipelines/registration/Registration.cpp +++ b/cpp/tests/pipelines/registration/Registration.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/pipelines/registration/TransformationEstimation.cpp b/cpp/tests/pipelines/registration/TransformationEstimation.cpp index 28d03558024..96fb8333cb7 100644 --- a/cpp/tests/pipelines/registration/TransformationEstimation.cpp +++ b/cpp/tests/pipelines/registration/TransformationEstimation.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/t/geometry/AxisAlignedBoundingBox.cpp b/cpp/tests/t/geometry/AxisAlignedBoundingBox.cpp index 54405b414ff..2139b40263c 100644 --- a/cpp/tests/t/geometry/AxisAlignedBoundingBox.cpp +++ b/cpp/tests/t/geometry/AxisAlignedBoundingBox.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/t/geometry/Image.cpp b/cpp/tests/t/geometry/Image.cpp index 1b9fa2112ea..626c9725c53 100644 --- a/cpp/tests/t/geometry/Image.cpp +++ b/cpp/tests/t/geometry/Image.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -264,7 +264,7 @@ TEST_P(ImagePermuteDevices, FilterBilateral) { core::Tensor(input_data, {5, 5, 1}, core::Float32, device); t::geometry::Image im(data); - if (!t::geometry::Image::HAVE_IPPICV && device.IsCPU()) { + if (!t::geometry::Image::HAVE_IPP && device.IsCPU()) { ASSERT_THROW(im.FilterBilateral(3, 10, 10), std::runtime_error); } else { im = im.FilterBilateral(3, 10, 10); @@ -304,7 +304,7 @@ TEST_P(ImagePermuteDevices, FilterBilateral) { core::Tensor(input_data, {5, 5, 1}, core::UInt8, device); t::geometry::Image im(data); - if (!t::geometry::Image::HAVE_IPPICV && device.IsCPU()) { + if (!t::geometry::Image::HAVE_IPP && device.IsCPU()) { ASSERT_THROW(im.FilterBilateral(3, 5, 5), std::runtime_error); } else { im = im.FilterBilateral(3, 5, 5); @@ -343,7 +343,7 @@ TEST_P(ImagePermuteDevices, FilterGaussian) { core::Tensor data = core::Tensor(input_data, {5, 5, 1}, core::Float32, device); t::geometry::Image im(data); - if (!t::geometry::Image::HAVE_IPPICV && device.IsCPU()) { + if (!t::geometry::Image::HAVE_IPP && device.IsCPU()) { ASSERT_THROW(im.FilterGaussian(3), std::runtime_error); } else { im = im.FilterGaussian(3); @@ -377,7 +377,7 @@ TEST_P(ImagePermuteDevices, FilterGaussian) { core::Tensor data = core::Tensor(input_data, {5, 5, 1}, core::UInt8, device); t::geometry::Image im(data); - if (!t::geometry::Image::HAVE_IPPICV && device.IsCPU()) { + if (!t::geometry::Image::HAVE_IPP && device.IsCPU()) { ASSERT_THROW(im.FilterGaussian(3), std::runtime_error); } else { im = im.FilterGaussian(3); @@ -417,7 +417,7 @@ TEST_P(ImagePermuteDevices, Filter) { core::Tensor kernel = core::Tensor(kernel_data, {5, 5}, core::Float32, device); t::geometry::Image im(data); - if (!t::geometry::Image::HAVE_IPPICV && device.IsCPU()) { + if (!t::geometry::Image::HAVE_IPP && device.IsCPU()) { ASSERT_THROW(im.Filter(kernel), std::runtime_error); } else { t::geometry::Image im_new = im.Filter(kernel); @@ -463,7 +463,7 @@ TEST_P(ImagePermuteDevices, Filter) { core::Tensor kernel = core::Tensor(kernel_data, {5, 5}, core::Float32, device); t::geometry::Image im(data); - if (!t::geometry::Image::HAVE_IPPICV && device.IsCPU()) { + if (!t::geometry::Image::HAVE_IPP && device.IsCPU()) { ASSERT_THROW(im.Filter(kernel), std::runtime_error); } else { im = im.Filter(kernel); @@ -507,7 +507,7 @@ TEST_P(ImagePermuteDevices, FilterSobel) { core::Tensor(input_data, {5, 5, 1}, core::Float32, device); t::geometry::Image im(data); t::geometry::Image dx, dy; - if (!t::geometry::Image::HAVE_IPPICV && device.IsCPU()) { + if (!t::geometry::Image::HAVE_IPP && device.IsCPU()) { ASSERT_THROW(im.FilterSobel(3), std::runtime_error); } else { std::tie(dx, dy) = im.FilterSobel(3); @@ -525,7 +525,7 @@ TEST_P(ImagePermuteDevices, FilterSobel) { .To(core::UInt8); t::geometry::Image im(data); t::geometry::Image dx, dy; - if (!t::geometry::Image::HAVE_IPPICV && device.IsCPU()) { + if (!t::geometry::Image::HAVE_IPP && device.IsCPU()) { ASSERT_THROW(im.FilterSobel(3), std::runtime_error); } else { std::tie(dx, dy) = im.FilterSobel(3); @@ -563,7 +563,7 @@ TEST_P(ImagePermuteDevices, Resize) { core::Tensor data = core::Tensor(input_data, {6, 6, 1}, core::Float32, device); t::geometry::Image im(data); - if (!t::geometry::Image::HAVE_IPPICV && device.IsCPU()) { + if (!t::geometry::Image::HAVE_IPP && device.IsCPU()) { ASSERT_THROW( im.Resize(0.5, t::geometry::Image::InterpType::Nearest), std::runtime_error); @@ -595,7 +595,7 @@ TEST_P(ImagePermuteDevices, Resize) { core::Tensor data = core::Tensor(input_data, {6, 6, 1}, core::UInt8, device); t::geometry::Image im(data); - if (!t::geometry::Image::HAVE_IPPICV && device.IsCPU()) { + if (!t::geometry::Image::HAVE_IPP && device.IsCPU()) { ASSERT_THROW(im.Resize(0.5, t::geometry::Image::InterpType::Super), std::runtime_error); } else { @@ -611,7 +611,7 @@ TEST_P(ImagePermuteDevices, Resize) { EXPECT_TRUE(im_low.AsTensor().AllClose(core::Tensor( output_ref_npp, {3, 3, 1}, core::UInt8, device))); - // Check output in the CI to see if other inteprolations works + // Check output in the CI to see if other interpolations works // with other platforms im_low = im.Resize(0.5, t::geometry::Image::InterpType::Linear); utility::LogInfo("Linear(impl. dependent): {}", @@ -652,7 +652,7 @@ TEST_P(ImagePermuteDevices, PyrDown) { core::Tensor(input_data, {6, 6, 1}, core::Float32, device); t::geometry::Image im(data); - if (!t::geometry::Image::HAVE_IPPICV && device.IsCPU()) { + if (!t::geometry::Image::HAVE_IPP && device.IsCPU()) { ASSERT_THROW(im.PyrDown(), std::runtime_error); } else { im = im.PyrDown(); @@ -684,7 +684,7 @@ TEST_P(ImagePermuteDevices, PyrDown) { core::Tensor(input_data, {6, 6, 1}, core::UInt8, device); t::geometry::Image im(data); - if (!t::geometry::Image::HAVE_IPPICV && device.IsCPU()) { + if (!t::geometry::Image::HAVE_IPP && device.IsCPU()) { ASSERT_THROW(im.PyrDown(), std::runtime_error); } else { im = im.PyrDown(); @@ -732,8 +732,7 @@ TEST_P(ImagePermuteDevices, Dilate) { core::Tensor t_input_uint8_t = t_input.To(core::UInt8); // normal static_cast is OK t::geometry::Image input_uint8_t(t_input_uint8_t); - if (!t::geometry::Image::HAVE_IPPICV && - device.IsCPU()) { // Not Implemented + if (!t::geometry::Image::HAVE_IPP && device.IsCPU()) { // Not Implemented ASSERT_THROW(input_uint8_t.Dilate(kernel_size), std::runtime_error); } else { output = input_uint8_t.Dilate(kernel_size); @@ -748,8 +747,7 @@ TEST_P(ImagePermuteDevices, Dilate) { core::Tensor t_input_uint16_t = t_input.To(core::UInt16); // normal static_cast is OK t::geometry::Image input_uint16_t(t_input_uint16_t); - if (!t::geometry::Image::HAVE_IPPICV && - device.IsCPU()) { // Not Implemented + if (!t::geometry::Image::HAVE_IPP && device.IsCPU()) { // Not Implemented ASSERT_THROW(input_uint16_t.Dilate(kernel_size), std::runtime_error); } else { output = input_uint16_t.Dilate(kernel_size); @@ -761,8 +759,7 @@ TEST_P(ImagePermuteDevices, Dilate) { } // Float32 - if (!t::geometry::Image::HAVE_IPPICV && - device.IsCPU()) { // Not Implemented + if (!t::geometry::Image::HAVE_IPP && device.IsCPU()) { // Not Implemented ASSERT_THROW(input.Dilate(kernel_size), std::runtime_error); } else { output = input.Dilate(kernel_size); @@ -886,8 +883,7 @@ TEST_P(ImagePermuteDevices, DISABLED_CreateNormalMap_Visual) { // We have to apply a bilateral filter, otherwise normals would be too // noisy. auto depth_clipped = depth.ClipTransform(1000.0, 0.0, 3.0, invalid_fill); - if (!t::geometry::Image::HAVE_IPPICV && - device.IsCPU()) { // Not Implemented + if (!t::geometry::Image::HAVE_IPP && device.IsCPU()) { // Not Implemented ASSERT_THROW(depth_clipped.FilterBilateral(5, 5.0, 10.0), std::runtime_error); } else { diff --git a/cpp/tests/t/geometry/LineSet.cpp b/cpp/tests/t/geometry/LineSet.cpp index dbc774f2b1d..30c86eaa78f 100644 --- a/cpp/tests/t/geometry/LineSet.cpp +++ b/cpp/tests/t/geometry/LineSet.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/t/geometry/OrientedBoundingBox.cpp b/cpp/tests/t/geometry/OrientedBoundingBox.cpp index 95a0b4fe983..5a730f4cfb2 100644 --- a/cpp/tests/t/geometry/OrientedBoundingBox.cpp +++ b/cpp/tests/t/geometry/OrientedBoundingBox.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/t/geometry/PointCloud.cpp b/cpp/tests/t/geometry/PointCloud.cpp index 0b4d7365de6..2a74c9c75c1 100644 --- a/cpp/tests/t/geometry/PointCloud.cpp +++ b/cpp/tests/t/geometry/PointCloud.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -692,10 +692,10 @@ TEST_P(PointCloudPermuteDevices, CreateFromRGBDImage) { TEST_P(PointCloudPermuteDevices, CreateFromRGBDOrDepthImageWithNormals) { core::Device device = GetParam(); - if (!t::geometry::Image::HAVE_IPPICV && + if (!t::geometry::Image::HAVE_IPP && device.GetType() == core::Device::DeviceType::CPU) { // FilterBilateral on CPU - // needs IPPICV + // needs IPP return; } @@ -954,11 +954,17 @@ TEST_P(PointCloudPermuteDevices, FarthestPointDownSample) { {0, 1.0, 1.0}, {1.0, 1.0, 1.5}}, device)); + auto pcd_small_down = pcd_small.FarthestPointDownSample(4); - EXPECT_TRUE(pcd_small_down.GetPointPositions().AllClose( - core::Tensor::Init( - {{0, 2.0, 0}, {1.0, 1.0, 0}, {1.0, 0, 1.0}, {0, 1.0, 1.0}}, - device))); + auto expected = core::Tensor::Init( + {{0, 2.0, 0}, {1.0, 1.0, 0}, {1.0, 0, 1.0}, {0, 1.0, 1.0}}, device); + + auto pcd_small_down_2 = pcd_small.FarthestPointDownSample(4, 4); + auto expected_2 = core::Tensor::Init( + {{0, 2.0, 0}, {1.0, 1.0, 0}, {0, 0, 1.0}, {1.0, 1.0, 1.5}}, device); + + EXPECT_TRUE(pcd_small_down.GetPointPositions().AllClose(expected)); + EXPECT_TRUE(pcd_small_down_2.GetPointPositions().AllClose(expected_2)); } TEST_P(PointCloudPermuteDevices, RemoveRadiusOutliers) { diff --git a/cpp/tests/t/geometry/TensorMap.cpp b/cpp/tests/t/geometry/TensorMap.cpp index 372c6b82270..edf80230073 100644 --- a/cpp/tests/t/geometry/TensorMap.cpp +++ b/cpp/tests/t/geometry/TensorMap.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -32,6 +32,13 @@ TEST_P(TensorMapPermuteDevices, Constructor) { // Primary key is required. EXPECT_ANY_THROW(t::geometry::TensorMap()); + // Delete primary key. + EXPECT_ANY_THROW(tm0.Erase("positions")); + + // Reserved keys. + EXPECT_ANY_THROW(tm0.insert( + {"primary_key", core::Tensor::Zeros({2, 3}, dtype, device)})); + // Iterators. std::map tensor_map( {{"positions", core::Tensor::Zeros({10, 3}, dtype, device)}, diff --git a/cpp/tests/t/geometry/TriangleMesh.cpp b/cpp/tests/t/geometry/TriangleMesh.cpp index f4af2974f20..7bca9b4a55e 100644 --- a/cpp/tests/t/geometry/TriangleMesh.cpp +++ b/cpp/tests/t/geometry/TriangleMesh.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -12,7 +12,9 @@ #include "core/CoreTest.h" #include "open3d/core/Dtype.h" #include "open3d/core/EigenConverter.h" +#include "open3d/core/Tensor.h" #include "open3d/core/TensorCheck.h" +#include "open3d/t/geometry/PointCloud.h" #include "tests/Tests.h" namespace open3d { @@ -1439,5 +1441,85 @@ TEST_P(TriangleMeshPermuteDevices, RemoveNonManifoldEdges) { device)}); EXPECT_TRUE(mesh.GetTriangleAttr("labels").AllClose(expected_labels)); } + +TEST_P(TriangleMeshPermuteDevices, SamplePointsUniformly) { + auto mesh_empty = t::geometry::TriangleMesh(); + EXPECT_THROW(mesh_empty.SamplePointsUniformly(100), std::runtime_error); + + core::Tensor vertices = + core::Tensor::Init({{0, 0, 0}, {1, 0, 0}, {0, 1, 0}}); + core::Tensor triangles = core::Tensor::Init({{0, 1, 2}}); + + auto mesh_simple = t::geometry::TriangleMesh(vertices, triangles); + + int64_t n_points = 2; + auto pcd_simple = mesh_simple.SamplePointsUniformly(n_points); + EXPECT_TRUE(pcd_simple.GetPointPositions().GetLength() == n_points); + EXPECT_FALSE(pcd_simple.HasPointColors()); + EXPECT_FALSE(pcd_simple.HasPointNormals()); + + core::Tensor colors = + core::Tensor::Init({{1, 0, 0}, {1, 0, 0}, {1, 0, 0}}); + core::Tensor normals = + core::Tensor::Init({{0, 1, 0}, {0, 1, 0}, {0, 1, 0}}); + mesh_simple.SetVertexColors(colors); + mesh_simple.SetVertexNormals(normals); + pcd_simple = mesh_simple.SamplePointsUniformly(n_points); + EXPECT_TRUE(pcd_simple.GetPointPositions().GetLength() == n_points); + EXPECT_TRUE(pcd_simple.GetPointColors().GetLength() == n_points); + EXPECT_TRUE(pcd_simple.GetPointNormals().GetLength() == n_points); + + core::Tensor ref_point_colors = core::Tensor::Init({1, 0, 0}); + core::Tensor ref_point_normals = core::Tensor::Init({0, 1, 0}); + + for (int64_t pidx = 0; pidx < n_points; ++pidx) { + EXPECT_TRUE( + pcd_simple.GetPointColors()[pidx].AllClose(ref_point_colors)); + EXPECT_TRUE( + pcd_simple.GetPointNormals()[pidx].AllClose(ref_point_normals)); + } + + // use triangle normal instead of the vertex normals + EXPECT_FALSE(mesh_simple.HasTriangleNormals()); + // Use Float64 positions and normals and uint8_t colors + mesh_simple.SetVertexNormals(normals.To(core::Float64)); + mesh_simple.SetVertexPositions(vertices.To(core::Float64)); + // new triangle normals + ref_point_normals = core::Tensor::Init({0, 0, 1}); + colors = core::Tensor::Init( + {{255, 0, 0}, {255, 0, 0}, {255, 0, 0}}); + mesh_simple.SetVertexColors(colors); + pcd_simple = mesh_simple.SamplePointsUniformly( + n_points, /*use_triangle_normal=*/true); + // the mesh now has triangle normals as a side effect. + EXPECT_TRUE(mesh_simple.HasTriangleNormals()); + EXPECT_TRUE(pcd_simple.GetPointPositions().GetLength() == n_points); + EXPECT_TRUE(pcd_simple.GetPointColors().GetLength() == n_points); + EXPECT_TRUE(pcd_simple.GetPointNormals().GetLength() == n_points); + + for (int64_t pidx = 0; pidx < n_points; ++pidx) { + // colors are still the same (Float32) + EXPECT_TRUE( + pcd_simple.GetPointColors()[pidx].AllClose(ref_point_colors)); + EXPECT_TRUE( + pcd_simple.GetPointNormals()[pidx].AllClose(ref_point_normals)); + } + + // use triangle normal, this time the mesh has no vertex normals + mesh_simple.RemoveVertexAttr("normals"); + pcd_simple = mesh_simple.SamplePointsUniformly( + n_points, /*use_triangle_normal=*/true); + EXPECT_TRUE(pcd_simple.GetPointPositions().GetLength() == n_points); + EXPECT_TRUE(pcd_simple.GetPointColors().GetLength() == n_points); + EXPECT_TRUE(pcd_simple.GetPointNormals().GetLength() == n_points); + + for (int64_t pidx = 0; pidx < n_points; ++pidx) { + EXPECT_TRUE( + pcd_simple.GetPointColors()[pidx].AllClose(ref_point_colors)); + EXPECT_TRUE( + pcd_simple.GetPointNormals()[pidx].AllClose(ref_point_normals)); + } +} + } // namespace tests } // namespace open3d diff --git a/cpp/tests/t/geometry/VoxelBlockGrid.cpp b/cpp/tests/t/geometry/VoxelBlockGrid.cpp index 570a1868c0c..cb47a424ca1 100644 --- a/cpp/tests/t/geometry/VoxelBlockGrid.cpp +++ b/cpp/tests/t/geometry/VoxelBlockGrid.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/t/geometry/VtkUtils.cpp b/cpp/tests/t/geometry/VtkUtils.cpp index ad6af29812d..b45e33e9dec 100644 --- a/cpp/tests/t/geometry/VtkUtils.cpp +++ b/cpp/tests/t/geometry/VtkUtils.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/t/io/ImageIO.cpp b/cpp/tests/t/io/ImageIO.cpp index 12fb7dd511c..db6be27041c 100644 --- a/cpp/tests/t/io/ImageIO.cpp +++ b/cpp/tests/t/io/ImageIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/t/io/NumpyIO.cpp b/cpp/tests/t/io/NumpyIO.cpp index e80d7ff6fc9..2c76067740d 100644 --- a/cpp/tests/t/io/NumpyIO.cpp +++ b/cpp/tests/t/io/NumpyIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/t/io/PointCloudIO.cpp b/cpp/tests/t/io/PointCloudIO.cpp index e6f38270fcb..1de79086a17 100644 --- a/cpp/tests/t/io/PointCloudIO.cpp +++ b/cpp/tests/t/io/PointCloudIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/t/io/TriangleMeshIO.cpp b/cpp/tests/t/io/TriangleMeshIO.cpp index acfd8f1234f..f5333226d9c 100644 --- a/cpp/tests/t/io/TriangleMeshIO.cpp +++ b/cpp/tests/t/io/TriangleMeshIO.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/t/pipelines/TransformationConverter.cpp b/cpp/tests/t/pipelines/TransformationConverter.cpp index abb868dfdb8..5d8bd0d8434 100644 --- a/cpp/tests/t/pipelines/TransformationConverter.cpp +++ b/cpp/tests/t/pipelines/TransformationConverter.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/t/pipelines/odometry/RGBDOdometry.cpp b/cpp/tests/t/pipelines/odometry/RGBDOdometry.cpp index aed406fb98e..3bb7ee36142 100644 --- a/cpp/tests/t/pipelines/odometry/RGBDOdometry.cpp +++ b/cpp/tests/t/pipelines/odometry/RGBDOdometry.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -39,7 +39,7 @@ core::Tensor CreateIntrisicTensor() { TEST_P(OdometryPermuteDevices, ComputeOdometryResultPointToPlane) { core::Device device = GetParam(); - if (!t::geometry::Image::HAVE_IPPICV && device.IsCPU()) { + if (!t::geometry::Image::HAVE_IPP && device.IsCPU()) { return; } @@ -106,7 +106,7 @@ TEST_P(OdometryPermuteDevices, ComputeOdometryResultPointToPlane) { TEST_P(OdometryPermuteDevices, RGBDOdometryMultiScalePointToPlane) { core::Device device = GetParam(); - if (!t::geometry::Image::HAVE_IPPICV && device.IsCPU()) { + if (!t::geometry::Image::HAVE_IPP && device.IsCPU()) { return; } @@ -173,7 +173,7 @@ TEST_P(OdometryPermuteDevices, RGBDOdometryMultiScalePointToPlane) { TEST_P(OdometryPermuteDevices, RGBDOdometryMultiScaleIntensity) { core::Device device = GetParam(); - if (!t::geometry::Image::HAVE_IPPICV && device.IsCPU()) { + if (!t::geometry::Image::HAVE_IPP && device.IsCPU()) { return; } @@ -240,7 +240,7 @@ TEST_P(OdometryPermuteDevices, RGBDOdometryMultiScaleIntensity) { TEST_P(OdometryPermuteDevices, RGBDOdometryMultiScaleHybrid) { core::Device device = GetParam(); - if (!t::geometry::Image::HAVE_IPPICV && device.IsCPU()) { + if (!t::geometry::Image::HAVE_IPP && device.IsCPU()) { return; } diff --git a/cpp/tests/t/pipelines/registration/Feature.cpp b/cpp/tests/t/pipelines/registration/Feature.cpp index f4eb9dffa6d..d4adc0958b3 100644 --- a/cpp/tests/t/pipelines/registration/Feature.cpp +++ b/cpp/tests/t/pipelines/registration/Feature.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- @@ -25,6 +25,38 @@ INSTANTIATE_TEST_SUITE_P(Feature, FeaturePermuteDevices, testing::ValuesIn(PermuteDevices::TestCases())); +TEST_P(FeaturePermuteDevices, SelectByIndex) { + core::Device device = GetParam(); + + open3d::geometry::PointCloud pcd_legacy; + data::BunnyMesh bunny; + open3d::io::ReadPointCloud(bunny.GetPath(), pcd_legacy); + + pcd_legacy.EstimateNormals(); + // Convert to float64 to avoid precision loss. + const auto pcd = t::geometry::PointCloud::FromLegacy(pcd_legacy, + core::Float64, device); + + const auto fpfh = pipelines::registration::ComputeFPFHFeature( + pcd_legacy, geometry::KDTreeSearchParamHybrid(0.01, 100)); + const auto fpfh_t = + t::pipelines::registration::ComputeFPFHFeature(pcd, 100, 0.01); + + const auto selected_fpfh = + fpfh->SelectByIndex({53, 194, 839, 2543, 6391, 29483}, false); + const auto selected_indeces_t = + core::TensorKey::IndexTensor(core::Tensor::Init( + {53, 194, 839, 2543, 6391, 29483}, device)); + const auto selected_fpfh_t = fpfh_t.GetItem(selected_indeces_t); + + EXPECT_TRUE(selected_fpfh_t.AllClose( + core::eigen_converter::EigenMatrixToTensor(selected_fpfh->data_) + .T() + .To(selected_fpfh_t.GetDevice(), + selected_fpfh_t.GetDtype()), + 1e-4, 1e-4)); +} + TEST_P(FeaturePermuteDevices, ComputeFPFHFeature) { core::Device device = GetParam(); diff --git a/cpp/tests/t/pipelines/registration/Registration.cpp b/cpp/tests/t/pipelines/registration/Registration.cpp index 75fd20a530d..a29cc99b859 100644 --- a/cpp/tests/t/pipelines/registration/Registration.cpp +++ b/cpp/tests/t/pipelines/registration/Registration.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/t/pipelines/registration/TransformationEstimation.cpp b/cpp/tests/t/pipelines/registration/TransformationEstimation.cpp index e87c7975e22..2daca846d0a 100644 --- a/cpp/tests/t/pipelines/registration/TransformationEstimation.cpp +++ b/cpp/tests/t/pipelines/registration/TransformationEstimation.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/t/pipelines/slac/ControlGrid.cpp b/cpp/tests/t/pipelines/slac/ControlGrid.cpp index 14d51e94b46..98bce9d5ef2 100644 --- a/cpp/tests/t/pipelines/slac/ControlGrid.cpp +++ b/cpp/tests/t/pipelines/slac/ControlGrid.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/t/pipelines/slac/SLAC.cpp b/cpp/tests/t/pipelines/slac/SLAC.cpp index fe2813b37eb..bc31cb31044 100644 --- a/cpp/tests/t/pipelines/slac/SLAC.cpp +++ b/cpp/tests/t/pipelines/slac/SLAC.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/test_utility/Compare.cpp b/cpp/tests/test_utility/Compare.cpp index c8c2523a94c..fe6d4dd7e19 100644 --- a/cpp/tests/test_utility/Compare.cpp +++ b/cpp/tests/test_utility/Compare.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/test_utility/Compare.h b/cpp/tests/test_utility/Compare.h index 5e81c5fe07d..ac3d1888999 100644 --- a/cpp/tests/test_utility/Compare.h +++ b/cpp/tests/test_utility/Compare.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/test_utility/Print.h b/cpp/tests/test_utility/Print.h index 58b4fa9123c..c0e4ac98393 100644 --- a/cpp/tests/test_utility/Print.h +++ b/cpp/tests/test_utility/Print.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/test_utility/Rand.cpp b/cpp/tests/test_utility/Rand.cpp index b4ae3ab5545..9b9764c283d 100644 --- a/cpp/tests/test_utility/Rand.cpp +++ b/cpp/tests/test_utility/Rand.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/test_utility/Rand.h b/cpp/tests/test_utility/Rand.h index c040df229c3..cdb270adf40 100644 --- a/cpp/tests/test_utility/Rand.h +++ b/cpp/tests/test_utility/Rand.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/test_utility/Raw.cpp b/cpp/tests/test_utility/Raw.cpp index e001923f88a..8565d5acdd8 100644 --- a/cpp/tests/test_utility/Raw.cpp +++ b/cpp/tests/test_utility/Raw.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/test_utility/Raw.h b/cpp/tests/test_utility/Raw.h index 1ee7b1aa7ff..f8060732f8b 100644 --- a/cpp/tests/test_utility/Raw.h +++ b/cpp/tests/test_utility/Raw.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/test_utility/Sort.cpp b/cpp/tests/test_utility/Sort.cpp index 0563b0d3326..adde2836e56 100644 --- a/cpp/tests/test_utility/Sort.cpp +++ b/cpp/tests/test_utility/Sort.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/test_utility/Sort.h b/cpp/tests/test_utility/Sort.h index 9270cca629e..69632472296 100644 --- a/cpp/tests/test_utility/Sort.h +++ b/cpp/tests/test_utility/Sort.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/utility/Download.cpp b/cpp/tests/utility/Download.cpp index d98679d17bb..bb52efcf432 100644 --- a/cpp/tests/utility/Download.cpp +++ b/cpp/tests/utility/Download.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/utility/Eigen.cpp b/cpp/tests/utility/Eigen.cpp index 5f1c859f03d..deb09558c53 100644 --- a/cpp/tests/utility/Eigen.cpp +++ b/cpp/tests/utility/Eigen.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/utility/Extract.cpp b/cpp/tests/utility/Extract.cpp index 2ac8b49063c..923aff03bc1 100644 --- a/cpp/tests/utility/Extract.cpp +++ b/cpp/tests/utility/Extract.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/utility/FileSystem.cpp b/cpp/tests/utility/FileSystem.cpp index 2c0359166ef..bfdd2dc28bd 100644 --- a/cpp/tests/utility/FileSystem.cpp +++ b/cpp/tests/utility/FileSystem.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/utility/Helper.cpp b/cpp/tests/utility/Helper.cpp index 2991660d877..f11b7c59380 100644 --- a/cpp/tests/utility/Helper.cpp +++ b/cpp/tests/utility/Helper.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/utility/Helper.ispc b/cpp/tests/utility/Helper.ispc index 018fba0b900..01515166e6b 100644 --- a/cpp/tests/utility/Helper.ispc +++ b/cpp/tests/utility/Helper.ispc @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/utility/IJsonConvertible.cpp b/cpp/tests/utility/IJsonConvertible.cpp index af7cc8d128b..c91c9113d78 100644 --- a/cpp/tests/utility/IJsonConvertible.cpp +++ b/cpp/tests/utility/IJsonConvertible.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/utility/ISAInfo.cpp b/cpp/tests/utility/ISAInfo.cpp index 74fc83710ae..6b929415613 100644 --- a/cpp/tests/utility/ISAInfo.cpp +++ b/cpp/tests/utility/ISAInfo.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/utility/Logging.cpp b/cpp/tests/utility/Logging.cpp index 23cbae2b620..21edb61e260 100644 --- a/cpp/tests/utility/Logging.cpp +++ b/cpp/tests/utility/Logging.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/utility/Preprocessor.cpp b/cpp/tests/utility/Preprocessor.cpp index e167cc99250..1022fc43896 100644 --- a/cpp/tests/utility/Preprocessor.cpp +++ b/cpp/tests/utility/Preprocessor.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/utility/ProgressBar.cpp b/cpp/tests/utility/ProgressBar.cpp index 4641305813c..9ff9e09b6ae 100644 --- a/cpp/tests/utility/ProgressBar.cpp +++ b/cpp/tests/utility/ProgressBar.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/utility/Random.cpp b/cpp/tests/utility/Random.cpp index 8c321f08758..c31c7442f96 100644 --- a/cpp/tests/utility/Random.cpp +++ b/cpp/tests/utility/Random.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/utility/Timer.cpp b/cpp/tests/utility/Timer.cpp index 55bbeeed736..3e80b0481cb 100644 --- a/cpp/tests/utility/Timer.cpp +++ b/cpp/tests/utility/Timer.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tests/visualization/rendering/MaterialModifier.cpp b/cpp/tests/visualization/rendering/MaterialModifier.cpp index a1a6a9246a3..a150e2c99cf 100644 --- a/cpp/tests/visualization/rendering/MaterialModifier.cpp +++ b/cpp/tests/visualization/rendering/MaterialModifier.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tools/ConvertPointCloud.cpp b/cpp/tools/ConvertPointCloud.cpp index a89f3d632b9..eebf4be7df7 100644 --- a/cpp/tools/ConvertPointCloud.cpp +++ b/cpp/tools/ConvertPointCloud.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tools/GLInfo.cpp b/cpp/tools/GLInfo.cpp index af9360cc0d2..fac9a1ae94b 100644 --- a/cpp/tools/GLInfo.cpp +++ b/cpp/tools/GLInfo.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tools/ManuallyAlignPointCloud/AlignmentSession.cpp b/cpp/tools/ManuallyAlignPointCloud/AlignmentSession.cpp index 0d26ecfd75d..6899528b282 100644 --- a/cpp/tools/ManuallyAlignPointCloud/AlignmentSession.cpp +++ b/cpp/tools/ManuallyAlignPointCloud/AlignmentSession.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tools/ManuallyAlignPointCloud/AlignmentSession.h b/cpp/tools/ManuallyAlignPointCloud/AlignmentSession.h index 1763742a733..ff3407437b9 100644 --- a/cpp/tools/ManuallyAlignPointCloud/AlignmentSession.h +++ b/cpp/tools/ManuallyAlignPointCloud/AlignmentSession.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tools/ManuallyAlignPointCloud/ManuallyAlignPointCloud.cpp b/cpp/tools/ManuallyAlignPointCloud/ManuallyAlignPointCloud.cpp index c10f1f93675..9846faa5705 100644 --- a/cpp/tools/ManuallyAlignPointCloud/ManuallyAlignPointCloud.cpp +++ b/cpp/tools/ManuallyAlignPointCloud/ManuallyAlignPointCloud.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tools/ManuallyAlignPointCloud/VisualizerForAlignment.cpp b/cpp/tools/ManuallyAlignPointCloud/VisualizerForAlignment.cpp index 715160bc9e6..261e5146c6c 100644 --- a/cpp/tools/ManuallyAlignPointCloud/VisualizerForAlignment.cpp +++ b/cpp/tools/ManuallyAlignPointCloud/VisualizerForAlignment.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tools/ManuallyAlignPointCloud/VisualizerForAlignment.h b/cpp/tools/ManuallyAlignPointCloud/VisualizerForAlignment.h index 9742890970e..6ce8c049381 100644 --- a/cpp/tools/ManuallyAlignPointCloud/VisualizerForAlignment.h +++ b/cpp/tools/ManuallyAlignPointCloud/VisualizerForAlignment.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tools/ManuallyCropGeometry.cpp b/cpp/tools/ManuallyCropGeometry.cpp index f40c535ca83..e8777e8ac11 100644 --- a/cpp/tools/ManuallyCropGeometry.cpp +++ b/cpp/tools/ManuallyCropGeometry.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tools/MergeMesh.cpp b/cpp/tools/MergeMesh.cpp index df64f2ae54e..e7b9d997246 100644 --- a/cpp/tools/MergeMesh.cpp +++ b/cpp/tools/MergeMesh.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/cpp/tools/ViewGeometry.cpp b/cpp/tools/ViewGeometry.cpp index 09339583699..b31dd110c57 100644 --- a/cpp/tools/ViewGeometry.cpp +++ b/cpp/tools/ViewGeometry.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/docker/Dockerfile.ci b/docker/Dockerfile.ci old mode 100644 new mode 100755 index 81379352f41..189fa6c50b0 --- a/docker/Dockerfile.ci +++ b/docker/Dockerfile.ci @@ -67,34 +67,45 @@ RUN if [ "${BUILD_SYCL_MODULE}" = "ON" ]; then \ rm -rf /etc/apt/sources.list.d/oneAPI.list; \ fi -# Dependencies: basic +# Dependencies: basic and python-build RUN apt-get update && apt-get install -y \ git \ wget \ curl \ build-essential \ pkg-config \ + zlib1g \ + zlib1g-dev \ + libssl-dev \ + libbz2-dev \ + libreadline-dev \ + libsqlite3-dev \ + libncursesw5-dev \ + xz-utils \ + tk-dev \ + libxml2-dev \ + libxmlsec1-dev \ + libffi-dev \ + liblzma-dev \ && rm -rf /var/lib/apt/lists/* -# Miniconda or Intel conda -# The **/open3d/bin paths are used during docker run, in this way docker run +# pyenv +# The pyenv python paths are used during docker run, in this way docker run # does not need to activate the environment again. -ENV PATH="/root/miniconda3/bin:${PATH}" -ENV PATH="/root/miniconda3/envs/open3d/bin:${PATH}" -ENV PATH="/opt/intel/oneapi/intelpython/latest/bin:${PATH}" -ENV PATH="/opt/intel/oneapi/intelpython/latest/envs/open3d/bin:${PATH}" -RUN if [ "${BUILD_SYCL_MODULE}" = "OFF" ]; then \ - wget -q https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh; \ - bash Miniconda3-latest-Linux-x86_64.sh -b; \ - rm Miniconda3-latest-Linux-x86_64.sh; \ - fi -RUN conda --version \ - && conda create -y -n open3d python=${PYTHON_VERSION} - -# Activate open3d virtualenv -# This works during docker build. It becomes the prefix of all RUN commands. -# Ref: https://stackoverflow.com/a/60148365/1255535 -SHELL ["conda", "run", "-n", "open3d", "/bin/bash", "-o", "pipefail", "-c"] +# The soft link from the python patch level version to the python mino version +# ensures python wheel commands (i.e. open3d) are in PATH, since we don't know +# which patch level pyenv will install (latest). +ENV PYENV_ROOT=/root/.pyenv +ENV PATH="$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PYENV_ROOT/versions/$PYTHON_VERSION/bin:$PATH" +RUN curl https://pyenv.run | bash \ + && pyenv update \ + && pyenv install $PYTHON_VERSION \ + && pyenv global $PYTHON_VERSION \ + && pyenv rehash \ + && ln -s $PYENV_ROOT/versions/${PYTHON_VERSION}* $PYENV_ROOT/versions/${PYTHON_VERSION}; +RUN python --version && pip --version + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] # Dependencies: cmake ENV PATH=${HOME}/${CMAKE_VERSION}/bin:${PATH} @@ -130,10 +141,10 @@ RUN CCACHE_DIR=$(ccache -p | grep cache_dir | grep -oE "[^ ]+$") \ && CCACHE_DIR_PARENT=$(dirname ${CCACHE_DIR}) \ && mkdir -p ${CCACHE_DIR_PARENT} \ && cd ${CCACHE_DIR_PARENT} \ - && (wget -q https://storage.googleapis.com/open3d-ci-cache/${CCACHE_TAR_NAME}.tar.gz || true) \ - && if [ -f ${CCACHE_TAR_NAME}.tar.gz ]; then tar -xf ${CCACHE_TAR_NAME}.tar.gz; fi \ + && (wget -q https://storage.googleapis.com/open3d-ci-cache/${CCACHE_TAR_NAME}.tar.xz https://storage.googleapis.com/open3d-ci-cache/${CCACHE_TAR_NAME}.tar.gz || true) \ + && if [ -f ${CCACHE_TAR_NAME}.tar.?z ]; then tar -xf ${CCACHE_TAR_NAME}.tar.?z; fi \ && mkdir -p ${CCACHE_DIR} \ - && ccache -M 5G \ + && ccache -M 4G \ && ccache -s # Checkout Open3D-ML main branch @@ -177,9 +188,11 @@ RUN \ export CMAKE_CXX_COMPILER=icpx; \ export CMAKE_C_COMPILER=icx; \ export GLIBCXX_USE_CXX11_ABI=ON; \ + export BUILD_ISPC_MODULE=OFF; \ else \ export CMAKE_CXX_COMPILER=g++; \ export CMAKE_C_COMPILER=gcc; \ + export BUILD_ISPC_MODULE=ON; \ # TODO: PyTorch still use old CXX ABI, remove this line when PyTorch is updated if [ "$BUILD_PYTORCH_OPS" = "ON" ]; then \ export GLIBCXX_USE_CXX11_ABI=OFF; \ @@ -194,11 +207,12 @@ RUN \ -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} \ -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} \ -DBUILD_SYCL_MODULE=${BUILD_SYCL_MODULE} \ + -DBUILD_ISPC_MODULE=${BUILD_ISPC_MODULE} \ -DDEVELOPER_BUILD=${DEVELOPER_BUILD} \ -DBUILD_LIBREALSENSE=ON \ -DBUILD_CUDA_MODULE=${BUILD_CUDA_MODULE} \ -DBUILD_COMMON_CUDA_ARCHS=ON \ - -DBUILD_COMMON_ISPC_ISAS=ON \ + -DBUILD_COMMON_ISPC_ISAS=${BUILD_ISPC_MODULE} \ -DGLIBCXX_USE_CXX11_ABI=${GLIBCXX_USE_CXX11_ABI} \ -DBUILD_TENSORFLOW_OPS=${BUILD_TENSORFLOW_OPS} \ -DBUILD_PYTORCH_OPS=${BUILD_PYTORCH_OPS} \ @@ -212,7 +226,7 @@ RUN \ && make install -j$(nproc) \ && if [ "${PACKAGE}" = "ON" ]; then make package; fi \ && if [ "${PACKAGE}" = "VIEWER" ]; then make package-Open3DViewer-deb; fi \ - && if [ "${CI:-}a" != "a" ]; then rm -rf _deps assimp embree ippicv mkl mkl_install webrtc; fi + && if [ "${CI:-}a" != "a" ]; then rm -rf _deps assimp embree ipp mkl mkl_install webrtc; fi # If CI is not null or unset, remove all large build folders to save disk space # Compress ccache folder, move to / directory @@ -221,7 +235,7 @@ RUN ccache -s \ && CCACHE_DIR_NAME=$(basename ${CCACHE_DIR}) \ && CCACHE_DIR_PARENT=$(dirname ${CCACHE_DIR}) \ && cd ${CCACHE_DIR_PARENT} \ - && tar -czf /${CCACHE_TAR_NAME}.tar.gz ${CCACHE_DIR_NAME} \ + && tar -caf /${CCACHE_TAR_NAME}.tar.xz ${CCACHE_DIR_NAME} \ && if [ "${PACKAGE}" = "ON" ]; then mv /root/Open3D/build/package/open3d-devel*.tar.xz /; fi \ && if [ "${PACKAGE}" = "VIEWER" ]; then mv /root/Open3D/build/package-Open3DViewer-deb/open3d-viewer-*-Linux.deb /; fi \ && ls -alh / diff --git a/docker/Dockerfile.wheel b/docker/Dockerfile.wheel index a719262ece2..eb60286b620 100644 --- a/docker/Dockerfile.wheel +++ b/docker/Dockerfile.wheel @@ -1,5 +1,5 @@ # FROM must be called before other ARGS except for ARG BASE_IMAGE -ARG BASE_IMAGE=nvidia/cuda:11.7.1-cudnn8-devel-ubuntu18.04 +ARG BASE_IMAGE=nvidia/cuda:12.1.0-cudnn8-devel-ubuntu20.04 FROM ${BASE_IMAGE} # Customizable build arguments from cuda.yml @@ -76,11 +76,11 @@ RUN CCACHE_DIR=$(ccache -p | grep cache_dir | grep -oE "[^ ]+$") \ && CCACHE_DIR_PARENT=$(dirname ${CCACHE_DIR}) \ && mkdir -p ${CCACHE_DIR_PARENT} \ && cd ${CCACHE_DIR_PARENT} \ - && (wget -q https://storage.googleapis.com/open3d-ci-cache/${CCACHE_TAR_NAME}.tar.gz || true) \ - && if [ -f ${CCACHE_TAR_NAME}.tar.gz ]; then tar -xf ${CCACHE_TAR_NAME}.tar.gz; fi + && (wget -q https://storage.googleapis.com/open3d-ci-cache/${CCACHE_TAR_NAME}.tar.xz https://storage.googleapis.com/open3d-ci-cache/${CCACHE_TAR_NAME}.tar.gz || true) \ + && if [ -f ${CCACHE_TAR_NAME}.tar.?z ]; then tar -xf ${CCACHE_TAR_NAME}.tar.?z; fi # We need to set ccache size explicitly with -M, otherwise the default size is # *not* determined by ccache's default, but the downloaded ccache file's config. -RUN ccache -M 5G \ +RUN ccache -M 4G \ && ccache -s # Miniconda @@ -98,7 +98,7 @@ RUN which python \ # Checkout Open3D-ML main branch # TODO: We may add support for local Open3D-ML repo or pinned ML repo tag ENV OPEN3D_ML_ROOT=/root/Open3D-ML -RUN git clone https://github.com/isl-org/Open3D-ML.git ${OPEN3D_ML_ROOT} +RUN git clone --depth 1 https://github.com/isl-org/Open3D-ML.git ${OPEN3D_ML_ROOT} # Open3D C++ dependencies # Done before copying the full Open3D directory for better Docker caching @@ -112,7 +112,7 @@ COPY ./python/requirements.txt /root/Open3D/python/ COPY ./python/requirements_jupyter_build.txt /root/Open3D/python/ COPY ./python/requirements_jupyter_install.txt /root/Open3D/python/ RUN source /root/Open3D/util/ci_utils.sh \ - && install_python_dependencies with-cuda with-jupyter + && install_python_dependencies with-jupyter # Open3D Jupyter dependencies RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - \ @@ -141,6 +141,6 @@ RUN ccache -s \ && CCACHE_DIR_NAME=$(basename ${CCACHE_DIR}) \ && CCACHE_DIR_PARENT=$(dirname ${CCACHE_DIR}) \ && cd ${CCACHE_DIR_PARENT} \ - && tar -czf /${CCACHE_TAR_NAME}.tar.gz ${CCACHE_DIR_NAME} + && tar -caf /${CCACHE_TAR_NAME}.tar.xz ${CCACHE_DIR_NAME} RUN echo "Docker build done." diff --git a/docker/README.md b/docker/README.md index d14d9521c19..cd3a8198579 100644 --- a/docker/README.md +++ b/docker/README.md @@ -26,7 +26,7 @@ to install Nvidia Docker to run the CUDA container. To verify that the Nvidia Docker is working, run: ```bash -docker run --rm --gpus all nvidia/cuda:11.7-base nvidia-smi +docker run --rm --gpus all nvidia/cuda:12.1-base nvidia-smi ``` ### ARM64 Docker @@ -48,7 +48,7 @@ To verify that the ARM64 environment is working, run: # The following warning message is expected: "WARNING: The requested image's # platform (linux/arm64/v8) does not match the detected host platform # (linux/amd64) and no specific platform was requested aarch64." -docker run --rm arm64v8/ubuntu:18.04 uname -p +docker run --rm arm64v8/ubuntu:24.04 uname -p ``` ## Build and test Docker diff --git a/docker/docker_build.sh b/docker/docker_build.sh index 2f767884f1a..e6c22bb10df 100755 --- a/docker/docker_build.sh +++ b/docker/docker_build.sh @@ -8,9 +8,9 @@ # Guidelines: # - Use a flat list of options. # We don't want to have a cartesian product of different combinations of -# options. E.g., to support Ubuntu {18.04, 20.04} with Python {3.7, 3.8}, we +# options. E.g., to support Ubuntu {20.04, 24.04} with Python {3.7, 3.8}, we # don't specify the OS and Python version separately, instead, we have a flat -# list of combinations: [u1804_py37, u1804_py38, u2004_py37, u2004_py38]. +# list of combinations: [u2004_py39, u2004_py310, u2404_py39, u2404_py310]. # - No external environment variables. # This script should not make assumptions on external environment variables. # This make the Docker image reproducible across different machines. @@ -27,20 +27,24 @@ OPTION: openblas-amd64-py39-dev : OpenBLAS AMD64 3.9 wheel, developer mode openblas-amd64-py310-dev : OpenBLAS AMD64 3.10 wheel, developer mode openblas-amd64-py311-dev : OpenBLAS AMD64 3.11 wheel, developer mode + openblas-amd64-py312-dev : OpenBLAS AMD64 3.12 wheel, developer mode openblas-amd64-py38 : OpenBLAS AMD64 3.8 wheel, release mode openblas-amd64-py39 : OpenBLAS AMD64 3.9 wheel, release mode openblas-amd64-py310 : OpenBLAS AMD64 3.10 wheel, release mode openblas-amd64-py311 : OpenBLAS AMD64 3.11 wheel, release mode + openblas-amd64-py312 : OpenBLAS AMD64 3.12 wheel, release mode # OpenBLAS ARM64 (Dockerfile.openblas) openblas-arm64-py38-dev : OpenBLAS ARM64 3.8 wheel, developer mode openblas-arm64-py39-dev : OpenBLAS ARM64 3.9 wheel, developer mode openblas-arm64-py310-dev : OpenBLAS ARM64 3.10 wheel, developer mode openblas-arm64-py311-dev : OpenBLAS ARM64 3.11 wheel, developer mode + openblas-arm64-py312-dev : OpenBLAS ARM64 3.12 wheel, developer mode openblas-arm64-py38 : OpenBLAS ARM64 3.8 wheel, release mode openblas-arm64-py39 : OpenBLAS ARM64 3.9 wheel, release mode openblas-arm64-py310 : OpenBLAS ARM64 3.10 wheel, release mode openblas-arm64-py311 : OpenBLAS ARM64 3.11 wheel, release mode + openblas-arm64-py312 : OpenBLAS ARM64 3.12 wheel, release mode # Ubuntu CPU CI (Dockerfile.ci) cpu-static : Ubuntu CPU static @@ -54,31 +58,34 @@ OPTION: sycl-static : SYCL (oneAPI) with static lib # ML CIs (Dockerfile.ci) - 2-bionic : CUDA CI, 2-bionic, developer mode - 3-ml-shared-bionic-release : CUDA CI, 3-ml-shared-bionic (pre_cxx11_abi), release mode - 3-ml-shared-bionic : CUDA CI, 3-ml-shared-bionic (pre_cxx11_abi), developer mode - 4-shared-bionic : CUDA CI, 4-shared-bionic (cxx11_abi), developer mode - 4-shared-bionic-release : CUDA CI, 4-shared-bionic (cxx11_abi), release mode - 5-ml-focal : CUDA CI, 5-ml-focal, developer mode + 2-focal : CUDA CI, 2-bionic, developer mode + 3-ml-shared-focal-release : CUDA CI, 3-ml-shared-bionic (pre_cxx11_abi), release mode + 3-ml-shared-focal : CUDA CI, 3-ml-shared-bionic (pre_cxx11_abi), developer mode + 4-shared-focal : CUDA CI, 4-shared-bionic (cxx11_abi), developer mode + 4-shared-focal-release : CUDA CI, 4-shared-bionic (cxx11_abi), release mode + 5-ml-jammy : CUDA CI, 5-ml-focal, developer mode # CUDA wheels (Dockerfile.wheel) cuda_wheel_py38_dev : CUDA Python 3.8 wheel, developer mode cuda_wheel_py39_dev : CUDA Python 3.9 wheel, developer mode cuda_wheel_py310_dev : CUDA Python 3.10 wheel, developer mode cuda_wheel_py311_dev : CUDA Python 3.11 wheel, developer mode + cuda_wheel_py312_dev : CUDA Python 3.12 wheel, developer mode cuda_wheel_py38 : CUDA Python 3.8 wheel, release mode cuda_wheel_py39 : CUDA Python 3.9 wheel, release mode cuda_wheel_py310 : CUDA Python 3.10 wheel, release mode cuda_wheel_py311 : CUDA Python 3.11 wheel, release mode + cuda_wheel_py312 : CUDA Python 3.12 wheel, release mode " HOST_OPEN3D_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. >/dev/null 2>&1 && pwd)" # Shared variables CCACHE_VERSION=4.3 -CMAKE_VERSION=cmake-3.22.5-linux-x86_64 -CMAKE_VERSION_AARCH64=cmake-3.22.5-linux-aarch64 -CUDA_VERSION=11.7.1-cudnn8 +CMAKE_VERSION=cmake-3.29.2-linux-x86_64 +CMAKE_VERSION_AARCH64=cmake-3.24.4-linux-aarch64 +CUDA_VERSION=12.1.0-cudnn8 +CUDA_VERSION_LATEST=12.1.0-cudnn8 print_usage_and_exit_docker_build() { echo "$__usage_docker_build" @@ -101,13 +108,13 @@ openblas_export_env() { if [[ "amd64" =~ ^($options)$ ]]; then echo "[openblas_export_env()] platform AMD64" export DOCKER_TAG=open3d-ci:openblas-amd64 - export BASE_IMAGE=ubuntu:18.04 + export BASE_IMAGE=ubuntu:20.04 export CONDA_SUFFIX=x86_64 export CMAKE_VERSION=${CMAKE_VERSION} elif [[ "arm64" =~ ^($options)$ ]]; then echo "[openblas_export_env()] platform ARM64" export DOCKER_TAG=open3d-ci:openblas-arm64 - export BASE_IMAGE=arm64v8/ubuntu:18.04 + export BASE_IMAGE=arm64v8/ubuntu:20.04 export CONDA_SUFFIX=aarch64 export CMAKE_VERSION=${CMAKE_VERSION_AARCH64} else @@ -127,6 +134,9 @@ openblas_export_env() { elif [[ "py311" =~ ^($options)$ ]]; then export PYTHON_VERSION=3.11 export DOCKER_TAG=${DOCKER_TAG}-py311 + elif [[ "py312" =~ ^($options)$ ]]; then + export PYTHON_VERSION=3.12 + export DOCKER_TAG=${DOCKER_TAG}-py312 else echo "Invalid python version." print_usage_and_exit_docker_build @@ -153,7 +163,6 @@ openblas_build() { pushd "${HOST_OPEN3D_ROOT}" docker build \ - --progress plain \ --build-arg BASE_IMAGE="${BASE_IMAGE}" \ --build-arg CONDA_SUFFIX="${CONDA_SUFFIX}" \ --build-arg CMAKE_VERSION="${CMAKE_VERSION}" \ @@ -169,8 +178,8 @@ openblas_build() { } cuda_wheel_build() { - BASE_IMAGE=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu18.04 - CCACHE_TAR_NAME=open3d-ubuntu-1804-cuda-ci-ccache + BASE_IMAGE=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu20.04 + CCACHE_TAR_NAME=open3d-ubuntu-2004-cuda-ci-ccache options="$(echo "$@" | tr ' ' '|')" echo "[cuda_wheel_build()] options: ${options}" @@ -182,6 +191,8 @@ cuda_wheel_build() { PYTHON_VERSION=3.10 elif [[ "py311" =~ ^($options)$ ]]; then PYTHON_VERSION=3.11 + elif [[ "py312" =~ ^($options)$ ]]; then + PYTHON_VERSION=3.12 else echo "Invalid python version." print_usage_and_exit_docker_build @@ -198,7 +209,6 @@ cuda_wheel_build() { pushd "${HOST_OPEN3D_ROOT}" docker build \ - --progress plain \ --build-arg BASE_IMAGE="${BASE_IMAGE}" \ --build-arg DEVELOPER_BUILD="${DEVELOPER_BUILD}" \ --build-arg CCACHE_TAR_NAME="${CCACHE_TAR_NAME}" \ @@ -215,9 +225,9 @@ cuda_wheel_build() { python_package_dir=/root/Open3D/build/lib/python_package docker run -v "${PWD}:/opt/mount" --rm open3d-ci:wheel \ bash -c "cp ${python_package_dir}/pip_package/open3d*.whl /opt/mount \ - && cp /${CCACHE_TAR_NAME}.tar.gz /opt/mount \ + && cp /${CCACHE_TAR_NAME}.tar.xz /opt/mount \ && chown $(id -u):$(id -g) /opt/mount/open3d*.whl \ - && chown $(id -u):$(id -g) /opt/mount/${CCACHE_TAR_NAME}.tar.gz" + && chown $(id -u):$(id -g) /opt/mount/${CCACHE_TAR_NAME}.tar.xz" } ci_build() { @@ -237,7 +247,6 @@ ci_build() { pushd "${HOST_OPEN3D_ROOT}" docker build \ - --progress plain \ --build-arg BASE_IMAGE="${BASE_IMAGE}" \ --build-arg DEVELOPER_BUILD="${DEVELOPER_BUILD}" \ --build-arg CCACHE_TAR_NAME="${CCACHE_TAR_NAME}" \ @@ -260,12 +269,12 @@ ci_build() { && chown $(id -u):$(id -g) /opt/mount/open3d*" } -2-bionic_export_env() { - export DOCKER_TAG=open3d-ci:2-bionic +2-focal_export_env() { + export DOCKER_TAG=open3d-ci:2-focal - export BASE_IMAGE=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu18.04 + export BASE_IMAGE=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu20.04 export DEVELOPER_BUILD=ON - export CCACHE_TAR_NAME=open3d-ci-2-bionic + export CCACHE_TAR_NAME=open3d-ci-2-focal export PYTHON_VERSION=3.8 export BUILD_SHARED_LIBS=OFF export BUILD_CUDA_MODULE=ON @@ -275,12 +284,12 @@ ci_build() { export BUILD_SYCL_MODULE=OFF } -3-ml-shared-bionic_export_env() { - export DOCKER_TAG=open3d-ci:3-ml-shared-bionic +3-ml-shared-focal_export_env() { + export DOCKER_TAG=open3d-ci:3-ml-shared-focal - export BASE_IMAGE=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu18.04 + export BASE_IMAGE=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu20.04 export DEVELOPER_BUILD=ON - export CCACHE_TAR_NAME=open3d-ci-3-ml-shared-bionic + export CCACHE_TAR_NAME=open3d-ci-3-ml-shared-focal export PYTHON_VERSION=3.8 export BUILD_SHARED_LIBS=ON export BUILD_CUDA_MODULE=ON @@ -291,12 +300,12 @@ ci_build() { export BUILD_SYCL_MODULE=OFF } -3-ml-shared-bionic-release_export_env() { - export DOCKER_TAG=open3d-ci:3-ml-shared-bionic +3-ml-shared-focal-release_export_env() { + export DOCKER_TAG=open3d-ci:3-ml-shared-focal - export BASE_IMAGE=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu18.04 + export BASE_IMAGE=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu20.04 export DEVELOPER_BUILD=OFF - export CCACHE_TAR_NAME=open3d-ci-3-ml-shared-bionic + export CCACHE_TAR_NAME=open3d-ci-3-ml-shared-focal export PYTHON_VERSION=3.8 export BUILD_SHARED_LIBS=ON export BUILD_CUDA_MODULE=ON @@ -307,13 +316,13 @@ ci_build() { export BUILD_SYCL_MODULE=OFF } -4-shared-bionic_export_env() { - export DOCKER_TAG=open3d-ci:4-shared-bionic +4-shared-focal_export_env() { + export DOCKER_TAG=open3d-ci:4-shared-focal - export BASE_IMAGE=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu18.04 + export BASE_IMAGE=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu20.04 export DEVELOPER_BUILD=ON - export CCACHE_TAR_NAME=open3d-ci-4-shared-bionic - export PYTHON_VERSION=3.8 + export CCACHE_TAR_NAME=open3d-ci-4-shared-focal + export PYTHON_VERSION=3.12 export BUILD_SHARED_LIBS=ON export BUILD_CUDA_MODULE=ON # TODO: tensorflow tests moved here till PyTorch supports cxx11_abi @@ -323,13 +332,13 @@ ci_build() { export BUILD_SYCL_MODULE=OFF } -4-shared-bionic-release_export_env() { - export DOCKER_TAG=open3d-ci:4-shared-bionic +4-shared-focal-release_export_env() { + export DOCKER_TAG=open3d-ci:4-shared-focal - export BASE_IMAGE=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu18.04 + export BASE_IMAGE=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu20.04 export DEVELOPER_BUILD=OFF - export CCACHE_TAR_NAME=open3d-ci-4-shared-bionic - export PYTHON_VERSION=3.8 + export CCACHE_TAR_NAME=open3d-ci-4-shared-focal + export PYTHON_VERSION=3.12 export BUILD_SHARED_LIBS=ON export BUILD_CUDA_MODULE=ON # TODO: tensorflow tests moved here till PyTorch supports cxx11_abi @@ -339,12 +348,12 @@ ci_build() { export BUILD_SYCL_MODULE=OFF } -5-ml-focal_export_env() { - export DOCKER_TAG=open3d-ci:5-ml-focal +5-ml-jammy_export_env() { + export DOCKER_TAG=open3d-ci:5-ml-jammy - export BASE_IMAGE=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu20.04 + export BASE_IMAGE=nvidia/cuda:${CUDA_VERSION_LATEST}-devel-ubuntu22.04 export DEVELOPER_BUILD=ON - export CCACHE_TAR_NAME=open3d-ci-5-ml-focal + export CCACHE_TAR_NAME=open3d-ci-5-ml-jammy export PYTHON_VERSION=3.8 export BUILD_SHARED_LIBS=OFF export BUILD_CUDA_MODULE=ON @@ -358,7 +367,7 @@ ci_build() { cpu-static_export_env() { export DOCKER_TAG=open3d-ci:cpu-static - export BASE_IMAGE=ubuntu:18.04 + export BASE_IMAGE=ubuntu:20.04 export DEVELOPER_BUILD=ON export CCACHE_TAR_NAME=open3d-ci-cpu export PYTHON_VERSION=3.8 @@ -373,10 +382,10 @@ cpu-static_export_env() { cpu-shared_export_env() { export DOCKER_TAG=open3d-ci:cpu-shared - export BASE_IMAGE=ubuntu:18.04 + export BASE_IMAGE=ubuntu:20.04 export DEVELOPER_BUILD=ON export CCACHE_TAR_NAME=open3d-ci-cpu - export PYTHON_VERSION=3.8 + export PYTHON_VERSION=3.12 export BUILD_SHARED_LIBS=ON export BUILD_CUDA_MODULE=OFF # TODO: tensorflow tests moved here till PyTorch supports cxx11_abi @@ -389,7 +398,7 @@ cpu-shared_export_env() { cpu-shared-ml_export_env() { export DOCKER_TAG=open3d-ci:cpu-shared-ml - export BASE_IMAGE=ubuntu:18.04 + export BASE_IMAGE=ubuntu:20.04 export DEVELOPER_BUILD=ON export CCACHE_TAR_NAME=open3d-ci-cpu export PYTHON_VERSION=3.8 @@ -405,10 +414,10 @@ cpu-shared-ml_export_env() { cpu-shared-release_export_env() { export DOCKER_TAG=open3d-ci:cpu-shared - export BASE_IMAGE=ubuntu:18.04 + export BASE_IMAGE=ubuntu:20.04 export DEVELOPER_BUILD=OFF export CCACHE_TAR_NAME=open3d-ci-cpu - export PYTHON_VERSION=3.8 + export PYTHON_VERSION=3.12 # no TF versions after 2.13.2 for Python 3.8 export BUILD_SHARED_LIBS=ON export BUILD_CUDA_MODULE=OFF # TODO: tensorflow tests moved here till PyTorch supports cxx11_abi @@ -421,7 +430,7 @@ cpu-shared-release_export_env() { cpu-shared-ml-release_export_env() { export DOCKER_TAG=open3d-ci:cpu-shared-ml - export BASE_IMAGE=ubuntu:18.04 + export BASE_IMAGE=ubuntu:20.04 export DEVELOPER_BUILD=OFF export CCACHE_TAR_NAME=open3d-ci-cpu export PYTHON_VERSION=3.8 @@ -438,8 +447,8 @@ sycl-shared_export_env() { export DOCKER_TAG=open3d-ci:sycl-shared # https://hub.docker.com/r/intel/oneapi-basekit - # https://github.com/intel/oneapi-containers/blob/main/images/docker/basekit/Dockerfile.ubuntu-18.04 - export BASE_IMAGE=intel/oneapi-basekit:2022.2-devel-ubuntu20.04 + # https://github.com/intel/oneapi-containers/blob/master/images/docker/basekit/Dockerfile.ubuntu-20.04 + export BASE_IMAGE=intel/oneapi-basekit:2024.1.0-devel-ubuntu20.04 export DEVELOPER_BUILD=ON export CCACHE_TAR_NAME=open3d-ci-sycl export PYTHON_VERSION=3.8 @@ -455,8 +464,8 @@ sycl-static_export_env() { export DOCKER_TAG=open3d-ci:sycl-static # https://hub.docker.com/r/intel/oneapi-basekit - # https://github.com/intel/oneapi-containers/blob/main/images/docker/basekit/Dockerfile.ubuntu-18.04 - export BASE_IMAGE=intel/oneapi-basekit:2022.2-devel-ubuntu20.04 + # https://github.com/intel/oneapi-containers/blob/master/images/docker/basekit/Dockerfile.ubuntu-20.04 + export BASE_IMAGE=intel/oneapi-basekit:2024.1.0-devel-ubuntu20.04 export DEVELOPER_BUILD=ON export CCACHE_TAR_NAME=open3d-ci-sycl export PYTHON_VERSION=3.8 @@ -492,6 +501,10 @@ function main() { openblas_export_env amd64 py311 dev openblas_build ;; + openblas-amd64-py312-dev) + openblas_export_env amd64 py312 dev + openblas_build + ;; openblas-amd64-py38) openblas_export_env amd64 py38 openblas_build @@ -508,6 +521,10 @@ function main() { openblas_export_env amd64 py311 openblas_build ;; + openblas-amd64-py312) + openblas_export_env amd64 py312 + openblas_build + ;; # OpenBLAS ARM64 openblas-arm64-py38-dev) @@ -526,6 +543,10 @@ function main() { openblas_export_env arm64 py311 dev openblas_build ;; + openblas-arm64-py312-dev) + openblas_export_env arm64 py312 dev + openblas_build + ;; openblas-arm64-py38) openblas_export_env arm64 py38 openblas_build @@ -542,6 +563,10 @@ function main() { openblas_export_env arm64 py311 openblas_build ;; + openblas-arm64-py312) + openblas_export_env arm64 py312 + openblas_build + ;; # CPU CI cpu-static) @@ -588,6 +613,9 @@ function main() { cuda_wheel_py311_dev) cuda_wheel_build py311 dev ;; + cuda_wheel_py312_dev) + cuda_wheel_build py312 dev + ;; cuda_wheel_py38) cuda_wheel_build py38 ;; @@ -600,30 +628,33 @@ function main() { cuda_wheel_py311) cuda_wheel_build py311 ;; + cuda_wheel_py312) + cuda_wheel_build py312 + ;; # ML CIs - 2-bionic) - 2-bionic_export_env + 2-focal) + 2-focal_export_env ci_build ;; - 3-ml-shared-bionic-release) - 3-ml-shared-bionic-release_export_env + 3-ml-shared-focal-release) + 3-ml-shared-focal-release_export_env ci_build ;; - 3-ml-shared-bionic) - 3-ml-shared-bionic_export_env + 3-ml-shared-focal) + 3-ml-shared-focal_export_env ci_build ;; - 4-shared-bionic-release) - 4-shared-bionic-release_export_env + 4-shared-focal-release) + 4-shared-focal-release_export_env ci_build ;; - 4-shared-bionic) - 4-shared-bionic_export_env + 4-shared-focal) + 4-shared-focal_export_env ci_build ;; - 5-ml-focal) - 5-ml-focal_export_env + 5-ml-jammy) + 5-ml-jammy_export_env ci_build ;; *) diff --git a/docker/docker_test.sh b/docker/docker_test.sh index 544eeb755e4..a7ab13fbc3c 100755 --- a/docker/docker_test.sh +++ b/docker/docker_test.sh @@ -20,20 +20,24 @@ OPTION: openblas-amd64-py39-dev : OpenBLAS AMD64 3.9 wheel, developer mode openblas-amd64-py310-dev : OpenBLAS AMD64 3.10 wheel, developer mode openblas-amd64-py311-dev : OpenBLAS AMD64 3.11 wheel, developer mode + openblas-amd64-py312-dev : OpenBLAS AMD64 3.12 wheel, developer mode openblas-amd64-py38 : OpenBLAS AMD64 3.8 wheel, release mode openblas-amd64-py39 : OpenBLAS AMD64 3.9 wheel, release mode openblas-amd64-py310 : OpenBLAS AMD64 3.10 wheel, release mode openblas-amd64-py311 : OpenBLAS AMD64 3.11 wheel, release mode + openblas-amd64-py312 : OpenBLAS AMD64 3.12 wheel, release mode # OpenBLAS ARM64 (Dockerfile.openblas) openblas-arm64-py38-dev : OpenBLAS ARM64 3.8 wheel, developer mode openblas-arm64-py39-dev : OpenBLAS ARM64 3.9 wheel, developer mode openblas-arm64-py310-dev : OpenBLAS ARM64 3.10 wheel, developer mode openblas-arm64-py311-dev : OpenBLAS ARM64 3.11 wheel, developer mode + openblas-arm64-py312-dev : OpenBLAS ARM64 3.12 wheel, developer mode openblas-arm64-py38 : OpenBLAS ARM64 3.8 wheel, release mode openblas-arm64-py39 : OpenBLAS ARM64 3.9 wheel, release mode openblas-arm64-py310 : OpenBLAS ARM64 3.10 wheel, release mode openblas-arm64-py311 : OpenBLAS ARM64 3.11 wheel, release mode + openblas-arm64-py312 : OpenBLAS ARM64 3.12 wheel, release mode # Ubuntu CPU CI (Dockerfile.ci) cpu-static : Ubuntu CPU static @@ -47,12 +51,12 @@ OPTION: sycl-static : SYCL (oneAPI) with static lib # ML CIs (Dockerfile.ci) - 2-bionic : CUDA CI, 2-bionic, developer mode - 3-ml-shared-bionic-release : CUDA CI, 3-ml-shared-bionic, release mode - 3-ml-shared-bionic : CUDA CI, 3-ml-shared-bionic, developer mode - 4-shared-bionic : CUDA CI, 4-shared-bionic, developer mode - 4-shared-bionic-release : CUDA CI, 4-shared-bionic, release mode - 5-ml-focal : CUDA CI, 5-ml-focal, developer mode + 2-focal : CUDA CI, 2-focal, developer mode + 3-ml-shared-focal-release : CUDA CI, 3-ml-shared-focal, release mode + 3-ml-shared-focal : CUDA CI, 3-ml-shared-focal, developer mode + 4-shared-focal : CUDA CI, 4-shared-focal, developer mode + 4-shared-focal-release : CUDA CI, 4-shared-focal, release mode + 5-ml-jammy : CUDA CI, 5-ml-jammy, developer mode " HOST_OPEN3D_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. >/dev/null 2>&1 && pwd)" @@ -141,7 +145,7 @@ cpp_python_linking_uninstall_test() { # Python test echo "pytest is randomized, add --randomly-seed=SEED to repeat the test sequence." ${docker_run} -i --rm "${DOCKER_TAG}" /bin/bash -c " \ - python -m pytest python/test ${pytest_args} -s" + python -W default -m pytest python/test ${pytest_args} -s" restart_docker_daemon_if_on_gcloud # Command-line tools test @@ -170,8 +174,7 @@ cpp_python_linking_uninstall_test() { fi ${docker_run} -i --rm "${DOCKER_TAG}" /bin/bash -c "\ - git clone https://github.com/isl-org/open3d-cmake-find-package.git \ - && cd open3d-cmake-find-package \ + cd examples/cmake/open3d-cmake-find-package \ && mkdir build \ && pushd build \ && echo Testing build with cmake \ @@ -182,8 +185,7 @@ cpp_python_linking_uninstall_test() { if [ "${BUILD_SHARED_LIBS}" == "ON" ] && [ "${BUILD_SYCL_MODULE}" == "OFF" ]; then ${docker_run} -i --rm "${DOCKER_TAG}" /bin/bash -c "\ - git clone https://github.com/isl-org/open3d-cmake-find-package.git \ - && cd open3d-cmake-find-package \ + cd examples/cmake/open3d-cmake-find-package \ && mkdir build \ && pushd build \ && echo Testing build with pkg-config \ @@ -230,6 +232,11 @@ openblas-amd64-py311-dev) openblas_print_env cpp_python_linking_uninstall_test ;; +openblas-amd64-py312-dev) + openblas_export_env amd64 py312 dev + openblas_print_env + cpp_python_linking_uninstall_test + ;; openblas-amd64-py38) openblas_export_env amd64 py38 openblas_print_env @@ -250,6 +257,11 @@ openblas-amd64-py311) openblas_print_env cpp_python_linking_uninstall_test ;; +openblas-amd64-py312) + openblas_export_env amd64 py312 + openblas_print_env + cpp_python_linking_uninstall_test + ;; # OpenBLAS ARM64 openblas-arm64-py38-dev) @@ -272,6 +284,11 @@ openblas-arm64-py311-dev) openblas_print_env cpp_python_linking_uninstall_test ;; +openblas-arm64-py312-dev) + openblas_export_env arm64 py312 dev + openblas_print_env + cpp_python_linking_uninstall_test + ;; openblas-arm64-py38) openblas_export_env arm64 py38 openblas_print_env @@ -292,6 +309,11 @@ openblas-arm64-py311) openblas_print_env cpp_python_linking_uninstall_test ;; +openblas-arm64-py312) + openblas_export_env arm64 py312 + openblas_print_env + cpp_python_linking_uninstall_test + ;; # CPU CI cpu-static) @@ -333,33 +355,33 @@ sycl-static) ;; # ML CIs -2-bionic) - 2-bionic_export_env +2-focal) + 2-focal_export_env ci_print_env cpp_python_linking_uninstall_test ;; -3-ml-shared-bionic) - 3-ml-shared-bionic_export_env +3-ml-shared-focal) + 3-ml-shared-focal_export_env ci_print_env cpp_python_linking_uninstall_test ;; -3-ml-shared-bionic-release) - 3-ml-shared-bionic-release_export_env +3-ml-shared-focal-release) + 3-ml-shared-focal-release_export_env ci_print_env cpp_python_linking_uninstall_test ;; -4-shared-bionic) - 4-shared-bionic_export_env +4-shared-focal) + 4-shared-focal_export_env ci_print_env cpp_python_linking_uninstall_test ;; -4-shared-bionic-release) - 4-shared-bionic-release_export_env +4-shared-focal-release) + 4-shared-focal-release_export_env ci_print_env cpp_python_linking_uninstall_test ;; -5-ml-focal) - 5-ml-focal_export_env +5-ml-jammy) + 5-ml-jammy_export_env ci_print_env cpp_python_linking_uninstall_test ;; diff --git a/docs/Doxyfile.in b/docs/Doxyfile.in index 0ed539ff60e..c75e4b7d37f 100644 --- a/docs/Doxyfile.in +++ b/docs/Doxyfile.in @@ -1,4 +1,4 @@ -# Doxyfile 1.8.20 +# Doxyfile 1.9.4 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -12,6 +12,15 @@ # For lists, items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (\" \"). +# +# Note: +# +# Use doxygen to compare the used configuration file with the template +# configuration file: +# doxygen -x [configFile] +# Use doxygen to compare the used configuration file with the template +# configuration file without replacing the environment variables: +# doxygen -x_noenv [configFile] #--------------------------------------------------------------------------- # Project related configuration options @@ -60,16 +69,28 @@ PROJECT_LOGO = _static//open3d_logo.ico OUTPUT_DIRECTORY = doxygen -# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- -# directories (in 2 levels) under the output directory of each output format and -# will distribute the generated files over these directories. Enabling this +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096 +# sub-directories (in 2 levels) under the output directory of each output format +# and will distribute the generated files over these directories. Enabling this # option can be useful when feeding doxygen a huge amount of source files, where # putting all generated files in the same directory would otherwise causes -# performance problems for the file system. +# performance problems for the file system. Adapt CREATE_SUBDIRS_LEVEL to +# control the number of sub-directories. # The default value is: NO. CREATE_SUBDIRS = NO +# Controls the number of sub-directories that will be created when +# CREATE_SUBDIRS tag is set to YES. Level 0 represents 16 directories, and every +# level increment doubles the number of directories, resulting in 4096 +# directories at level 8 which is the default and also the maximum value. The +# sub-directories are organized in 2 levels, the first level always has a fixed +# numer of 16 directories. +# Minimum value: 0, maximum value: 8, default value: 8. +# This tag requires that the tag CREATE_SUBDIRS is set to YES. + +CREATE_SUBDIRS_LEVEL = 8 + # If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII # characters to appear in the names of generated files. If set to NO, non-ASCII # characters will be escaped, for example _xE3_x81_x84 will be used for Unicode @@ -81,26 +102,18 @@ ALLOW_UNICODE_NAMES = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. -# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, -# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), -# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, -# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), -# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, -# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, -# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, -# Ukrainian and Vietnamese. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Bulgarian, +# Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, English +# (United States), Esperanto, Farsi (Persian), Finnish, French, German, Greek, +# Hindi, Hungarian, Indonesian, Italian, Japanese, Japanese-en (Japanese with +# English messages), Korean, Korean-en (Korean with English messages), Latvian, +# Lithuanian, Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, +# Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, +# Swedish, Turkish, Ukrainian and Vietnamese. # The default value is: English. OUTPUT_LANGUAGE = English -# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all generated output in the proper direction. -# Possible values are: None, LTR, RTL and Context. -# The default value is: None. - -OUTPUT_TEXT_DIRECTION = None - # If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. @@ -258,16 +271,16 @@ TAB_SIZE = 4 # the documentation. An alias has the form: # name=value # For example adding -# "sideeffect=@par Side Effects:\n" +# "sideeffect=@par Side Effects:^^" # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading -# "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines (in the resulting output). You can put ^^ in the value part of an -# alias to insert a newline as if a physical newline was in the original file. -# When you need a literal { or } or , in the value part of an alias you have to -# escape them by means of a backslash (\), this can lead to conflicts with the -# commands \{ and \} for these it is advised to use the version @{ and @} or use -# a double escape (\\{ and \\}) +# "Side Effects:". Note that you cannot put \n's in the value part of an alias +# to insert newlines (in the resulting output). You can put ^^ in the value part +# of an alias to insert a newline as if a physical newline was in the original +# file. When you need a literal { or } or , in the value part of an alias you +# have to escape them by means of a backslash (\), this can lead to conflicts +# with the commands \{ and \} for these it is advised to use the version @{ and +# @} or use a double escape (\\{ and \\}) ALIASES = @@ -312,8 +325,8 @@ OPTIMIZE_OUTPUT_SLICE = NO # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and # language is one of the parsers supported by doxygen: IDL, Java, JavaScript, -# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice, VHDL, -# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice, +# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: # FortranFree, unknown formatted Fortran: Fortran. In the later case the parser # tries to guess whether the code is fixed or free formatted code, this is the # default for Fortran type files). For instance to make doxygen treat .inc files @@ -323,7 +336,10 @@ OPTIMIZE_OUTPUT_SLICE = NO # Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. +# the files are not read by doxygen. When specifying no_extension you should add +# * to the FILE_PATTERNS. +# +# Note see also the list of default file extension mappings. EXTENSION_MAPPING = @@ -457,13 +473,13 @@ TYPEDEF_HIDES_STRUCT = NO LOOKUP_CACHE_SIZE = 0 -# The NUM_PROC_THREADS specifies the number threads doxygen is allowed to use +# The NUM_PROC_THREADS specifies the number of threads doxygen is allowed to use # during processing. When set to 0 doxygen will based this on the number of # cores available in the system. You can set it explicitly to a value larger # than 0 to get more control over the balance between CPU load and processing # speed. At this moment only the input processing can be done using multiple # threads. Since this is still an experimental feature the default is set to 1, -# which efficively disables parallel processing. Please report any issues you +# which effectively disables parallel processing. Please report any issues you # encounter. Generating dot graphs in parallel is controlled by the # DOT_NUM_THREADS setting. # Minimum value: 0, maximum value: 32, default value: 1. @@ -533,6 +549,13 @@ EXTRACT_LOCAL_METHODS = NO EXTRACT_ANON_NSPACES = NO +# If this flag is set to YES, the name of an unnamed parameter in a declaration +# will be determined by the corresponding definition. By default unnamed +# parameters remain unnamed in the output. +# The default value is: YES. + +RESOLVE_UNNAMED_PARAMS = YES + # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all # undocumented members inside documented classes or files. If set to NO these # members will be included in the various overviews, but no documentation @@ -570,11 +593,18 @@ HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO -# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES, upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# (including Cygwin) and Mac users are advised to set this option to NO. +# With the correct setting of option CASE_SENSE_NAMES doxygen will better be +# able to match the capabilities of the underlying filesystem. In case the +# filesystem is case sensitive (i.e. it supports files in the same directory +# whose names only differ in casing), the option must be set to YES to properly +# deal with such files in case they appear in the input. For filesystems that +# are not case sensitive the option should be set to NO to properly deal with +# output files written for symbols that only differ in casing, such as for two +# classes, one named CLASS and the other named Class, and to also support +# references to files without having to specify the exact matching casing. On +# Windows (including Cygwin) and MacOS, users should typically set this option +# to NO, whereas on Linux or other Unix flavors it should typically be set to +# YES. # The default value is: system dependent. CASE_SENSE_NAMES = NO @@ -593,6 +623,12 @@ HIDE_SCOPE_NAMES = NO HIDE_COMPOUND_REFERENCE= NO +# If the SHOW_HEADERFILE tag is set to YES then the documentation for a class +# will show which file needs to be included to use the class. +# The default value is: YES. + +SHOW_HEADERFILE = YES + # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. @@ -750,7 +786,8 @@ FILE_VERSION_FILTER = "git log -1 --format='%h (%cd)' --" # output files in an output format independent way. To create the layout file # that represents doxygen's defaults, run doxygen with the -l option. You can # optionally specify a file name after the option, if omitted DoxygenLayout.xml -# will be used as the name of the layout file. +# will be used as the name of the layout file. See also section "Changing the +# layout of pages" for information. # # Note that if you run doxygen from a directory containing a file called # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE @@ -796,24 +833,35 @@ WARNINGS = YES WARN_IF_UNDOCUMENTED = YES # If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some parameters -# in a documented function, or documenting parameters that don't exist or using -# markup commands wrongly. +# potential errors in the documentation, such as documenting some parameters in +# a documented function twice, or documenting parameters that don't exist or +# using markup commands wrongly. # The default value is: YES. WARN_IF_DOC_ERROR = YES +# If WARN_IF_INCOMPLETE_DOC is set to YES, doxygen will warn about incomplete +# function parameter documentation. If set to NO, doxygen will accept that some +# parameters have no documentation without warning. +# The default value is: YES. + +WARN_IF_INCOMPLETE_DOC = YES + # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return -# value. If set to NO, doxygen will only warn about wrong or incomplete -# parameter documentation, but not about the absence of documentation. If -# EXTRACT_ALL is set to YES then this flag will automatically be disabled. +# value. If set to NO, doxygen will only warn about wrong parameter +# documentation, but not about the absence of documentation. If EXTRACT_ALL is +# set to YES then this flag will automatically be disabled. See also +# WARN_IF_INCOMPLETE_DOC # The default value is: NO. WARN_NO_PARAMDOC = NO # If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when -# a warning is encountered. +# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS +# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but +# at the end of the doxygen process doxygen will return with a non-zero status. +# Possible values are: NO, YES and FAIL_ON_WARNINGS. # The default value is: NO. WARN_AS_ERROR = NO @@ -824,13 +872,27 @@ WARN_AS_ERROR = NO # and the warning text. Optionally the format may contain $version, which will # be replaced by the version of the file (if it could be obtained via # FILE_VERSION_FILTER) +# See also: WARN_LINE_FORMAT # The default value is: $file:$line: $text. WARN_FORMAT = "$file:$line: $text" +# In the $text part of the WARN_FORMAT command it is possible that a reference +# to a more specific place is given. To make it easier to jump to this place +# (outside of doxygen) the user can define a custom "cut" / "paste" string. +# Example: +# WARN_LINE_FORMAT = "'vi $file +$line'" +# See also: WARN_FORMAT +# The default value is: at line $line of file $file. + +WARN_LINE_FORMAT = "at line $line of file $file" + # The WARN_LOGFILE tag can be used to specify a file to which warning and error # messages should be written. If left blank the output is written to standard -# error (stderr). +# error (stderr). In case the file specified cannot be opened for writing the +# warning and error messages are written to standard error. When as file - is +# specified the warning and error messages are written to standard output +# (stdout). WARN_LOGFILE = @@ -850,8 +912,8 @@ INPUT = ../README.md \ # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: https://www.gnu.org/software/libiconv/) for the list of -# possible encodings. +# documentation (see: +# https://www.gnu.org/software/libiconv/) for the list of possible encodings. # The default value is: UTF-8. INPUT_ENCODING = UTF-8 @@ -864,12 +926,14 @@ INPUT_ENCODING = UTF-8 # need to set EXTENSION_MAPPING for the extension otherwise the files are not # read by doxygen. # +# Note the list of default checked file patterns might differ from the list of +# default file extension mappings. +# # If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, # *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, -# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, -# *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C comment), -# *.doc (to be provided as doxygen C comment), *.txt (to be provided as doxygen -# C comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, +# *.hh, *.hxx, *.hpp, *.h++, *.l, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, +# *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C +# comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, # *.vhdl, *.ucf, *.qsf and *.ice. FILE_PATTERNS = *.c \ @@ -960,7 +1024,7 @@ EXCLUDE_PATTERNS = # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test +# ANamespace::AClass, ANamespace::*Test # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* @@ -1245,7 +1309,7 @@ HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to -# this color. Hue is specified as an angle on a colorwheel, see +# this color. Hue is specified as an angle on a color-wheel, see # https://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. @@ -1255,7 +1319,7 @@ HTML_EXTRA_FILES = HTML_COLORSTYLE_HUE = 220 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors -# in the HTML output. For a value of 0 the output will use grayscales only. A +# in the HTML output. For a value of 0 the output will use gray-scales only. A # value of 255 will produce the most vivid colors. # Minimum value: 0, maximum value: 255, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1316,10 +1380,11 @@ HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: https://developer.apple.com/xcode/), introduced with OSX -# 10.5 (Leopard). To create a documentation set, doxygen will generate a -# Makefile in the HTML output directory. Running make will produce the docset in -# that directory and running make install will install the docset in +# environment (see: +# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To +# create a documentation set, doxygen will generate a Makefile in the HTML +# output directory. Running make will produce the docset in that directory and +# running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at # startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy # genXcode/_index.html for more information. @@ -1336,6 +1401,13 @@ GENERATE_DOCSET = NO DOCSET_FEEDNAME = "Doxygen generated docs" +# This tag determines the URL of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDURL = + # This tag specifies a string that should uniquely identify the documentation # set bundle. This should be a reverse domain-name style string, e.g. # com.mycompany.MyDocSet. Doxygen will append .docset to the name. @@ -1361,8 +1433,12 @@ DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: https://www.microsoft.com/en-us/download/details.aspx?id=21138) on -# Windows. +# on Windows. In the beginning of 2021 Microsoft took the original page, with +# a.o. the download links, offline the HTML help workshop was already many years +# in maintenance mode). You can download the HTML help workshop from the web +# archives at Installation executable (see: +# http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo +# ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe). # # The HTML Help Workshop contains a compiler that can convert all HTML output # generated by doxygen into a single compiled HTML file (.chm). Compiled HTML @@ -1437,7 +1513,8 @@ QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace -# (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). +# (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1445,8 +1522,8 @@ QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual- -# folders). +# Folders (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1454,16 +1531,16 @@ QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom -# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = @@ -1475,9 +1552,9 @@ QHP_CUST_FILTER_ATTRS = QHP_SECT_FILTER_ATTRS = -# The QHG_LOCATION tag can be used to specify the location of Qt's -# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the -# generated .qhp file. +# The QHG_LOCATION tag can be used to specify the location (absolute path +# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to +# run qhelpgenerator on the generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. QHG_LOCATION = @@ -1520,16 +1597,28 @@ DISABLE_INDEX = NO # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the # HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can -# further fine-tune the look of the index. As an example, the default style -# sheet generated by doxygen has an example that shows how to put an image at -# the root of the tree instead of the PROJECT_NAME. Since the tree basically has -# the same information as the tab index, you could consider setting -# DISABLE_INDEX to YES when enabling this option. +# further fine tune the look of the index (see "Fine-tuning the output"). As an +# example, the default style sheet generated by doxygen has an example that +# shows how to put an image at the root of the tree instead of the PROJECT_NAME. +# Since the tree basically has the same information as the tab index, you could +# consider setting DISABLE_INDEX to YES when enabling this option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_TREEVIEW = NO +# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the +# FULL_SIDEBAR option determines if the side bar is limited to only the treeview +# area (value NO) or if it should extend to the full height of the window (value +# YES). Setting this to YES gives a layout similar to +# https://docs.readthedocs.io with more room for contents, but less room for the +# project logo, title, and description. If either GENERATE_TREEVIEW or +# DISABLE_INDEX is set to NO, this option has no effect. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FULL_SIDEBAR = NO + # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that # doxygen will group on one line in the generated HTML documentation. # @@ -1554,6 +1643,13 @@ TREEVIEW_WIDTH = 250 EXT_LINKS_IN_WINDOW = NO +# If the OBFUSCATE_EMAILS tag is set to YES, doxygen will obfuscate email +# addresses. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +OBFUSCATE_EMAILS = YES + # If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg # tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see # https://inkscape.org) to generate formulas as SVG images instead of PNGs for @@ -1602,11 +1698,29 @@ FORMULA_MACROFILE = USE_MATHJAX = YES +# With MATHJAX_VERSION it is possible to specify the MathJax version to be used. +# Note that the different versions of MathJax have different requirements with +# regards to the different settings, so it is possible that also other MathJax +# settings have to be changed when switching between the different MathJax +# versions. +# Possible values are: MathJax_2 and MathJax_3. +# The default value is: MathJax_2. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_VERSION = MathJax_2 + # When MathJax is enabled you can set the default output format to be used for -# the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. +# the MathJax output. For more details about the output format see MathJax +# version 2 (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3 +# (see: +# http://docs.mathjax.org/en/latest/web/components/output.html). # Possible values are: HTML-CSS (which is slower, but has the best -# compatibility), NativeMML (i.e. MathML) and SVG. +# compatibility. This is the name for Mathjax version 2, for MathJax version 3 +# this will be translated into chtml), NativeMML (i.e. MathML. Only supported +# for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This +# is the name for Mathjax version 3, for MathJax version 2 this will be +# translated into HTML-CSS) and SVG. # The default value is: HTML-CSS. # This tag requires that the tag USE_MATHJAX is set to YES. @@ -1619,22 +1733,30 @@ MATHJAX_FORMAT = HTML-CSS # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of -# MathJax from https://www.mathjax.org before deployment. -# The default value is: https://cdn.jsdelivr.net/npm/mathjax@2. +# MathJax from https://www.mathjax.org before deployment. The default value is: +# - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2 +# - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3 # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/ # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax # extension names that should be enabled during MathJax rendering. For example +# for MathJax version 2 (see https://docs.mathjax.org/en/v2.7-latest/tex.html +# #tex-and-latex-extensions): # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# For example for MathJax version 3 (see +# http://docs.mathjax.org/en/latest/input/tex/extensions/index.html): +# MATHJAX_EXTENSIONS = ams # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +MATHJAX_EXTENSIONS = TeX/AMSmath \ + TeX/AMSsymbols # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. @@ -1681,7 +1803,8 @@ SERVER_BASED_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: https://xapian.org/). +# Xapian (see: +# https://xapian.org/). # # See the section "External Indexing and Searching" for details. # The default value is: NO. @@ -1694,8 +1817,9 @@ EXTERNAL_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: https://xapian.org/). See the section "External Indexing and -# Searching" for details. +# Xapian (see: +# https://xapian.org/). See the section "External Indexing and Searching" for +# details. # This tag requires that the tag SEARCHENGINE is set to YES. SEARCHENGINE_URL = @@ -1804,29 +1928,31 @@ PAPER_TYPE = a4 EXTRA_PACKAGES = -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the -# generated LaTeX document. The header should contain everything until the first -# chapter. If it is left blank doxygen will generate a standard header. See -# section "Doxygen usage" for information on how to let doxygen write the -# default header to a separate file. +# The LATEX_HEADER tag can be used to specify a user-defined LaTeX header for +# the generated LaTeX document. The header should contain everything until the +# first chapter. If it is left blank doxygen will generate a standard header. It +# is highly recommended to start with a default header using +# doxygen -w latex new_header.tex new_footer.tex new_stylesheet.sty +# and then modify the file new_header.tex. See also section "Doxygen usage" for +# information on how to generate the default header that doxygen normally uses. # -# Note: Only use a user-defined header if you know what you are doing! The -# following commands have a special meaning inside the header: $title, -# $datetime, $date, $doxygenversion, $projectname, $projectnumber, -# $projectbrief, $projectlogo. Doxygen will replace $title with the empty -# string, for the replacement values of the other commands the user is referred -# to HTML_HEADER. +# Note: Only use a user-defined header if you know what you are doing! +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. The following +# commands have a special meaning inside the header (and footer): For a +# description of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_HEADER = -# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the -# generated LaTeX document. The footer should contain everything after the last -# chapter. If it is left blank doxygen will generate a standard footer. See +# The LATEX_FOOTER tag can be used to specify a user-defined LaTeX footer for +# the generated LaTeX document. The footer should contain everything after the +# last chapter. If it is left blank doxygen will generate a standard footer. See # LATEX_HEADER for more information on how to generate a default footer and what -# special commands can be used inside the footer. -# -# Note: Only use a user-defined footer if you know what you are doing! +# special commands can be used inside the footer. See also section "Doxygen +# usage" for information on how to generate the default footer that doxygen +# normally uses. Note: Only use a user-defined footer if you know what you are +# doing! # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_FOOTER = @@ -1871,8 +1997,7 @@ USE_PDFLATEX = YES # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode # command to the generated LaTeX files. This will instruct LaTeX to keep running -# if errors occur, instead of asking the user for help. This option is also used -# when generating formulas in HTML. +# if errors occur, instead of asking the user for help. # The default value is: NO. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1885,16 +2010,6 @@ LATEX_BATCHMODE = NO LATEX_HIDE_INDICES = NO -# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source -# code with syntax highlighting in the LaTeX output. -# -# Note that which sources are shown also depends on other settings such as -# SOURCE_BROWSER. -# The default value is: NO. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_SOURCE_CODE = NO - # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. See # https://en.wikipedia.org/wiki/BibTeX and \cite for more info. @@ -1975,16 +2090,6 @@ RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = -# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code -# with syntax highlighting in the RTF output. -# -# Note that which sources are shown also depends on other settings such as -# SOURCE_BROWSER. -# The default value is: NO. -# This tag requires that the tag GENERATE_RTF is set to YES. - -RTF_SOURCE_CODE = NO - #--------------------------------------------------------------------------- # Configuration options related to the man page output #--------------------------------------------------------------------------- @@ -2081,15 +2186,6 @@ GENERATE_DOCBOOK = NO DOCBOOK_OUTPUT = docbook -# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the -# program listings (including syntax highlighting and cross-referencing -# information) to the DOCBOOK output. Note that enabling this will significantly -# increase the size of the DOCBOOK output. -# The default value is: NO. -# This tag requires that the tag GENERATE_DOCBOOK is set to YES. - -DOCBOOK_PROGRAMLISTING = NO - #--------------------------------------------------------------------------- # Configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- @@ -2176,7 +2272,8 @@ SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by the -# preprocessor. +# preprocessor. Note that the INCLUDE_PATH is not recursive, so the setting of +# RECURSIVE has no effect here. # This tag requires that the tag SEARCH_INCLUDES is set to YES. INCLUDE_PATH = @@ -2268,15 +2365,6 @@ EXTERNAL_PAGES = YES # Configuration options related to the dot tool #--------------------------------------------------------------------------- -# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram -# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to -# NO turns the diagrams off. Note that this option also works with HAVE_DOT -# disabled, but it is recommended to install and use dot, since it yields more -# powerful graphs. -# The default value is: YES. - -CLASS_DIAGRAMS = YES - # You can include diagrams made with dia in doxygen documentation. Doxygen will # then run dia to produce the diagram and insert it in the documentation. The # DIA_PATH tag allows you to specify the directory where the dia binary resides. @@ -2333,11 +2421,14 @@ DOT_FONTSIZE = 10 DOT_FONTPATH = -# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for -# each documented class showing the direct and indirect inheritance relations. -# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO. +# If the CLASS_GRAPH tag is set to YES (or GRAPH) then doxygen will generate a +# graph for each documented class showing the direct and indirect inheritance +# relations. In case HAVE_DOT is set as well dot will be used to draw the graph, +# otherwise the built-in generator will be used. If the CLASS_GRAPH tag is set +# to TEXT the direct and indirect inheritance relations will be shown as texts / +# links. +# Possible values are: NO, YES, TEXT and GRAPH. # The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. CLASS_GRAPH = YES @@ -2351,7 +2442,8 @@ CLASS_GRAPH = YES COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for -# groups, showing the direct groups dependencies. +# groups, showing the direct groups dependencies. See also the chapter Grouping +# in the manual. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2374,10 +2466,32 @@ UML_LOOK = NO # but if the number exceeds 15, the total amount of fields shown is limited to # 10. # Minimum value: 0, maximum value: 100, default value: 10. -# This tag requires that the tag HAVE_DOT is set to YES. +# This tag requires that the tag UML_LOOK is set to YES. UML_LIMIT_NUM_FIELDS = 10 +# If the DOT_UML_DETAILS tag is set to NO, doxygen will show attributes and +# methods without types and arguments in the UML graphs. If the DOT_UML_DETAILS +# tag is set to YES, doxygen will add type and arguments for attributes and +# methods in the UML graphs. If the DOT_UML_DETAILS tag is set to NONE, doxygen +# will not generate fields with class member information in the UML graphs. The +# class diagrams will look similar to the default class diagrams but using UML +# notation for the relationships. +# Possible values are: NO, YES and NONE. +# The default value is: NO. +# This tag requires that the tag UML_LOOK is set to YES. + +DOT_UML_DETAILS = NO + +# The DOT_WRAP_THRESHOLD tag can be used to set the maximum number of characters +# to display on a single line. If the actual line length exceeds this threshold +# significantly it will wrapped across multiple lines. Some heuristics are apply +# to avoid ugly line breaks. +# Minimum value: 0, maximum value: 1000, default value: 17. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_WRAP_THRESHOLD = 17 + # If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and # collaboration graphs will show the relations between templates and their # instances. @@ -2444,6 +2558,13 @@ GRAPHICAL_HIERARCHY = YES DIRECTORY_GRAPH = YES +# The DIR_GRAPH_MAX_DEPTH tag can be used to limit the maximum number of levels +# of child directories generated in directory dependency graphs by dot. +# Minimum value: 1, maximum value: 25, default value: 1. +# This tag requires that the tag DIRECTORY_GRAPH is set to YES. + +DIR_GRAPH_MAX_DEPTH = 1 + # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. For an explanation of the image formats see the section # output formats in the documentation of the dot tool (Graphviz (see: @@ -2497,10 +2618,10 @@ MSCFILE_DIRS = DIAFILE_DIRS = # When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the -# path where java can find the plantuml.jar file. If left blank, it is assumed -# PlantUML is not used or called during a preprocessing step. Doxygen will -# generate a warning when it encounters a \startuml command in this case and -# will not generate output for the diagram. +# path where java can find the plantuml.jar file or to the filename of jar file +# to be used. If left blank, it is assumed PlantUML is not used or called during +# a preprocessing step. Doxygen will generate a warning when it encounters a +# \startuml command in this case and will not generate output for the diagram. PLANTUML_JAR_PATH = @@ -2562,14 +2683,18 @@ DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page # explaining the meaning of the various boxes and arrows in the dot generated # graphs. +# Note: This tag requires that UML_LOOK isn't set, i.e. the doxygen internal +# graphical representation for inheritance and collaboration diagrams is used. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. GENERATE_LEGEND = YES -# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot +# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate # files that are used to generate the various graphs. +# +# Note: This setting is not only used for dot files but also for msc temporary +# files. # The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. DOT_CLEANUP = YES diff --git a/docs/_static/contribute/example_python_docstring.webp b/docs/_static/contribute/example_python_docstring.webp new file mode 100644 index 00000000000..746d50e84c7 Binary files /dev/null and b/docs/_static/contribute/example_python_docstring.webp differ diff --git a/docs/_static/docker/Dockerfile b/docs/_static/docker/Dockerfile index ea7e5344f3f..33065b3143b 100644 --- a/docs/_static/docker/Dockerfile +++ b/docs/_static/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 # ENV http_proxy "" # ENV HTTP_PROXY "" diff --git a/docs/arm.rst b/docs/arm.rst index e9f9c942413..35ddf813bed 100644 --- a/docs/arm.rst +++ b/docs/arm.rst @@ -71,6 +71,7 @@ commands: ./docker_build.sh openblas-arm64-py39 # Python 3.9 ./docker_build.sh openblas-arm64-py310 # Python 3.10 ./docker_build.sh openblas-arm64-py311 # Python 3.11 + ./docker_build.sh openblas-arm64-py312 # Python 3.12 After running ``docker_build.sh``, you shall see a ``.whl`` file generated the current directly on the host. Then simply install the ``.whl`` file by: diff --git a/docs/builddocs.rst b/docs/builddocs.rst index 2f8e9539957..42d83349bbb 100644 --- a/docs/builddocs.rst +++ b/docs/builddocs.rst @@ -97,3 +97,22 @@ Open ``docs/_out/html/index.html`` in a web browser to preview the docs. .. code-block:: bash google-chrome docs/_out/html/index.html + + +Create Python stubs (type hints) for type checking and autocomplete +------------------------------------------------------------------- + +You can get type checking and auto-complete features in editors and IDES (e.g. + VS Code, PyCharm, etc.) using type hints produced from Open3D. These can be + created with the pybind11-stubgen tool and placed alongside the Open3D files: + +.. code-block:: bash + + # Install open3d and pybind11-stubgen + pip install pybind11-stubgen open3d + # Print location of install open3d library + pip show open3d + # This outputs a line like: + # Location: path/to/venv/site-packages + # Create stubs and place them next to Open3D files + pybind11-stubgen -o --root-suffix "" open3d \ No newline at end of file diff --git a/docs/compilation.rst b/docs/compilation.rst index c0c2d1cda16..fa663c0d72d 100644 --- a/docs/compilation.rst +++ b/docs/compilation.rst @@ -8,15 +8,15 @@ Build from source System requirements ------------------- -* C++14 compiler: +* C++17 compiler: - * Ubuntu 18.04+: GCC 5+, Clang 7+ + * Ubuntu 20.04+: GCC 5+, Clang 7+ * macOS 10.15+: XCode 8.0+ * Windows 10 (64-bit): Visual Studio 2019+ -* CMake: 3.19+ +* CMake: 3.24+ - * Ubuntu (18.04 / 20.04): + * Ubuntu (20.04+): * Install with ``apt-get``: see `official APT repository `_ * Install with ``snap``: ``sudo snap install cmake --classic`` @@ -25,8 +25,8 @@ System requirements * macOS: Install with Homebrew: ``brew install cmake`` * Windows: Download from: `CMake download page `_ -* CUDA 10.1+ (optional): Open3D supports GPU acceleration of an increasing number - of operations through CUDA on Linux. We recommend using CUDA 11.0 for the +* CUDA 11.5+ (optional): Open3D supports GPU acceleration of an increasing number + of operations through CUDA on Linux. We recommend using CUDA 12+ for the best compatibility with recent GPUs and optional external dependencies such as Tensorflow or PyTorch. Please see the `official documentation `_ to @@ -238,12 +238,6 @@ The visualization module depends on the Filament rendering engine and, by defaul Open3D uses a prebuilt version of it. You can also build Filament from source by setting ``BUILD_FILAMENT_FROM_SOURCE=ON``. -.. note:: - Whereas Open3D only requires a C++14 compiler, Filament needs a C++17 compiler - and only supports Clang 7+, the most recent version of Xcode, and Visual Studio 2019, - see `their building instructions `_. - Make sure to use one of these compiler if you build Open3D with ``BUILD_FILAMENT_FROM_SOURCE=ON``. - ML Module ````````` @@ -256,7 +250,7 @@ pipelines from Open3D-ML in the python package, set ``BUNDLE_OPEN3D_ML=ON`` and Open3D-ML from GitHub during the build with ``OPEN3D_ML_ROOT=https://github.com/isl-org/Open3D-ML.git``. -.. warning:: Compiling PyTorch ops with CUDA 11 and PyTorch < 1.9 may have +.. warning:: Compiling PyTorch ops with PyTorch < 1.9 may have stability issues. See `Open3D issue #3324 `_ and `PyTorch issue #52663 `_ for more information on this problem. Official PyTorch wheels 1.9 and later @@ -390,8 +384,8 @@ After installing ``ccache``, simply reconfigure and recompile the Open3D library. Open3D's CMake script can detect and use it automatically. You don't need to setup additional paths except for the ``ccache`` program itself. -Ubuntu 18.04, 20.04 -``````````````````` +Ubuntu 20.04+ +````````````` If you install ``ccache`` via ``sudo apt install ccache``, the 3.x version will be installed. To cache CUDA compilations, you'll need the 4.0+ version. Here, we diff --git a/docs/conf.py b/docs/conf.py index 9ec55efcaf1..eac752217c7 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- @@ -67,6 +67,8 @@ def get_git_short_hash(): "sphinx.ext.autosummary", "sphinx.ext.napoleon", "sphinx.ext.todo", + "sphinx_tabs.tabs", + "sphinx_copybutton", "nbsphinx", "m2r2", ] diff --git a/docs/contribute/contribution_recipes.rst b/docs/contribute/contribution_recipes.rst index f03434c461b..454aff99e25 100644 --- a/docs/contribute/contribution_recipes.rst +++ b/docs/contribute/contribution_recipes.rst @@ -29,7 +29,7 @@ Dos +-------------------------------------------------------------------------------------------------------------+ | [DO] Follow the :ref:`style_guide` and install the required tools | +-------------------------------------------------------------------------------------------------------------+ -| [DO] Use C++14 features when contributing C++ code | +| [DO] Use C++17 features when contributing C++ code | +-------------------------------------------------------------------------------------------------------------+ | [DO] Remember to provide Python bindings when adding new C++ core functionalities | +-------------------------------------------------------------------------------------------------------------+ @@ -223,30 +223,21 @@ Case 2: When documenting Python bindings ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ * First, complete the Python binding code following the guides from `Pybind11 Docs `_. Make sure to write the high-level docstrings for the classes and functions. Also use ``"param_name"_a`` to denote function parameters. Use standard RST based docstring syntax (`Google style `__) as explained `here `_ and `there `_. -* Use the ``docstring::ClassMethodDocInject()`` or ``docstring::FunctionDocInject()`` to insert parameter docs. -* Example binding and docstrings for the ``Calculator`` class: - -.. code:: cpp - - py::class_ calculator( - m, "Calculator", - "Calculator class performs numerical computations."); - calculator.def("add", &Calculator::Add, - "Performs ``a`` plus ``b``, i.e. :math:`c=a+b` Unlike " - ":math:`open3d.Calculator.sub`, " - ":math:`open3d.Calculator.add` is " - "commutative.", - "a"_a, "b"_a); - calculator.def("sub", &Calculator::Add, "Subtracts ``b`` from ``a``," - " i.e. :math:`c=a-b`", - "a"_a, - "b"_a); - docstring::ClassMethodDocInject(m, "Calculator", "add", - {{"a", "LHS operand for summation."}, - {"b", "RHS operand for summation."}}); - docstring::ClassMethodDocInject(m, "Calculator", "sub", - {{"a", "LHS operand for subtraction."}, - {"b", "RHS operand for subtraction."}}); +* Writing docstrings that render as expected can be tricky. The following example docstring points out some of the pitfalls to watch out for: + +.. tabs:: + + .. tab:: Docstring example + + .. literalinclude:: ./example_python_docstring.rst + :language: rest + + .. tab:: Rendered result + + .. image:: ../../_static/contribute/example_python_docstring.webp + :width: 800 + :alt: Rendered docstring + Case 3: When documenting pure Python code (no bindings) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/contribute/example_python_docstring.rst b/docs/contribute/example_python_docstring.rst new file mode 100644 index 00000000000..778477a9142 --- /dev/null +++ b/docs/contribute/example_python_docstring.rst @@ -0,0 +1,87 @@ +Single line short description: Example docstring for Open3D. + +Use the ``Args``, ``Returns``, ``Example``, ``Note`` sections to describe classes +or functions as needed. +Giving a code example showing how to use a class or function in the ``Example`` +section is highly recommended. + +To explain what a method does you can use code and math. +This is a literal block started with ``::`` followed by a blank line to show code:: + + pip install open3d + +This is an inline equation :math:`e^{i\pi} + 1 = 0` and this is a display equation +(don't forget the blank line before the ``..math::`` directive): + +.. math:: + e^{i\pi} + 1 = 0. + + +The default alignment for multiple equations is right-align, which is often not +desired. +To align multiple equations manually use the ``align`` environment with ``:nowrap:`` +**(don't forget to add a blank line after :nowrap: to make this work!)** + +.. math:: + :nowrap: + + \begin{align} + x &= r \sin(\theta) \cos(\phi) \\ + y &= r \sin(\theta) \sin(\phi) \\ + z &= r \cos(\theta). + \end{align} + + +Note: + You can use inline markup to format your documentation. + + - *italics* for emphasis + - **boldface** for strong emphasis + - ``code`` for inline code + + A list must be separated with blank lines to work. + + - This is a list + - Second item + + - A nested list must be .. + - separated with blank lines too + - **Use only two spaces to indent or it will be treated as a block quote.** + + - Third item + + This is a link `The space before the pointy left bracket is important! `_ + This does not work, `you forgot the space`_ + + +Args: + param1 (o3d.core.Tensor): Specify the shape with round brackets, (N,3), and + the dtype, Float32, as necessary for Tensor parameters + + param2 (str): Another parameter + +Returns: + Returned values can be tuples, lists or dictionaries sometimes. + Describing every item can be done with lists + + - o3d.core.Tensor: vertices with shape (N,3) and type Float32. + - int: the number of vertices. This is N. + + or definition lists, which is recommended if the returned value is a dictionary + + vertices (o3d.core.Tensor) [term must be a single line] + Description, first paragraph. + A tensor with the vertices of shape (N,3) and type Float32. + + Description, second paragraph. + The tensor has the same shape as param1. + + count (int) + Description. + The number of vertices. This is N. + + +Example: + This is a code example showing how Open3D is imported:: + + import open3d as o3d \ No newline at end of file diff --git a/docs/contribute/styleguide.rst b/docs/contribute/styleguide.rst index 2da3aa4f0b4..d655993b3b9 100644 --- a/docs/contribute/styleguide.rst +++ b/docs/contribute/styleguide.rst @@ -58,7 +58,7 @@ We generally follow the `Google C++ Style Guide `_. diff --git a/docs/cpp_project.rst b/docs/cpp_project.rst index 89bfd98b70f..bd8432552a0 100644 --- a/docs/cpp_project.rst +++ b/docs/cpp_project.rst @@ -9,10 +9,10 @@ CMake We provide two example CMake projects to demonstrate how to use Open3D in your CMake projects. -* `Find Pre-Installed Open3D Package in CMake `_ +* `Find Pre-Installed Open3D Package in CMake `_ This option can be used if you'd like to build and install Open3D first, then link your project to Open3D. -* `Use Open3D as a CMake External Project `_ +* `Use Open3D as a CMake External Project `_ This option can be used if you'd like Open3D to build alongside with your project. diff --git a/docs/docker.in.rst b/docs/docker.in.rst index 3647b99d48f..989c9289cd6 100644 --- a/docs/docker.in.rst +++ b/docs/docker.in.rst @@ -57,7 +57,7 @@ To run GUI applications from the docker container, add these options to the - NVIDIA: ``--gpus 'all,"capabilities=compute,utility,graphics"'`` - - No GPU (CPU rendering): ``--env OPEN3D_CPU_RENDERING=true`` on Ubuntu 18.04. Later versions automaticaly select CPU rendering if a GPU is not available. + - No GPU (CPU rendering): CPU rendering is automaticaly selected if a GPU is not available. 2. X server: ``-v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY`` @@ -139,46 +139,7 @@ driver with an environment variable (``EGL_PLATFORM=surfaceless``): # Run headless rendering example without GPU (CPU rendering) docker run -v "$PWD":/root open3d-headless:latest -In Ubuntu 18.04, we need to install some additional dependencies. Here is an -example Ubuntu / Debian based docker file that runs the ``render_to_image.py`` -rendering example. Other (old) Linux (e.g. RHEL) distributions will need -different dependency packages. - -.. code-block:: bash - - mkdir open3d-headless-docker && cd open3d-headless-docker - wget https://raw.githubusercontent.com/isl-org/Open3D/v@OPEN3D_VERSION@/examples/python/visualization/render_to_image.py - # Build docker image - docker build -t open3d-headless -f- . <`__. The latest development version (``HEAD`` of ``main`` branch) viewer app is provided here [#]_: -* `Linux (Ubuntu 18.04+ or glibc 2.27+) `__ [#]_ -* `MacOSX v10.15+ (Intel or Apple Silicon) `__ -* `Windows 10+ (64-bit) `__ +* `Linux (Ubuntu 20.04+ or glibc 2.31+) `__ [#]_ +* `MacOSX v10.15+ (Intel or Apple Silicon) `__ +* `Windows 10+ (64-bit) `__ .. [#] Please use these links from the `latest version of this page `__ only. .. [#] To check the `glibc` version on your system, run :code:`ldd --version`. @@ -32,6 +32,7 @@ Supported Python versions: * 3.9 * 3.10 * 3.11 +* 3.12 Supported operating systems: @@ -50,6 +51,16 @@ Pip (PyPI) pip install open3d # or pip install open3d-cpu # Smaller CPU only wheel on x86_64 Linux (since v0.17+) +.. warning:: + + Versions of ``numpy>=2.0.0`` require ``Open3D>0.18.0`` or the latest development + version of Open3D. If you are using an older version of Open3D, downgrade ``numpy`` + with + + .. code-block:: bash + + pip install "numpy<2.0.0" + .. warning:: Please upgrade your ``pip`` to a version >=20.3 to install Open3D in Linux, @@ -57,7 +68,7 @@ Pip (PyPI) .. code-block:: bash - pip install -U pip>=20.3 + pip install -U "pip>=20.3" .. note:: In general, we recommend using a @@ -85,28 +96,32 @@ version (``HEAD`` of ``main`` branch): :widths: auto * - Linux - - `Python 3.8 `__ - - `Python 3.9 `__ - - `Python 3.10 `__ - - `Python 3.11 `__ + - `Python 3.8 `__ + - `Python 3.9 `__ + - `Python 3.10 `__ + - `Python 3.11 `__ + - `Python 3.12 `__ * - Linux (CPU) - - `Python 3.8 `__ - - `Python 3.9 `__ - - `Python 3.10 `__ - - `Python 3.11 `__ + - `Python 3.8 `__ + - `Python 3.9 `__ + - `Python 3.10 `__ + - `Python 3.11 `__ + - `Python 3.12 `__ * - MacOS - - `Python 3.8 (x86_64) `__ - - `Python 3.9 (x86_64) `__ - - `Python 3.10 (x86_64+arm64) `__ - - `Python 3.11 (x86_64+arm64) `__ + - `Python 3.8 (x86_64) `__ + - `Python 3.9 (x86_64) `__ + - `Python 3.10 (x86_64+arm64) `__ + - `Python 3.11 (x86_64+arm64) `__ + - `Python 3.12 (x86_64+arm64) `__ * - Windows - - `Python 3.8 `__ - - `Python 3.9 `__ - - `Python 3.10 `__ - - `Python 3.11 `__ + - `Python 3.8 `__ + - `Python 3.9 `__ + - `Python 3.10 `__ + - `Python 3.11 `__ + - `Python 3.12 `__ Please use these links from the `latest version of this page `__ only. You can also @@ -114,7 +129,7 @@ install the latest development version directly with pip: .. code-block:: bash - pip install -U -f https://www.open3d.org/docs/latest/getting_started.html open3d + pip install -U -f https://www.open3d.org/docs/latest/getting_started.html --only-binary open3d open3d .. warning:: The development wheels for Linux are named according to PEP600. Please @@ -173,28 +188,28 @@ rendering resources. These are built with all supported features and are available for the main supported platforms. Also, the latest development version (``HEAD`` of ``main`` branch) binary package archives are provided here [#]_: -:Linux (Ubuntu 18.04+ or glibc 2.27+ [#]_): +:Linux (Ubuntu 20.04+ or glibc 2.31+ [#]_): .. hlist:: :columns: 2 - * `x86_64 (CXX11 ABI) `__ - * `x86_64 (CXX11 ABI) with CUDA 11.x `__ - * `x86_64 (pre CXX11 ABI) `__ - * `x86_64 (pre CXX11 ABI) with CUDA 11.x `__ + * `x86_64 (CXX11 ABI) `__ + * `x86_64 (CXX11 ABI) with CUDA 11.x `__ + * `x86_64 (pre CXX11 ABI) `__ + * `x86_64 (pre CXX11 ABI) with CUDA 11.x `__ :MacOSX v10.15+: .. hlist:: :columns: 2 - * `x86_64 `__ - * `arm64 `__ + * `x86_64 `__ + * `arm64 `__ :Windows 10+: .. hlist:: :columns: 2 - * `x86_64 Release `__ - * `x86_64 Debug `__ + * `x86_64 Release `__ + * `x86_64 Debug `__ .. [#] Please use these links from the `latest version of this page `__ only. diff --git a/docs/jupyter/jupyter_run_all.py b/docs/jupyter/jupyter_run_all.py index 5cbb244d56d..9c39c2578c0 100644 --- a/docs/jupyter/jupyter_run_all.py +++ b/docs/jupyter/jupyter_run_all.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/docs/jupyter/jupyter_strip_output.py b/docs/jupyter/jupyter_strip_output.py index b08a2731c58..0fb6d562fb1 100644 --- a/docs/jupyter/jupyter_strip_output.py +++ b/docs/jupyter/jupyter_strip_output.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/docs/jupyter/open3d_tutorial.py b/docs/jupyter/open3d_tutorial.py index 36589f76dd9..3aa767f6617 100644 --- a/docs/jupyter/open3d_tutorial.py +++ b/docs/jupyter/open3d_tutorial.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/docs/make_docs.py b/docs/make_docs.py index 0803b36bba8..7f691afd81c 100644 --- a/docs/make_docs.py +++ b/docs/make_docs.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- @@ -77,9 +77,9 @@ def generate_rst(self): try: module = self._try_import_module(module_name) self._generate_module_class_function_docs(module_name, module) - except: - print("[Warning] Module {} cannot be imported.".format( - module_name)) + except Exception as _e: + print(f"[Warning] Module {module_name} cannot be imported: " + f"{_e}.") @staticmethod def _get_documented_module_names(): @@ -88,7 +88,7 @@ def _get_documented_module_names(): with open("documented_modules.txt", "r") as f: for line in f: print(line, end="") - m = re.match("^(open3d\..*)\s*$", line) + m = re.match(r"^(open3d\..*)\s*$", line) if m: module_names.append(m.group(1)) print("Documented modules:") diff --git a/docs/release.md b/docs/release.md index 514114f5a04..90ea6144074 100644 --- a/docs/release.md +++ b/docs/release.md @@ -17,12 +17,12 @@ Collect all release artifacts in the [Github draft release page](https://github. Configure: `cmake -DCMAKE_BUILD_TYPE=Release -DDEVELOPER_BUILD=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DBUILD_TENSORFLOW_OPS=ON -DBUILD_PYTORCH_OPS=ON -DBUNDLE_OPEN3D_ML=ON ..` - - [ ] Ubuntu 18.04 Python (all versions) (follow docs/arm.rst) (desktop) + - [ ] Ubuntu 20.04 Python (all versions) (follow docs/arm.rst) (desktop) Build command: `cd docker; ./docker_build.sh openblas-arm64-py311; ...` - [ ] Build Open3D app - - [ ] Ubuntu 18.04, Windows 10, macOS 10.15 x86_64: (CI) + - [ ] Ubuntu 20.04, Windows 10, macOS 10.15 x86_64: (CI) - [ ] macOS 12 arm64 (desktop) - [ ] macOS (x86_64, arm64) sign (desktop): diff --git a/docs/requirements.txt b/docs/requirements.txt index a974fc66a1d..d52283a5db3 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,9 +1,12 @@ docutils==0.20.1 furo==2023.9.10 -jinja2==3.1.3 +jinja2==3.1.4 m2r2==0.3.3.post2 matplotlib==3.7.3 nbsphinx==0.9.3 sphinx==7.1.2 +sphinx-tabs==3.4.7 +sphinx-copybutton==0.5.2 nbconvert==6.5.4 -lxml[html_clean]==5.2.1 +lxml==5.2.1 +lxml_html_clean==0.4.0 diff --git a/docs/tutorial/reference.rst b/docs/tutorial/reference.rst index aae533c89eb..2afcb0a9f7a 100644 --- a/docs/tutorial/reference.rst +++ b/docs/tutorial/reference.rst @@ -13,6 +13,7 @@ Reference .. [Ester1996] M. Ester and H.-P. Kriegel and J Sander and X. Xu, A density-based algorithm for discovering clusters in large spatial databases with noise, KDD, 1996. .. [Katz2007] S. Katz and A. Tal and R. Basri, Direct visibility of point sets, SIGGRAPH, 2007. .. [Kazhdan2006] M. Kazhdan and M. Bolitho and H. Hoppe: Poisson surface reconstruction, Eurographics, 2006. +.. [Knapitsch2017] A. Knapitsch and J. Park and Q. Zhou and V. Koltun: Tanks and Temples: Benchmarking Large-Scale Scene Reconstruction, ACM Transactions on Graphics, vol 36 (4), 2017 .. [Loop1987] C. Loop: Smooth Subdivision Surfaces Based on Triangles, M.S. Mathematics thesis, University of Utah, 1987 .. [LorensenAndCline1987] W. E. Lorensen and H. E. Cline, Marching cubes: A high resolution 3d surface construction algorithm, ACM Computer Graphics, 1987 .. [Newcombe2011] R. A. Newcombe, S. Izadi, O. Hilliges, D. Molyneaux, D. Kim, A. J. Davison, P. Kohli, J. Shotton, S. Hodges, and A. Fitzgibbon. KinectFusion: Real-time dense surface mapping and tracking. In ISMAR, 2011. diff --git a/docs/tutorial/visualization/cpu_rendering.rst b/docs/tutorial/visualization/cpu_rendering.rst index f504382469e..ec920324fc8 100644 --- a/docs/tutorial/visualization/cpu_rendering.rst +++ b/docs/tutorial/visualization/cpu_rendering.rst @@ -31,7 +31,6 @@ the :class: `.OffscreenRenderer` for a process by setting an environment variable before importing Open3D:: - ``EGL_PLATFORM=surfaceless`` for Ubuntu 20.04+ (Mesa v20.2 or newer) - - ``OPEN3D_CPU_RENDERING=true`` for Ubuntu 18.04 (Mesa older than v20.2). Here are the different ways to do that: @@ -39,20 +38,16 @@ Here are the different ways to do that: # from the command line (Ubuntu 20.04+) EGL_PLATFORM=surfaceless python examples/python/visualization/render_to_image.py - # or Ubuntu 18.04 - OPEN3D_CPU_RENDERING=true python examples/python/visualization/render_to_image.py .. code:: python # In Python code import os os.environ['EGL_PLATFORM'] = 'surfaceless' # Ubuntu 20.04+ - os.environ['OPEN3D_CPU_RENDERING'] = 'true' # Ubuntu 18.04 import open3d as o3d # In a Jupyter notebook %env EGL_PLATFORM surfaceless # Ubuntu 20.04+ - %env OPEN3D_CPU_RENDERING true # Ubuntu 18.04 import open3d as o3d .. note:: Setting the environment variable after importing ``open3d`` will not work, @@ -106,30 +101,4 @@ The method for enabling interactive CPU rendering depends on your system: .. code:: bash export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libGLX_mesa.so.0 - python examples/python/visualization/draw.py - -3. **Your OS has old Mesa drivers (< v20.2).** We provide - the Mesa software rendering library binary for download `here - `__. - This is automatically downloaded to - `build/_deps/download_mesa_libgl-src/libGL.so.1.5.0` when you build Open3D - from source. The prebuilt version works on Ubuntu 18.04 and Ubuntu 20.04. If - you want to use CPU rendering all the time, install this library to - ``/usr/local/lib`` or ``$HOME/.local/lib`` and *prepend* it to your - ``LD_LIBRARY_PATH``: - - .. code:: bash - - export LD_LIBRARY_PATH=$HOME/.local/lib:$LD_LIBRARY_PATH - - For occasional use, you can instead launch a program with CPU rendering with: - - .. code:: bash - - LD_PRELOAD=$HOME/.local/lib/libGL.so.1.5.0 Open3D - - Or with Python code: - - .. code:: bash - - LD_PRELOAD=$HOME/.local/lib/libGL.so.1.5.0 python examples/python/visualization/draw.py + python examples/python/visualization/draw.py \ No newline at end of file diff --git a/examples/cmake/open3d-cmake-external-project/CMakeLists.txt b/examples/cmake/open3d-cmake-external-project/CMakeLists.txt new file mode 100644 index 00000000000..a26a7de64c2 --- /dev/null +++ b/examples/cmake/open3d-cmake-external-project/CMakeLists.txt @@ -0,0 +1,52 @@ +# On Ubuntu 20.04, get the latest CMake from https://apt.kitware.com/. +cmake_minimum_required(VERSION 3.24) + +project(Open3DCMakeExternalProject LANGUAGES C CXX) + +option(GLIBCXX_USE_CXX11_ABI "Set -D_GLIBCXX_USE_CXX11_ABI=1" OFF) +option(STATIC_WINDOWS_RUNTIME "Use static (MT/MTd) Windows runtime" ON ) + +if(NOT CMAKE_BUILD_TYPE) + message(STATUS "No CMAKE_BUILD_TYPE specified, default to Release.") + set(CMAKE_BUILD_TYPE "Release") +endif() + +# Option 1: Use ExternalProject_Add, as shown in this CMake example. +# Option 2: Install Open3D first and use find_package, see +# http://www.open3d.org/docs/release/cpp_project.html for details. +include(ExternalProject) +ExternalProject_Add( + external_open3d + PREFIX open3d + GIT_REPOSITORY https://github.com/isl-org/Open3D.git + GIT_TAG main # Use a specific tag, e.g. v0.18.0 to pin Open3D version. + GIT_SHALLOW ON + UPDATE_COMMAND "" + # Check out https://github.com/intel-isl/Open3D/blob/master/CMakeLists.txt + # For the full list of available options. + CMAKE_ARGS + -DCMAKE_INSTALL_PREFIX= + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} + -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} + -DGLIBCXX_USE_CXX11_ABI=${GLIBCXX_USE_CXX11_ABI} + -DSTATIC_WINDOWS_RUNTIME=${STATIC_WINDOWS_RUNTIME} + -DBUILD_SHARED_LIBS=ON + -DBUILD_PYTHON_MODULE=OFF + -DBUILD_EXAMPLES=OFF +) + +# Simulate importing Open3D::Open3D +ExternalProject_Get_Property(external_open3d INSTALL_DIR) +add_library(Open3DHelper INTERFACE) +add_dependencies(Open3DHelper external_open3d) +target_compile_features(Open3DHelper INTERFACE cxx_std_14) +target_compile_definitions(Open3DHelper INTERFACE _GLIBCXX_USE_CXX11_ABI=$) +target_include_directories(Open3DHelper INTERFACE "${INSTALL_DIR}/include" "${INSTALL_DIR}/include/open3d/3rdparty") +target_link_directories(Open3DHelper INTERFACE "${INSTALL_DIR}/lib") +target_link_libraries(Open3DHelper INTERFACE Open3D) +add_library(Open3D::Open3D ALIAS Open3DHelper) + +add_executable(Draw) +target_sources(Draw PRIVATE Draw.cpp) +target_link_libraries(Draw PRIVATE Open3D::Open3D) diff --git a/examples/cmake/open3d-cmake-external-project/Draw.cpp b/examples/cmake/open3d-cmake-external-project/Draw.cpp new file mode 100644 index 00000000000..0d01a1b72d8 --- /dev/null +++ b/examples/cmake/open3d-cmake-external-project/Draw.cpp @@ -0,0 +1,26 @@ +// ---------------------------------------------------------------------------- +// - Open3D: www.open3d.org - +// ---------------------------------------------------------------------------- +// Copyright (c) 2018-2024 www.open3d.org +// SPDX-License-Identifier: MIT +// ---------------------------------------------------------------------------- + +#include + +#include "open3d/Open3D.h" + +int main(int argc, char *argv[]) { + if (argc == 2) { + std::string option(argv[1]); + if (option == "--skip-for-unit-test") { + open3d::utility::LogInfo("Skiped for unit test."); + return 0; + } + } + + auto sphere = open3d::geometry::TriangleMesh::CreateSphere(1.0); + sphere->ComputeVertexNormals(); + sphere->PaintUniformColor({0.0, 1.0, 0.0}); + open3d::visualization::DrawGeometries({sphere}); + return 0; +} diff --git a/examples/cmake/open3d-cmake-external-project/README.md b/examples/cmake/open3d-cmake-external-project/README.md new file mode 100644 index 00000000000..fb8aec6c650 --- /dev/null +++ b/examples/cmake/open3d-cmake-external-project/README.md @@ -0,0 +1,56 @@ +# Use Open3D as a CMake External Project + +This is one of the two CMake examples showing how to use Open3D in your CMake +project: + +- [Find Pre-Installed Open3D Package in CMake](../open3d-cmake-find-package) +- [Use Open3D as a CMake External Project](../open3d-cmake-external-project) + +For more details, check out the [Open3D repo](https://github.com/isl-org/Open3D) and +[Open3D docs](http://www.open3d.org/docs/release/cpp_project.html). + +## Step 1: Install Open3D dependencies + +On Ubuntu: + +```bash +# Install minimal Open3D compilation dependencies. For the full list, checkout: +# https://github.com/isl-org/Open3D/blob/master/util/install_deps_ubuntu.sh +sudo apt-get --yes install xorg-dev libglu1-mesa-dev +``` + +On macOS/Windows: + +```bash +# Skip this step +``` + +## Step 2: Use Open3D in this example project + +You can specify the number of parallel jobs to speed up compilation. + +On Ubuntu/macOS: + +```bash +wget https://github.com/isl-org/Open3D/archive/refs/heads/main.zip -o Open3D-main.zip +unzip Open3D-main.zip 'Open3D-main/cmake/ispc_isas/*' -d example-project +cd example-project/Open3D-main/examples/cmake/open3d-cmake-external-project +mkdir build +cd build +cmake .. +make -j 12 +./Draw +``` + +On Windows: + +```batch +wget https://github.com/isl-org/Open3D/archive/refs/heads/main.zip -o Open3D-main.zip +unzip Open3D-main.zip 'Open3D-main/cmake/ispc_isas/*' -d example-project +cd example-project/Open3D-main/examples/cmake/open3d-cmake-external-project +mkdir build +cd build +cmake .. +cmake --build . --config Release --parallel 12 +Release\Draw +``` diff --git a/examples/cmake/open3d-cmake-find-package/CMakeLists.txt b/examples/cmake/open3d-cmake-find-package/CMakeLists.txt new file mode 100644 index 00000000000..ca4835515b7 --- /dev/null +++ b/examples/cmake/open3d-cmake-find-package/CMakeLists.txt @@ -0,0 +1,36 @@ +# On Ubuntu 20.04, get the latest CMake from https://apt.kitware.com/. +cmake_minimum_required(VERSION 3.24) + +project(Open3DCMakeFindPackage LANGUAGES C CXX) + +# 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. +option(STATIC_WINDOWS_RUNTIME "Use static (MT/MTd) Windows runtime" ON) +if(STATIC_WINDOWS_RUNTIME) + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") +else() + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL") +endif() + +# Find installed Open3D, which exports Open3D::Open3D +find_package(Open3D REQUIRED) + +add_executable(Draw) +target_sources(Draw PRIVATE Draw.cpp) +target_link_libraries(Draw PRIVATE Open3D::Open3D) + +# On Windows if BUILD_SHARED_LIBS is enabled, copy .dll files to the executable directory +if(WIN32) + get_target_property(open3d_type Open3D::Open3D TYPE) + if(open3d_type STREQUAL "SHARED_LIBRARY") + set(copy_dlls "${CMAKE_INSTALL_PREFIX}/bin/tbb12$<$:_debug>.dll" + "${CMAKE_INSTALL_PREFIX}/bin/Open3D.dll") + else() + set(copy_dlls "${CMAKE_INSTALL_PREFIX}/bin/tbb12$<$:_debug>.dll") + endif() + add_custom_command(TARGET Draw POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${copy_dlls} + ${CMAKE_CURRENT_BINARY_DIR}/$ + COMMENT "Copying Open3D DLLs to ${CMAKE_CURRENT_BINARY_DIR}/$") +endif() diff --git a/examples/cmake/open3d-cmake-find-package/Draw.cpp b/examples/cmake/open3d-cmake-find-package/Draw.cpp new file mode 100644 index 00000000000..0d01a1b72d8 --- /dev/null +++ b/examples/cmake/open3d-cmake-find-package/Draw.cpp @@ -0,0 +1,26 @@ +// ---------------------------------------------------------------------------- +// - Open3D: www.open3d.org - +// ---------------------------------------------------------------------------- +// Copyright (c) 2018-2024 www.open3d.org +// SPDX-License-Identifier: MIT +// ---------------------------------------------------------------------------- + +#include + +#include "open3d/Open3D.h" + +int main(int argc, char *argv[]) { + if (argc == 2) { + std::string option(argv[1]); + if (option == "--skip-for-unit-test") { + open3d::utility::LogInfo("Skiped for unit test."); + return 0; + } + } + + auto sphere = open3d::geometry::TriangleMesh::CreateSphere(1.0); + sphere->ComputeVertexNormals(); + sphere->PaintUniformColor({0.0, 1.0, 0.0}); + open3d::visualization::DrawGeometries({sphere}); + return 0; +} diff --git a/examples/cmake/open3d-cmake-find-package/README.md b/examples/cmake/open3d-cmake-find-package/README.md new file mode 100644 index 00000000000..5bae407b7fa --- /dev/null +++ b/examples/cmake/open3d-cmake-find-package/README.md @@ -0,0 +1,75 @@ +# Find Pre-Installed Open3D Package in CMake + +This is one of the two CMake examples showing how to use Open3D in your CMake +project: + +- [Find Pre-Installed Open3D Package in CMake](../open3d-cmake-find-package) +- [Use Open3D as a CMake External Project](../open3d-cmake-external-project) + +For more details, check out the [Open3D repo](https://github.com/isl-org/Open3D) and +[Open3D docs](http://www.open3d.org/docs/release/cpp_project.html). + +You may download a precompiled binary package (recommended), or compile your +own. + +## Step 1a: Download pre-compiled Open3D binary package + +Download the pre-compiled Open3D binary package from the [Open3D release page](https://github.com/isl-org/Open3D/releases). The binary package is available for Ubuntu (with and without CUDA), macOS (Inel and Apple Si), and Windows. You may download a stable release or a development build (devel-main). + +## Step 1b: Compile and install Open3D + +Follow the [Open3D compilation guide](http://www.open3d.org/docs/release/compilation.html), +compile and install Open3D in your preferred location. You can specify the +installation path with `CMAKE_INSTALL_PREFIX` and the number of parallel jobs +to speed up compilation. + +On Ubuntu/macOS: + +```bash +git clone https://github.com/isl-org/Open3D.git +cd Open3D +mkdir build +cd build +cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=${HOME}/open3d_install .. +make install -j 12 +cd ../.. +``` + +On Windows: + +```batch +git clone https://github.com/isl-org/Open3D.git +cd Open3D +mkdir build +cd build +cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=C:\open3d_install .. +cmake --build . --config Release --parallel 12 --target install +cd ..\.. +``` + +Note: `-DBUILD_SHARED_LIBS=ON` is recommended if `-DBUILD_CUDA_MODULE=ON`. + +## Step 2: Use Open3D in this example project + +On Ubuntu/macOS: + +```bash +cp -ar Open3D/examples/cmake/open3d-cmake-find-package . +cd open3d-cmake-find-package +mkdir build +cd build +cmake -DOpen3D_ROOT=${HOME}/open3d_install .. +make -j 12 +./Draw +``` + +On Windows: + +```batch +cp -ar Open3D/examples/cmake/open3d-cmake-find-package . +cd open3d-cmake-find-package +mkdir build +cmake -DOpen3D_ROOT=C:\open3d_install .. +cmake --build . --config Release --parallel 12 +Release\Draw +``` diff --git a/examples/cpp/AzureKinectMKVReader.cpp b/examples/cpp/AzureKinectMKVReader.cpp index 16d0f6cc484..b6ac2199a49 100644 --- a/examples/cpp/AzureKinectMKVReader.cpp +++ b/examples/cpp/AzureKinectMKVReader.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/AzureKinectRecord.cpp b/examples/cpp/AzureKinectRecord.cpp index 05e8ee91460..15fe045b47c 100644 --- a/examples/cpp/AzureKinectRecord.cpp +++ b/examples/cpp/AzureKinectRecord.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/examples/cpp/AzureKinectViewer.cpp b/examples/cpp/AzureKinectViewer.cpp index e525e50001d..48913663a20 100644 --- a/examples/cpp/AzureKinectViewer.cpp +++ b/examples/cpp/AzureKinectViewer.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/examples/cpp/CameraPoseTrajectory.cpp b/examples/cpp/CameraPoseTrajectory.cpp index dfd4d71eeef..4498dd871e7 100644 --- a/examples/cpp/CameraPoseTrajectory.cpp +++ b/examples/cpp/CameraPoseTrajectory.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/ColorMapOptimization.cpp b/examples/cpp/ColorMapOptimization.cpp index 7de5bb6bf10..c96b3da17ec 100644 --- a/examples/cpp/ColorMapOptimization.cpp +++ b/examples/cpp/ColorMapOptimization.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/DepthCapture.cpp b/examples/cpp/DepthCapture.cpp index 8ae8cba7b58..30715e95df8 100644 --- a/examples/cpp/DepthCapture.cpp +++ b/examples/cpp/DepthCapture.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/Draw.cpp b/examples/cpp/Draw.cpp index c8e05973b35..a3b3fb74404 100644 --- a/examples/cpp/Draw.cpp +++ b/examples/cpp/Draw.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/DrawWebRTC.cpp b/examples/cpp/DrawWebRTC.cpp index 96dccdd164e..45fdce9fe80 100644 --- a/examples/cpp/DrawWebRTC.cpp +++ b/examples/cpp/DrawWebRTC.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/EvaluatePCDMatch.cpp b/examples/cpp/EvaluatePCDMatch.cpp index ce3f07c1864..b26ebd2986b 100644 --- a/examples/cpp/EvaluatePCDMatch.cpp +++ b/examples/cpp/EvaluatePCDMatch.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/FileDialog.cpp b/examples/cpp/FileDialog.cpp index b4f25195145..ea0564cdc0c 100644 --- a/examples/cpp/FileDialog.cpp +++ b/examples/cpp/FileDialog.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/FileSystem.cpp b/examples/cpp/FileSystem.cpp index b93ea9a1c2b..bb7d5a84db4 100644 --- a/examples/cpp/FileSystem.cpp +++ b/examples/cpp/FileSystem.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/Flann.cpp b/examples/cpp/Flann.cpp index 4217c3e2a81..c747920bcaa 100644 --- a/examples/cpp/Flann.cpp +++ b/examples/cpp/Flann.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/GeneralizedICP.cpp b/examples/cpp/GeneralizedICP.cpp index 614c9cf5b86..92c7b7171db 100644 --- a/examples/cpp/GeneralizedICP.cpp +++ b/examples/cpp/GeneralizedICP.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/ISSKeypoints.cpp b/examples/cpp/ISSKeypoints.cpp index c5088d9b11b..768883ae65a 100644 --- a/examples/cpp/ISSKeypoints.cpp +++ b/examples/cpp/ISSKeypoints.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // @author Ignacio Vizzo [ivizzo@uni-bonn.de] diff --git a/examples/cpp/Image.cpp b/examples/cpp/Image.cpp index 9ea23a34615..1603e2c9f4d 100644 --- a/examples/cpp/Image.cpp +++ b/examples/cpp/Image.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/IntegrateRGBD.cpp b/examples/cpp/IntegrateRGBD.cpp index 39fc3d98225..0ffcaa1a219 100644 --- a/examples/cpp/IntegrateRGBD.cpp +++ b/examples/cpp/IntegrateRGBD.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/LineSet.cpp b/examples/cpp/LineSet.cpp index 836e3d740e4..9307354857f 100644 --- a/examples/cpp/LineSet.cpp +++ b/examples/cpp/LineSet.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/Log.cpp b/examples/cpp/Log.cpp index ba5ebeb408a..8a6cdd2d436 100644 --- a/examples/cpp/Log.cpp +++ b/examples/cpp/Log.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/MultipleWindows.cpp b/examples/cpp/MultipleWindows.cpp index 01921f9cf33..2735d1f4185 100644 --- a/examples/cpp/MultipleWindows.cpp +++ b/examples/cpp/MultipleWindows.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/Octree.cpp b/examples/cpp/Octree.cpp index bf0cca65323..210eae7d221 100644 --- a/examples/cpp/Octree.cpp +++ b/examples/cpp/Octree.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/OdometryRGBD.cpp b/examples/cpp/OdometryRGBD.cpp index 1848edbed05..f5f8037031d 100644 --- a/examples/cpp/OdometryRGBD.cpp +++ b/examples/cpp/OdometryRGBD.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/OfflineSLAM.cpp b/examples/cpp/OfflineSLAM.cpp index 3e67b194b21..d865b537fb2 100644 --- a/examples/cpp/OfflineSLAM.cpp +++ b/examples/cpp/OfflineSLAM.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/OffscreenRendering.cpp b/examples/cpp/OffscreenRendering.cpp index 5e73cda538b..18bc71d3b76 100644 --- a/examples/cpp/OffscreenRendering.cpp +++ b/examples/cpp/OffscreenRendering.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/OnlineSLAMRGBD.cpp b/examples/cpp/OnlineSLAMRGBD.cpp index 70f915d5b5f..2101e7aab18 100644 --- a/examples/cpp/OnlineSLAMRGBD.cpp +++ b/examples/cpp/OnlineSLAMRGBD.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/OnlineSLAMRealSense.cpp b/examples/cpp/OnlineSLAMRealSense.cpp index 4e1b26aa447..754a0d41371 100644 --- a/examples/cpp/OnlineSLAMRealSense.cpp +++ b/examples/cpp/OnlineSLAMRealSense.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/OnlineSLAMUtil.h b/examples/cpp/OnlineSLAMUtil.h index 358256de3df..56e91eea139 100644 --- a/examples/cpp/OnlineSLAMUtil.h +++ b/examples/cpp/OnlineSLAMUtil.h @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/OpenMP.cpp b/examples/cpp/OpenMP.cpp index 0995a0bf49e..f61e9aa2909 100644 --- a/examples/cpp/OpenMP.cpp +++ b/examples/cpp/OpenMP.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/PCDFileFormat.cpp b/examples/cpp/PCDFileFormat.cpp index 6de798ef5ac..0bd7db87226 100644 --- a/examples/cpp/PCDFileFormat.cpp +++ b/examples/cpp/PCDFileFormat.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/PlanarPatchDetection.cpp b/examples/cpp/PlanarPatchDetection.cpp index ccc5dc28747..b8c4c41ef98 100644 --- a/examples/cpp/PlanarPatchDetection.cpp +++ b/examples/cpp/PlanarPatchDetection.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/PointCloud.cpp b/examples/cpp/PointCloud.cpp index 9de7cc3b11c..73bc9e15209 100644 --- a/examples/cpp/PointCloud.cpp +++ b/examples/cpp/PointCloud.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/PoseGraph.cpp b/examples/cpp/PoseGraph.cpp index 226a35cafdc..179e9210813 100644 --- a/examples/cpp/PoseGraph.cpp +++ b/examples/cpp/PoseGraph.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/ProgramOptions.cpp b/examples/cpp/ProgramOptions.cpp index 0c606ca93ee..38483fd885b 100644 --- a/examples/cpp/ProgramOptions.cpp +++ b/examples/cpp/ProgramOptions.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/RGBDOdometry.cpp b/examples/cpp/RGBDOdometry.cpp index 536e7a883ec..2a292519d3d 100644 --- a/examples/cpp/RGBDOdometry.cpp +++ b/examples/cpp/RGBDOdometry.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/RealSenseBagReader.cpp b/examples/cpp/RealSenseBagReader.cpp index 8fd81397022..a231a1759f6 100644 --- a/examples/cpp/RealSenseBagReader.cpp +++ b/examples/cpp/RealSenseBagReader.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/RealSenseRecorder.cpp b/examples/cpp/RealSenseRecorder.cpp index 2efa912cc00..2904703cb52 100644 --- a/examples/cpp/RealSenseRecorder.cpp +++ b/examples/cpp/RealSenseRecorder.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/RegistrationColoredICP.cpp b/examples/cpp/RegistrationColoredICP.cpp index 9f5d5776382..eb07869000e 100644 --- a/examples/cpp/RegistrationColoredICP.cpp +++ b/examples/cpp/RegistrationColoredICP.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/RegistrationDopplerICP.cpp b/examples/cpp/RegistrationDopplerICP.cpp index 331bd8dfd56..07acea0afd0 100644 --- a/examples/cpp/RegistrationDopplerICP.cpp +++ b/examples/cpp/RegistrationDopplerICP.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/RegistrationFGR.cpp b/examples/cpp/RegistrationFGR.cpp index 77c0120d0b1..c0d0d18377d 100644 --- a/examples/cpp/RegistrationFGR.cpp +++ b/examples/cpp/RegistrationFGR.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/RegistrationRANSAC.cpp b/examples/cpp/RegistrationRANSAC.cpp index 2a84bbcff04..7e6829657e6 100644 --- a/examples/cpp/RegistrationRANSAC.cpp +++ b/examples/cpp/RegistrationRANSAC.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/SLAC.cpp b/examples/cpp/SLAC.cpp index 071ee192e0d..c783a3470aa 100644 --- a/examples/cpp/SLAC.cpp +++ b/examples/cpp/SLAC.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/SLACIntegrate.cpp b/examples/cpp/SLACIntegrate.cpp index 3bf00e14e0f..593435e0802 100644 --- a/examples/cpp/SLACIntegrate.cpp +++ b/examples/cpp/SLACIntegrate.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/SYCLDemo.cpp b/examples/cpp/SYCLDemo.cpp index 2fcd8c55dd1..d85c93d3f8e 100644 --- a/examples/cpp/SYCLDemo.cpp +++ b/examples/cpp/SYCLDemo.cpp @@ -1,13 +1,13 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- #include "open3d/core/SYCLUtils.h" int main() { - open3d::core::sycl::SYCLDemo(); + open3d::core::sy::SYCLDemo(); return 0; } diff --git a/examples/cpp/TICP.cpp b/examples/cpp/TICP.cpp index d7995e233f1..a63298c7614 100644 --- a/examples/cpp/TICP.cpp +++ b/examples/cpp/TICP.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/TICPSequential.cpp b/examples/cpp/TICPSequential.cpp index d0bf4dcee42..3efba06e75c 100644 --- a/examples/cpp/TICPSequential.cpp +++ b/examples/cpp/TICPSequential.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/TIntegrateRGBD.cpp b/examples/cpp/TIntegrateRGBD.cpp index cab188b6dc8..283bb40d79b 100644 --- a/examples/cpp/TIntegrateRGBD.cpp +++ b/examples/cpp/TIntegrateRGBD.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- #include "open3d/Open3D.h" diff --git a/examples/cpp/TOdometryRGBD.cpp b/examples/cpp/TOdometryRGBD.cpp index a39580ed018..c4414f4652f 100644 --- a/examples/cpp/TOdometryRGBD.cpp +++ b/examples/cpp/TOdometryRGBD.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- #include "open3d/Open3D.h" diff --git a/examples/cpp/TriangleMesh.cpp b/examples/cpp/TriangleMesh.cpp index 64082476cb5..be3b5215ea9 100644 --- a/examples/cpp/TriangleMesh.cpp +++ b/examples/cpp/TriangleMesh.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/TrimMeshBasedOnPointCloud.cpp b/examples/cpp/TrimMeshBasedOnPointCloud.cpp index a5f82506f0a..ffb5f47d8c4 100644 --- a/examples/cpp/TrimMeshBasedOnPointCloud.cpp +++ b/examples/cpp/TrimMeshBasedOnPointCloud.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/ViewDistances.cpp b/examples/cpp/ViewDistances.cpp index ab61377f3f9..2404645c379 100644 --- a/examples/cpp/ViewDistances.cpp +++ b/examples/cpp/ViewDistances.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/ViewPCDMatch.cpp b/examples/cpp/ViewPCDMatch.cpp index 526f3617bb6..c8669f4f48e 100644 --- a/examples/cpp/ViewPCDMatch.cpp +++ b/examples/cpp/ViewPCDMatch.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/Visualizer.cpp b/examples/cpp/Visualizer.cpp index d7ffcedbc66..44bedaeec02 100644 --- a/examples/cpp/Visualizer.cpp +++ b/examples/cpp/Visualizer.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/Voxelization.cpp b/examples/cpp/Voxelization.cpp index e0265b3f1d0..5461dba55ec 100644 --- a/examples/cpp/Voxelization.cpp +++ b/examples/cpp/Voxelization.cpp @@ -1,7 +1,7 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- diff --git a/examples/cpp/registration_example_util/download_kitti.py b/examples/cpp/registration_example_util/download_kitti.py index f736353487f..a202d32aaf0 100644 --- a/examples/cpp/registration_example_util/download_kitti.py +++ b/examples/cpp/registration_example_util/download_kitti.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/benchmark/benchmark_fgr.py b/examples/python/benchmark/benchmark_fgr.py index 57b02bd09b1..9e832764271 100644 --- a/examples/python/benchmark/benchmark_fgr.py +++ b/examples/python/benchmark/benchmark_fgr.py @@ -1,13 +1,14 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- import os import sys import numpy as np +import open3d as o3d pyexample_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(pyexample_path) diff --git a/examples/python/benchmark/benchmark_nns.py b/examples/python/benchmark/benchmark_nns.py index 0b18a37e97a..b1242af5deb 100644 --- a/examples/python/benchmark/benchmark_nns.py +++ b/examples/python/benchmark/benchmark_nns.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/benchmark/benchmark_pre.py b/examples/python/benchmark/benchmark_pre.py index 3d949cc42c3..4f82f16aef7 100644 --- a/examples/python/benchmark/benchmark_pre.py +++ b/examples/python/benchmark/benchmark_pre.py @@ -1,13 +1,14 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- import os import sys import pickle +import open3d as o3d pyexample_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(pyexample_path) diff --git a/examples/python/benchmark/benchmark_ransac.py b/examples/python/benchmark/benchmark_ransac.py index 08d833cb9eb..de9f9a04c4d 100644 --- a/examples/python/benchmark/benchmark_ransac.py +++ b/examples/python/benchmark/benchmark_ransac.py @@ -1,13 +1,14 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- import os import sys import numpy as np +import open3d as o3d pyexample_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(pyexample_path) diff --git a/examples/python/benchmark/benchmark_tsdf.py b/examples/python/benchmark/benchmark_tsdf.py index 44f38d45370..516fe601e1b 100644 --- a/examples/python/benchmark/benchmark_tsdf.py +++ b/examples/python/benchmark/benchmark_tsdf.py @@ -1,15 +1,15 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- -import open3d as o3d import numpy as np import time import os import sys +import open3d as o3d pyexample_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(pyexample_path) diff --git a/examples/python/benchmark/benchmark_utils.py b/examples/python/benchmark/benchmark_utils.py index d7f6e1dbb9d..12af2f3cddb 100644 --- a/examples/python/benchmark/benchmark_utils.py +++ b/examples/python/benchmark/benchmark_utils.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/camera/camera_trajectory.py b/examples/python/camera/camera_trajectory.py index 132dea28bb8..4b729fee07d 100644 --- a/examples/python/camera/camera_trajectory.py +++ b/examples/python/camera/camera_trajectory.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/image_processing.py b/examples/python/geometry/image_processing.py index abf9bde1c72..c0a5056236c 100644 --- a/examples/python/geometry/image_processing.py +++ b/examples/python/geometry/image_processing.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/kd_tree_feature_matching.py b/examples/python/geometry/kd_tree_feature_matching.py index 89f21f20245..10a894e03ba 100644 --- a/examples/python/geometry/kd_tree_feature_matching.py +++ b/examples/python/geometry/kd_tree_feature_matching.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/kd_tree_search.py b/examples/python/geometry/kd_tree_search.py index 145439b52d4..46ed5e8ae62 100644 --- a/examples/python/geometry/kd_tree_search.py +++ b/examples/python/geometry/kd_tree_search.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """Build a KDTree and use it for neighbour search""" diff --git a/examples/python/geometry/octree_find_leaf.py b/examples/python/geometry/octree_find_leaf.py index 85eaae4720a..3fd598be08e 100644 --- a/examples/python/geometry/octree_find_leaf.py +++ b/examples/python/geometry/octree_find_leaf.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/octree_from_voxel_grid.py b/examples/python/geometry/octree_from_voxel_grid.py index d5130a41bb4..7eeb7a3744c 100644 --- a/examples/python/geometry/octree_from_voxel_grid.py +++ b/examples/python/geometry/octree_from_voxel_grid.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/octree_point_cloud.py b/examples/python/geometry/octree_point_cloud.py index 6ed73e02259..bf2f68ee123 100644 --- a/examples/python/geometry/octree_point_cloud.py +++ b/examples/python/geometry/octree_point_cloud.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/octree_traversal.py b/examples/python/geometry/octree_traversal.py index e890d390792..37c3379f1d8 100644 --- a/examples/python/geometry/octree_traversal.py +++ b/examples/python/geometry/octree_traversal.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/point_cloud_bounding_box.py b/examples/python/geometry/point_cloud_bounding_box.py index 79ac4667fe2..45d9dfee040 100644 --- a/examples/python/geometry/point_cloud_bounding_box.py +++ b/examples/python/geometry/point_cloud_bounding_box.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/point_cloud_convex_hull.py b/examples/python/geometry/point_cloud_convex_hull.py index 98d3d5af175..c23541f8dd5 100644 --- a/examples/python/geometry/point_cloud_convex_hull.py +++ b/examples/python/geometry/point_cloud_convex_hull.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/point_cloud_crop.py b/examples/python/geometry/point_cloud_crop.py index ac53ad63862..e1cb977fa1d 100644 --- a/examples/python/geometry/point_cloud_crop.py +++ b/examples/python/geometry/point_cloud_crop.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/point_cloud_dbscan_clustering.py b/examples/python/geometry/point_cloud_dbscan_clustering.py index 5b938636e00..5fbf0e014f6 100644 --- a/examples/python/geometry/point_cloud_dbscan_clustering.py +++ b/examples/python/geometry/point_cloud_dbscan_clustering.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/point_cloud_distance.py b/examples/python/geometry/point_cloud_distance.py index 00207221134..1db4e15860b 100644 --- a/examples/python/geometry/point_cloud_distance.py +++ b/examples/python/geometry/point_cloud_distance.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/point_cloud_farthest_point_sampling.py b/examples/python/geometry/point_cloud_farthest_point_sampling.py index f4892b2e432..a799d2f0601 100644 --- a/examples/python/geometry/point_cloud_farthest_point_sampling.py +++ b/examples/python/geometry/point_cloud_farthest_point_sampling.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/point_cloud_hidden_point_removal.py b/examples/python/geometry/point_cloud_hidden_point_removal.py index ce5fa9bd74d..114e91ae9cc 100644 --- a/examples/python/geometry/point_cloud_hidden_point_removal.py +++ b/examples/python/geometry/point_cloud_hidden_point_removal.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/point_cloud_iss_keypoint_detector.py b/examples/python/geometry/point_cloud_iss_keypoint_detector.py index 486ef3104fa..06c7390b836 100644 --- a/examples/python/geometry/point_cloud_iss_keypoint_detector.py +++ b/examples/python/geometry/point_cloud_iss_keypoint_detector.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/point_cloud_normal_estimation.py b/examples/python/geometry/point_cloud_normal_estimation.py index e32f4b8703f..32f955bfbe7 100644 --- a/examples/python/geometry/point_cloud_normal_estimation.py +++ b/examples/python/geometry/point_cloud_normal_estimation.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/point_cloud_outlier_removal_radius.py b/examples/python/geometry/point_cloud_outlier_removal_radius.py index 99c53244e6d..3df3eed5a7b 100644 --- a/examples/python/geometry/point_cloud_outlier_removal_radius.py +++ b/examples/python/geometry/point_cloud_outlier_removal_radius.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/point_cloud_outlier_removal_statistical.py b/examples/python/geometry/point_cloud_outlier_removal_statistical.py index 1dc02e83b57..30f451b2f1f 100644 --- a/examples/python/geometry/point_cloud_outlier_removal_statistical.py +++ b/examples/python/geometry/point_cloud_outlier_removal_statistical.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/point_cloud_paint.py b/examples/python/geometry/point_cloud_paint.py index e82db48f215..4364964bc39 100644 --- a/examples/python/geometry/point_cloud_paint.py +++ b/examples/python/geometry/point_cloud_paint.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/point_cloud_plane_segmentation.py b/examples/python/geometry/point_cloud_plane_segmentation.py index f5650260843..20ce092de1f 100644 --- a/examples/python/geometry/point_cloud_plane_segmentation.py +++ b/examples/python/geometry/point_cloud_plane_segmentation.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/point_cloud_to_depth.py b/examples/python/geometry/point_cloud_to_depth.py index 53a58d4bfb1..af5a483d501 100644 --- a/examples/python/geometry/point_cloud_to_depth.py +++ b/examples/python/geometry/point_cloud_to_depth.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/point_cloud_to_rgbd.py b/examples/python/geometry/point_cloud_to_rgbd.py index 179fd29d172..899aa2675be 100644 --- a/examples/python/geometry/point_cloud_to_rgbd.py +++ b/examples/python/geometry/point_cloud_to_rgbd.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/point_cloud_transformation.py b/examples/python/geometry/point_cloud_transformation.py index 38d100d4fec..3383a13308c 100644 --- a/examples/python/geometry/point_cloud_transformation.py +++ b/examples/python/geometry/point_cloud_transformation.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/point_cloud_voxel_downsampling.py b/examples/python/geometry/point_cloud_voxel_downsampling.py index ad0ac27c49f..cf219c889ac 100644 --- a/examples/python/geometry/point_cloud_voxel_downsampling.py +++ b/examples/python/geometry/point_cloud_voxel_downsampling.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/point_cloud_with_numpy.py b/examples/python/geometry/point_cloud_with_numpy.py index bcd5291a158..de0394d7c73 100644 --- a/examples/python/geometry/point_cloud_with_numpy.py +++ b/examples/python/geometry/point_cloud_with_numpy.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/ray_casting_closest_geometry.py b/examples/python/geometry/ray_casting_closest_geometry.py index d465800c45d..9e8c82db9d4 100644 --- a/examples/python/geometry/ray_casting_closest_geometry.py +++ b/examples/python/geometry/ray_casting_closest_geometry.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/ray_casting_sdf.py b/examples/python/geometry/ray_casting_sdf.py index 5536ad18401..62b862fa3f9 100644 --- a/examples/python/geometry/ray_casting_sdf.py +++ b/examples/python/geometry/ray_casting_sdf.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/ray_casting_to_image.py b/examples/python/geometry/ray_casting_to_image.py index 17ed49aa9d4..153714ecc47 100644 --- a/examples/python/geometry/ray_casting_to_image.py +++ b/examples/python/geometry/ray_casting_to_image.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/rgbd_datasets.py b/examples/python/geometry/rgbd_datasets.py index c2296e22d85..812e10b19c2 100644 --- a/examples/python/geometry/rgbd_datasets.py +++ b/examples/python/geometry/rgbd_datasets.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/triangle_mesh_connected_components.py b/examples/python/geometry/triangle_mesh_connected_components.py index f4dcf9d1d02..8672b9ec845 100644 --- a/examples/python/geometry/triangle_mesh_connected_components.py +++ b/examples/python/geometry/triangle_mesh_connected_components.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/triangle_mesh_cropping.py b/examples/python/geometry/triangle_mesh_cropping.py index 62b71c889e2..663b06c00c2 100644 --- a/examples/python/geometry/triangle_mesh_cropping.py +++ b/examples/python/geometry/triangle_mesh_cropping.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/triangle_mesh_deformation.py b/examples/python/geometry/triangle_mesh_deformation.py index 70014714004..967a0a49649 100644 --- a/examples/python/geometry/triangle_mesh_deformation.py +++ b/examples/python/geometry/triangle_mesh_deformation.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/triangle_mesh_filtering_average.py b/examples/python/geometry/triangle_mesh_filtering_average.py index 4f7d271f9d1..d53d5a15de1 100644 --- a/examples/python/geometry/triangle_mesh_filtering_average.py +++ b/examples/python/geometry/triangle_mesh_filtering_average.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/triangle_mesh_from_point_cloud_alpha_shapes.py b/examples/python/geometry/triangle_mesh_from_point_cloud_alpha_shapes.py index 59e7a75754c..cb4ada90c5f 100644 --- a/examples/python/geometry/triangle_mesh_from_point_cloud_alpha_shapes.py +++ b/examples/python/geometry/triangle_mesh_from_point_cloud_alpha_shapes.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/triangle_mesh_from_point_cloud_ball_pivoting.py b/examples/python/geometry/triangle_mesh_from_point_cloud_ball_pivoting.py index 9b3b58bdb8d..31adc14b076 100644 --- a/examples/python/geometry/triangle_mesh_from_point_cloud_ball_pivoting.py +++ b/examples/python/geometry/triangle_mesh_from_point_cloud_ball_pivoting.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/triangle_mesh_from_point_cloud_poisson.py b/examples/python/geometry/triangle_mesh_from_point_cloud_poisson.py index 5c3122861af..3be6163f7ef 100644 --- a/examples/python/geometry/triangle_mesh_from_point_cloud_poisson.py +++ b/examples/python/geometry/triangle_mesh_from_point_cloud_poisson.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/triangle_mesh_normal_estimation.py b/examples/python/geometry/triangle_mesh_normal_estimation.py index 99a4c2dc9ce..5dbac60747d 100644 --- a/examples/python/geometry/triangle_mesh_normal_estimation.py +++ b/examples/python/geometry/triangle_mesh_normal_estimation.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/triangle_mesh_properties.py b/examples/python/geometry/triangle_mesh_properties.py index 372e79590e9..3acb0ee2b8e 100644 --- a/examples/python/geometry/triangle_mesh_properties.py +++ b/examples/python/geometry/triangle_mesh_properties.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/triangle_mesh_sampling.py b/examples/python/geometry/triangle_mesh_sampling.py index f75ae1ce7ec..388f9cd2e44 100644 --- a/examples/python/geometry/triangle_mesh_sampling.py +++ b/examples/python/geometry/triangle_mesh_sampling.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/triangle_mesh_simplification_decimation.py b/examples/python/geometry/triangle_mesh_simplification_decimation.py index cd286014ef9..5cb6d671d40 100644 --- a/examples/python/geometry/triangle_mesh_simplification_decimation.py +++ b/examples/python/geometry/triangle_mesh_simplification_decimation.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/triangle_mesh_simplification_vertex_clustering.py b/examples/python/geometry/triangle_mesh_simplification_vertex_clustering.py index 51e76f57617..ba742250907 100644 --- a/examples/python/geometry/triangle_mesh_simplification_vertex_clustering.py +++ b/examples/python/geometry/triangle_mesh_simplification_vertex_clustering.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/triangle_mesh_subdivision.py b/examples/python/geometry/triangle_mesh_subdivision.py index 88807e32a7c..266ea664f6a 100644 --- a/examples/python/geometry/triangle_mesh_subdivision.py +++ b/examples/python/geometry/triangle_mesh_subdivision.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/triangle_mesh_transformation.py b/examples/python/geometry/triangle_mesh_transformation.py index 65b3f7b36c0..76126453b5e 100644 --- a/examples/python/geometry/triangle_mesh_transformation.py +++ b/examples/python/geometry/triangle_mesh_transformation.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/triangle_mesh_with_numpy.py b/examples/python/geometry/triangle_mesh_with_numpy.py index 6b63b5dddb5..d63725bc6e7 100644 --- a/examples/python/geometry/triangle_mesh_with_numpy.py +++ b/examples/python/geometry/triangle_mesh_with_numpy.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/voxel_grid_carving.py b/examples/python/geometry/voxel_grid_carving.py index bd6d4f97df9..eccca9f9f1f 100644 --- a/examples/python/geometry/voxel_grid_carving.py +++ b/examples/python/geometry/voxel_grid_carving.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/voxel_grid_from_point_cloud.py b/examples/python/geometry/voxel_grid_from_point_cloud.py index 371b3d7f360..a8e2d4e92d1 100644 --- a/examples/python/geometry/voxel_grid_from_point_cloud.py +++ b/examples/python/geometry/voxel_grid_from_point_cloud.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/geometry/voxel_grid_from_triangle_mesh.py b/examples/python/geometry/voxel_grid_from_triangle_mesh.py index a99bf250556..0c1493884ff 100644 --- a/examples/python/geometry/voxel_grid_from_triangle_mesh.py +++ b/examples/python/geometry/voxel_grid_from_triangle_mesh.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/io/image_io.py b/examples/python/io/image_io.py index 0b34472f726..2bda0b78360 100644 --- a/examples/python/io/image_io.py +++ b/examples/python/io/image_io.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/io/point_cloud_io.py b/examples/python/io/point_cloud_io.py index 0d2a8086d7a..0d7f97a6838 100644 --- a/examples/python/io/point_cloud_io.py +++ b/examples/python/io/point_cloud_io.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/io/realsense_io.py b/examples/python/io/realsense_io.py index fa386554034..d3ba99c1c3d 100644 --- a/examples/python/io/realsense_io.py +++ b/examples/python/io/realsense_io.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """Demonstrate RealSense camera discovery and frame capture. An RS bag file is diff --git a/examples/python/io/triangle_mesh_io.py b/examples/python/io/triangle_mesh_io.py index 13adfa14e6f..b78ebb4bb98 100644 --- a/examples/python/io/triangle_mesh_io.py +++ b/examples/python/io/triangle_mesh_io.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/open3d_example.py b/examples/python/open3d_example.py index 486d5387898..f3f4b7e28b6 100644 --- a/examples/python/open3d_example.py +++ b/examples/python/open3d_example.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/pipelines/colored_icp_registration.py b/examples/python/pipelines/colored_icp_registration.py index 89a7eb04849..dbd1879cad4 100644 --- a/examples/python/pipelines/colored_icp_registration.py +++ b/examples/python/pipelines/colored_icp_registration.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """ICP variant that uses both geometry and color for registration""" diff --git a/examples/python/pipelines/doppler_icp_registration.py b/examples/python/pipelines/doppler_icp_registration.py index 5fface38e6e..e87d6eb361b 100644 --- a/examples/python/pipelines/doppler_icp_registration.py +++ b/examples/python/pipelines/doppler_icp_registration.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """Example script to run Doppler ICP point cloud registration. diff --git a/examples/python/pipelines/icp_registration.py b/examples/python/pipelines/icp_registration.py index 082794b7895..6badc4f5bd5 100644 --- a/examples/python/pipelines/icp_registration.py +++ b/examples/python/pipelines/icp_registration.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """ICP (Iterative Closest Point) registration algorithm""" diff --git a/examples/python/pipelines/multiway_registration.py b/examples/python/pipelines/multiway_registration.py index 3f2bc903ff2..7b634481ae6 100644 --- a/examples/python/pipelines/multiway_registration.py +++ b/examples/python/pipelines/multiway_registration.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """Align multiple pieces of geometry in a global space""" diff --git a/examples/python/pipelines/pose_graph_optimization.py b/examples/python/pipelines/pose_graph_optimization.py index b6061dc897c..a21d95677fe 100644 --- a/examples/python/pipelines/pose_graph_optimization.py +++ b/examples/python/pipelines/pose_graph_optimization.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/pipelines/registration_fgr.py b/examples/python/pipelines/registration_fgr.py index 06de478ac54..35285f5aaf4 100644 --- a/examples/python/pipelines/registration_fgr.py +++ b/examples/python/pipelines/registration_fgr.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/pipelines/registration_ransac.py b/examples/python/pipelines/registration_ransac.py index df7e73dfa51..eca030a03d8 100644 --- a/examples/python/pipelines/registration_ransac.py +++ b/examples/python/pipelines/registration_ransac.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/pipelines/rgbd_integration_uniform.py b/examples/python/pipelines/rgbd_integration_uniform.py index 2bbe318064e..a1659efd442 100644 --- a/examples/python/pipelines/rgbd_integration_uniform.py +++ b/examples/python/pipelines/rgbd_integration_uniform.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/pipelines/rgbd_odometry.py b/examples/python/pipelines/rgbd_odometry.py index 56912e04e1d..c735644c611 100644 --- a/examples/python/pipelines/rgbd_odometry.py +++ b/examples/python/pipelines/rgbd_odometry.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """Find camera movement between two consecutive RGBD image pairs""" diff --git a/examples/python/pipelines/robust_icp.py b/examples/python/pipelines/robust_icp.py index a0e75f2acf2..dcca2e8e120 100644 --- a/examples/python/pipelines/robust_icp.py +++ b/examples/python/pipelines/robust_icp.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """Outlier rejection using robust kernels for ICP""" diff --git a/examples/python/reconstruction_system/color_map_optimization_for_reconstruction_system.py b/examples/python/reconstruction_system/color_map_optimization_for_reconstruction_system.py index 088ec51818a..36c54f1fb91 100644 --- a/examples/python/reconstruction_system/color_map_optimization_for_reconstruction_system.py +++ b/examples/python/reconstruction_system/color_map_optimization_for_reconstruction_system.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/reconstruction_system/data_loader.py b/examples/python/reconstruction_system/data_loader.py index 99ba265265e..7ec6b108a12 100644 --- a/examples/python/reconstruction_system/data_loader.py +++ b/examples/python/reconstruction_system/data_loader.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/reconstruction_system/debug/pairwise_pc_alignment.py b/examples/python/reconstruction_system/debug/pairwise_pc_alignment.py index fdc899d744e..29052e855eb 100644 --- a/examples/python/reconstruction_system/debug/pairwise_pc_alignment.py +++ b/examples/python/reconstruction_system/debug/pairwise_pc_alignment.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/reconstruction_system/debug/pairwise_rgbd_alignment.py b/examples/python/reconstruction_system/debug/pairwise_rgbd_alignment.py index f9b87c2c1d3..915e079bb61 100644 --- a/examples/python/reconstruction_system/debug/pairwise_rgbd_alignment.py +++ b/examples/python/reconstruction_system/debug/pairwise_rgbd_alignment.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/reconstruction_system/debug/visualize_alignment.py b/examples/python/reconstruction_system/debug/visualize_alignment.py index 031b9cc4882..b6f51f0405e 100644 --- a/examples/python/reconstruction_system/debug/visualize_alignment.py +++ b/examples/python/reconstruction_system/debug/visualize_alignment.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/reconstruction_system/debug/visualize_fragments.py b/examples/python/reconstruction_system/debug/visualize_fragments.py index 2c05bd19142..f13b67cb0ee 100644 --- a/examples/python/reconstruction_system/debug/visualize_fragments.py +++ b/examples/python/reconstruction_system/debug/visualize_fragments.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/reconstruction_system/debug/visualize_pointcloud.py b/examples/python/reconstruction_system/debug/visualize_pointcloud.py index ee20d9aa792..65ee7e06766 100644 --- a/examples/python/reconstruction_system/debug/visualize_pointcloud.py +++ b/examples/python/reconstruction_system/debug/visualize_pointcloud.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/reconstruction_system/debug/visualize_scene.py b/examples/python/reconstruction_system/debug/visualize_scene.py index 353d4bac04a..fa1c526b5ba 100644 --- a/examples/python/reconstruction_system/debug/visualize_scene.py +++ b/examples/python/reconstruction_system/debug/visualize_scene.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/reconstruction_system/initialize_config.py b/examples/python/reconstruction_system/initialize_config.py index ee9c4c747c7..c1f8ac4d894 100644 --- a/examples/python/reconstruction_system/initialize_config.py +++ b/examples/python/reconstruction_system/initialize_config.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/reconstruction_system/integrate_scene.py b/examples/python/reconstruction_system/integrate_scene.py index f80e8d55f28..1fceb37a691 100644 --- a/examples/python/reconstruction_system/integrate_scene.py +++ b/examples/python/reconstruction_system/integrate_scene.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/reconstruction_system/make_fragments.py b/examples/python/reconstruction_system/make_fragments.py index 5af9d960f4b..64e3af37f7a 100644 --- a/examples/python/reconstruction_system/make_fragments.py +++ b/examples/python/reconstruction_system/make_fragments.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/reconstruction_system/opencv_pose_estimation.py b/examples/python/reconstruction_system/opencv_pose_estimation.py index 47714065858..7c9040086b6 100644 --- a/examples/python/reconstruction_system/opencv_pose_estimation.py +++ b/examples/python/reconstruction_system/opencv_pose_estimation.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/reconstruction_system/optimize_posegraph.py b/examples/python/reconstruction_system/optimize_posegraph.py index ddc57aa0518..3a73750a829 100644 --- a/examples/python/reconstruction_system/optimize_posegraph.py +++ b/examples/python/reconstruction_system/optimize_posegraph.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/reconstruction_system/refine_registration.py b/examples/python/reconstruction_system/refine_registration.py index bd555b150f9..7c056440edd 100644 --- a/examples/python/reconstruction_system/refine_registration.py +++ b/examples/python/reconstruction_system/refine_registration.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/reconstruction_system/register_fragments.py b/examples/python/reconstruction_system/register_fragments.py index f7d3c72e664..ac1c5e9795d 100644 --- a/examples/python/reconstruction_system/register_fragments.py +++ b/examples/python/reconstruction_system/register_fragments.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/reconstruction_system/run_system.py b/examples/python/reconstruction_system/run_system.py index dedfc5552d2..cb54ad792a5 100644 --- a/examples/python/reconstruction_system/run_system.py +++ b/examples/python/reconstruction_system/run_system.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/reconstruction_system/sensors/azure_kinect_mkv_reader.py b/examples/python/reconstruction_system/sensors/azure_kinect_mkv_reader.py index 2ebb025e04f..91f8f5841de 100644 --- a/examples/python/reconstruction_system/sensors/azure_kinect_mkv_reader.py +++ b/examples/python/reconstruction_system/sensors/azure_kinect_mkv_reader.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/reconstruction_system/sensors/azure_kinect_recorder.py b/examples/python/reconstruction_system/sensors/azure_kinect_recorder.py index 0302310b8ef..a743cf42000 100644 --- a/examples/python/reconstruction_system/sensors/azure_kinect_recorder.py +++ b/examples/python/reconstruction_system/sensors/azure_kinect_recorder.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/reconstruction_system/sensors/azure_kinect_viewer.py b/examples/python/reconstruction_system/sensors/azure_kinect_viewer.py index c0cacf4accb..6f4b74652ea 100644 --- a/examples/python/reconstruction_system/sensors/azure_kinect_viewer.py +++ b/examples/python/reconstruction_system/sensors/azure_kinect_viewer.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/reconstruction_system/sensors/realsense_helper.py b/examples/python/reconstruction_system/sensors/realsense_helper.py index 5e37b0c50bb..12c42bf9c53 100644 --- a/examples/python/reconstruction_system/sensors/realsense_helper.py +++ b/examples/python/reconstruction_system/sensors/realsense_helper.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/reconstruction_system/sensors/realsense_pcd_visualizer.py b/examples/python/reconstruction_system/sensors/realsense_pcd_visualizer.py index a0f5ecfdaa9..fa8636bd10a 100644 --- a/examples/python/reconstruction_system/sensors/realsense_pcd_visualizer.py +++ b/examples/python/reconstruction_system/sensors/realsense_pcd_visualizer.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/reconstruction_system/sensors/realsense_recorder.py b/examples/python/reconstruction_system/sensors/realsense_recorder.py index 034f5ffaf35..539b9d09a41 100644 --- a/examples/python/reconstruction_system/sensors/realsense_recorder.py +++ b/examples/python/reconstruction_system/sensors/realsense_recorder.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/reconstruction_system/slac.py b/examples/python/reconstruction_system/slac.py index 45d080214b8..03b8fec067a 100644 --- a/examples/python/reconstruction_system/slac.py +++ b/examples/python/reconstruction_system/slac.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/reconstruction_system/slac_integrate.py b/examples/python/reconstruction_system/slac_integrate.py index 5ba48801fd9..0638b30691d 100644 --- a/examples/python/reconstruction_system/slac_integrate.py +++ b/examples/python/reconstruction_system/slac_integrate.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/t_reconstruction_system/common.py b/examples/python/t_reconstruction_system/common.py index d6331920d87..18fdc757560 100644 --- a/examples/python/t_reconstruction_system/common.py +++ b/examples/python/t_reconstruction_system/common.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/t_reconstruction_system/config.py b/examples/python/t_reconstruction_system/config.py index 59b9ec40e2f..091cde49442 100644 --- a/examples/python/t_reconstruction_system/config.py +++ b/examples/python/t_reconstruction_system/config.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/t_reconstruction_system/dense_slam.py b/examples/python/t_reconstruction_system/dense_slam.py index 374b6dce91c..65ef9716ffb 100644 --- a/examples/python/t_reconstruction_system/dense_slam.py +++ b/examples/python/t_reconstruction_system/dense_slam.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/t_reconstruction_system/dense_slam_gui.py b/examples/python/t_reconstruction_system/dense_slam_gui.py index 24744b9e87d..1389aa77d0f 100644 --- a/examples/python/t_reconstruction_system/dense_slam_gui.py +++ b/examples/python/t_reconstruction_system/dense_slam_gui.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/t_reconstruction_system/integrate.py b/examples/python/t_reconstruction_system/integrate.py index 3d86ec02943..e99c6ac82cd 100644 --- a/examples/python/t_reconstruction_system/integrate.py +++ b/examples/python/t_reconstruction_system/integrate.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/t_reconstruction_system/integrate_custom.py b/examples/python/t_reconstruction_system/integrate_custom.py index 8b352780b04..d1dedb4b825 100644 --- a/examples/python/t_reconstruction_system/integrate_custom.py +++ b/examples/python/t_reconstruction_system/integrate_custom.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/t_reconstruction_system/pose_graph_optim.py b/examples/python/t_reconstruction_system/pose_graph_optim.py index 94abaf34711..51138171117 100644 --- a/examples/python/t_reconstruction_system/pose_graph_optim.py +++ b/examples/python/t_reconstruction_system/pose_graph_optim.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/t_reconstruction_system/ray_casting.py b/examples/python/t_reconstruction_system/ray_casting.py index 5bae7301a30..6142b3875fe 100644 --- a/examples/python/t_reconstruction_system/ray_casting.py +++ b/examples/python/t_reconstruction_system/ray_casting.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/t_reconstruction_system/rgbd_odometry.py b/examples/python/t_reconstruction_system/rgbd_odometry.py index 759501b1189..c803fd89f67 100644 --- a/examples/python/t_reconstruction_system/rgbd_odometry.py +++ b/examples/python/t_reconstruction_system/rgbd_odometry.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/t_reconstruction_system/run_system.py b/examples/python/t_reconstruction_system/run_system.py index 51e94257ace..6e1b63ed46c 100644 --- a/examples/python/t_reconstruction_system/run_system.py +++ b/examples/python/t_reconstruction_system/run_system.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/t_reconstruction_system/split_fragments.py b/examples/python/t_reconstruction_system/split_fragments.py index 96170685ad4..0759e870453 100644 --- a/examples/python/t_reconstruction_system/split_fragments.py +++ b/examples/python/t_reconstruction_system/split_fragments.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/utility/vector.py b/examples/python/utility/vector.py index 257cb54e672..512d814dc6e 100644 --- a/examples/python/utility/vector.py +++ b/examples/python/utility/vector.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/visualization/add_geometry.py b/examples/python/visualization/add_geometry.py index e58c456fc66..aa8c0fe43c4 100644 --- a/examples/python/visualization/add_geometry.py +++ b/examples/python/visualization/add_geometry.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/visualization/all_widgets.py b/examples/python/visualization/all_widgets.py index 45bd855eaca..1e8383c6e2e 100644 --- a/examples/python/visualization/all_widgets.py +++ b/examples/python/visualization/all_widgets.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/visualization/customized_visualization.py b/examples/python/visualization/customized_visualization.py index 1592278e044..80e006c749a 100644 --- a/examples/python/visualization/customized_visualization.py +++ b/examples/python/visualization/customized_visualization.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/visualization/customized_visualization_key_action.py b/examples/python/visualization/customized_visualization_key_action.py index c68e2f1110f..1f981b0a165 100644 --- a/examples/python/visualization/customized_visualization_key_action.py +++ b/examples/python/visualization/customized_visualization_key_action.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/visualization/demo_scene.py b/examples/python/visualization/demo_scene.py index b0662feadc7..f9d452c7dc7 100644 --- a/examples/python/visualization/demo_scene.py +++ b/examples/python/visualization/demo_scene.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """Demo scene demonstrating models, built-in shapes, and materials""" diff --git a/examples/python/visualization/draw.py b/examples/python/visualization/draw.py index f354f55783e..49dc1660ae4 100644 --- a/examples/python/visualization/draw.py +++ b/examples/python/visualization/draw.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- @@ -11,6 +11,7 @@ import open3d.visualization as vis import os import random +import warnings pyexample_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) test_data_path = os.path.join(os.path.dirname(pyexample_path), 'test_data') @@ -142,30 +143,46 @@ def selections(): source_name = "Source (yellow)" target_name = "Target (blue)" - def do_icp_one_set(o3dvis): + def _prep_correspondences(o3dvis, two_set=False): # sets: [name: [{ "index": int, "order": int, "point": (x, y, z)}, ...], # ...] sets = o3dvis.get_selection_sets() - source_picked = sorted(list(sets[0][source_name]), - key=lambda x: x.order) - target_picked = sorted(list(sets[0][target_name]), - key=lambda x: x.order) - source_indices = [idx.index for idx in source_picked] - target_indices = [idx.index for idx in target_picked] - - t = get_icp_transform(source, target, source_indices, target_indices) - source.transform(t) - - # Update the source geometry - o3dvis.remove_geometry(source_name) - o3dvis.add_geometry({"name": source_name, "geometry": source}) + if not sets: + warnings.warn( + "Empty selection sets. Select point correspondences for initial rough transform.", + RuntimeWarning) + return [], [] + if source_name not in sets[0]: + warnings.warn( + "First selection set should contain Source (yellow) points.", + RuntimeWarning) + return [], [] - def do_icp_two_sets(o3dvis): - sets = o3dvis.get_selection_sets() source_set = sets[0][source_name] - target_set = sets[1][target_name] + if two_set: + if not len(sets) == 2: + warnings.warn( + "Two set registration requires exactly two selection sets of corresponding points.", + RuntimeWarning) + return [], [] + target_set = sets[1][target_name] + else: + if target_name not in sets[0]: + warnings.warn( + "Selection set should contain Target (blue) points.", + RuntimeWarning) + return [], [] + target_set = sets[0][target_name] source_picked = sorted(list(source_set), key=lambda x: x.order) target_picked = sorted(list(target_set), key=lambda x: x.order) + if len(source_picked) != len(target_picked): + warnings.warn( + f"Registration requires equal number of corresponding points (current selection: {len(source_picked)} source, {len(target_picked)} target).", + RuntimeWarning) + return [], [] + return source_picked, target_picked + + def _do_icp(o3dvis, source_picked, target_picked): source_indices = [idx.index for idx in source_picked] target_indices = [idx.index for idx in target_picked] @@ -176,6 +193,12 @@ def do_icp_two_sets(o3dvis): o3dvis.remove_geometry(source_name) o3dvis.add_geometry({"name": source_name, "geometry": source}) + def do_icp_one_set(o3dvis): + _do_icp(o3dvis, *_prep_correspondences(o3dvis)) + + def do_icp_two_sets(o3dvis): + _do_icp(o3dvis, *_prep_correspondences(o3dvis, two_set=True)) + vis.draw([{ "name": source_name, "geometry": source diff --git a/examples/python/visualization/draw_webrtc.py b/examples/python/visualization/draw_webrtc.py index 9e92c9498c3..cfb1f93cb2a 100644 --- a/examples/python/visualization/draw_webrtc.py +++ b/examples/python/visualization/draw_webrtc.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/visualization/headless_rendering.py b/examples/python/visualization/headless_rendering.py index 6a9a51970e6..f0a4f1ae162 100644 --- a/examples/python/visualization/headless_rendering.py +++ b/examples/python/visualization/headless_rendering.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/visualization/interactive_visualization.py b/examples/python/visualization/interactive_visualization.py index 1b3ff5ed051..6769c0f5d8a 100644 --- a/examples/python/visualization/interactive_visualization.py +++ b/examples/python/visualization/interactive_visualization.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/visualization/line_width.py b/examples/python/visualization/line_width.py index 318f563c10f..194d75cfa79 100644 --- a/examples/python/visualization/line_width.py +++ b/examples/python/visualization/line_width.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/visualization/load_save_viewpoint.py b/examples/python/visualization/load_save_viewpoint.py index 65c20c8dff0..415b5165fad 100644 --- a/examples/python/visualization/load_save_viewpoint.py +++ b/examples/python/visualization/load_save_viewpoint.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/visualization/mitsuba_material_estimation.py b/examples/python/visualization/mitsuba_material_estimation.py index fc8d26c9ecf..448009a478f 100644 --- a/examples/python/visualization/mitsuba_material_estimation.py +++ b/examples/python/visualization/mitsuba_material_estimation.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/visualization/mouse_and_point_coord.py b/examples/python/visualization/mouse_and_point_coord.py index 5d3ad56f794..883582a2ba2 100644 --- a/examples/python/visualization/mouse_and_point_coord.py +++ b/examples/python/visualization/mouse_and_point_coord.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/visualization/multiple_windows.py b/examples/python/visualization/multiple_windows.py index 2cc367d0be7..e839901a894 100644 --- a/examples/python/visualization/multiple_windows.py +++ b/examples/python/visualization/multiple_windows.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/visualization/non_blocking_visualization.py b/examples/python/visualization/non_blocking_visualization.py index 04baaf85574..cc6f70f8e06 100644 --- a/examples/python/visualization/non_blocking_visualization.py +++ b/examples/python/visualization/non_blocking_visualization.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/visualization/non_english.py b/examples/python/visualization/non_english.py index 54c17d4df6a..8b0d007c84f 100644 --- a/examples/python/visualization/non_english.py +++ b/examples/python/visualization/non_english.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- @@ -39,7 +39,7 @@ hanzi = "c:/windows/fonts/msyh.ttc" # YaHei UI chess = "c:/windows/fonts/seguisym.ttf" # Segoe UI Symbol else: - # Assumes Ubuntu 18.04 + # Assumes Ubuntu 20.04 serif = "DejaVuSerif" hanzi = "NotoSansCJK" chess = "/usr/share/fonts/truetype/freefont/FreeSerif.ttf" diff --git a/examples/python/visualization/online_processing.py b/examples/python/visualization/online_processing.py index 4edd0e70762..79bf57c4ce6 100644 --- a/examples/python/visualization/online_processing.py +++ b/examples/python/visualization/online_processing.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """Online 3D depth video processing pipeline. diff --git a/examples/python/visualization/remote_visualizer.py b/examples/python/visualization/remote_visualizer.py new file mode 100644 index 00000000000..8ab64ffc978 --- /dev/null +++ b/examples/python/visualization/remote_visualizer.py @@ -0,0 +1,71 @@ +# ---------------------------------------------------------------------------- +# - Open3D: www.open3d.org - +# ---------------------------------------------------------------------------- +# Copyright (c) 2018-2024 www.open3d.org +# SPDX-License-Identifier: MIT +# ---------------------------------------------------------------------------- +"""This example shows Open3D's remote visualization feature using RPC +communication. To run this example, start the client first by running + +python remote_visualizer.py client + +and then run the server by running + +python remote_visualizer.py server + +Port 51454 is used by default for communication. For remote visualization (client +and server running on different machines), use ssh to forward the remote server +port to your local computer: + + ssh -N -R 51454:localhost:51454 user@remote_host + +See documentation for more details (e.g. to use a different port). +""" +import sys +import numpy as np +import open3d as o3d +import open3d.visualization as vis + + +def make_point_cloud(npts, center, radius, colorize): + pts = np.random.uniform(-radius, radius, size=[npts, 3]) + center + cloud = o3d.geometry.PointCloud() + cloud.points = o3d.utility.Vector3dVector(pts) + if colorize: + colors = np.random.uniform(0.0, 1.0, size=[npts, 3]) + cloud.colors = o3d.utility.Vector3dVector(colors) + return cloud + + +def server_time_animation(): + orig = make_point_cloud(200, (0, 0, 0), 1.0, True) + clouds = [{"name": "t=0", "geometry": orig, "time": 0}] + drift_dir = (1.0, 0.0, 0.0) + expand = 1.0 + n = 20 + ev = o3d.visualization.ExternalVisualizer() + for i in range(1, n): + amount = float(i) / float(n - 1) + cloud = o3d.geometry.PointCloud() + pts = np.asarray(orig.points) + pts = pts * (1.0 + amount * expand) + [amount * v for v in drift_dir] + cloud.points = o3d.utility.Vector3dVector(pts) + cloud.colors = orig.colors + ev.set(obj=cloud, time=i, path=f"points at t={i}") + print('.', end='', flush=True) + print() + + +def client_time_animation(): + o3d.visualization.draw(title="Open3D - Remote Visualizer Client", + show_ui=True, + rpc_interface=True) + + +if __name__ == "__main__": + assert len(sys.argv) == 2 and sys.argv[1] in ('client', 'server'), ( + "Usage: python remote_visualizer.py [client|server]") + if sys.argv[1] == "client": + client_time_animation() + elif sys.argv[1] == "server": + server_time_animation() diff --git a/examples/python/visualization/remove_geometry.py b/examples/python/visualization/remove_geometry.py index 2353462174f..42b7af1fbe8 100644 --- a/examples/python/visualization/remove_geometry.py +++ b/examples/python/visualization/remove_geometry.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/visualization/render_to_image.py b/examples/python/visualization/render_to_image.py index 3e6d05b78d4..d07b97024bd 100644 --- a/examples/python/visualization/render_to_image.py +++ b/examples/python/visualization/render_to_image.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/visualization/tensorboard_pytorch.py b/examples/python/visualization/tensorboard_pytorch.py index 89a9fb7c17c..c16f645f3ea 100644 --- a/examples/python/visualization/tensorboard_pytorch.py +++ b/examples/python/visualization/tensorboard_pytorch.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- import copy diff --git a/examples/python/visualization/tensorboard_tensorflow.py b/examples/python/visualization/tensorboard_tensorflow.py index 4b90c8498c6..d7320b053e4 100644 --- a/examples/python/visualization/tensorboard_tensorflow.py +++ b/examples/python/visualization/tensorboard_tensorflow.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- import copy diff --git a/examples/python/visualization/text3d.py b/examples/python/visualization/text3d.py index e1d302b17e3..276a5da5cdc 100644 --- a/examples/python/visualization/text3d.py +++ b/examples/python/visualization/text3d.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/visualization/textured_mesh.py b/examples/python/visualization/textured_mesh.py index 2aa635ee83d..999816dd873 100644 --- a/examples/python/visualization/textured_mesh.py +++ b/examples/python/visualization/textured_mesh.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/visualization/textured_model.py b/examples/python/visualization/textured_model.py index fbd28784e2d..5872bafe983 100644 --- a/examples/python/visualization/textured_model.py +++ b/examples/python/visualization/textured_model.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/visualization/to_mitsuba.py b/examples/python/visualization/to_mitsuba.py index 1adf5e96851..c0f99034043 100644 --- a/examples/python/visualization/to_mitsuba.py +++ b/examples/python/visualization/to_mitsuba.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/visualization/video.py b/examples/python/visualization/video.py index c661152956a..ca422082c09 100644 --- a/examples/python/visualization/video.py +++ b/examples/python/visualization/video.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/examples/python/visualization/vis_gui.py b/examples/python/visualization/vis_gui.py index 3cf28e29684..915cd1d39e1 100644 --- a/examples/python/visualization/vis_gui.py +++ b/examples/python/visualization/vis_gui.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/MANIFEST.in b/python/MANIFEST.in index cfedbe226f8..779c3777edd 100644 --- a/python/MANIFEST.in +++ b/python/MANIFEST.in @@ -1,27 +1,8 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# The MIT License (MIT) -# -# Copyright (c) 2018-2023 www.open3d.org -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. +# Copyright (c) 2018-2024 www.open3d.org +# SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- # Main library, including compiled binaries diff --git a/python/README.rst b/python/README.rst index 232c3b0ca24..e266c2904ab 100644 --- a/python/README.rst +++ b/python/README.rst @@ -38,7 +38,7 @@ Supported platforms The package has been tested on: -* Ubuntu 18.04 and 20.04 +* Ubuntu 20.04 and 22.04 * Windows 10 64-bit * macOS High Sierra and above @@ -48,6 +48,7 @@ With Python versions: * 3.9 * 3.10 * 3.11 +* 3.12 Resources ====================== diff --git a/python/benchmarks/core/test_binary_ew.py b/python/benchmarks/core/test_binary_ew.py index 20054209cf5..479bb6ff905 100644 --- a/python/benchmarks/core/test_binary_ew.py +++ b/python/benchmarks/core/test_binary_ew.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/benchmarks/core/test_nns.py b/python/benchmarks/core/test_nns.py index 20f8ce8a5f5..1981793a5e7 100644 --- a/python/benchmarks/core/test_nns.py +++ b/python/benchmarks/core/test_nns.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/benchmarks/core/test_unary_ew.py b/python/benchmarks/core/test_unary_ew.py index 857bfa503ae..67f69cce67c 100644 --- a/python/benchmarks/core/test_unary_ew.py +++ b/python/benchmarks/core/test_unary_ew.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/benchmarks/open3d_benchmark.py b/python/benchmarks/open3d_benchmark.py index a8dedfe932d..8de28303208 100644 --- a/python/benchmarks/open3d_benchmark.py +++ b/python/benchmarks/open3d_benchmark.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/open3d/__init__.py b/python/open3d/__init__.py index ef0adba1bd5..d4d5c613b0e 100644 --- a/python/open3d/__init__.py +++ b/python/open3d/__init__.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- @@ -15,7 +15,11 @@ # https://github.com/dmlc/xgboost/issues/1715 import os import sys + os.environ["KMP_DUPLICATE_LIB_OK"] = "True" +# Enable thread composability manager to coordinate Intel OpenMP and TBB threads. Only works with Intel OpenMP. +# TBB must not be already loaded. +os.environ["TCM_ENABLE"] = "1" from ctypes import CDLL from ctypes.util import find_library from pathlib import Path @@ -31,27 +35,15 @@ def load_cdll(path): if not path.is_file(): raise FileNotFoundError(f"Shared library file not found: {path}.") - if sys.platform == 'win32' and sys.version_info >= (3, 8): + if sys.platform == "win32" and sys.version_info >= (3, 8): # https://stackoverflow.com/a/64472088/1255535 return CDLL(str(path), winmode=0) else: return CDLL(str(path)) -if _build_config["BUILD_GUI"] and not (find_library("c++abi") or - find_library("c++")): - try: # Preload libc++.so and libc++abi.so (required by filament) - load_cdll(str(next((Path(__file__).parent).glob("*c++abi.*")))) - load_cdll(str(next((Path(__file__).parent).glob("*c++.*")))) - except StopIteration: # Not found: check system paths while loading - pass - -# Enable CPU rendering based on env vars -if _build_config["BUILD_GUI"] and sys.platform.startswith("linux") and ( - os.getenv("OPEN3D_CPU_RENDERING", default="") == "true"): - os.environ["LIBGL_DRIVERS_PATH"] = str(Path(__file__).parent) - load_cdll(Path(__file__).parent / "libEGL.so.1") - load_cdll(Path(__file__).parent / "libGL.so.1") +if sys.platform == "win32": # Unix: Use rpath to find libraries + _win32_dll_dir = os.add_dll_directory(str(Path(__file__).parent)) __DEVICE_API__ = "cpu" if _build_config["BUILD_CUDA_MODULE"]: @@ -63,35 +55,59 @@ def load_cdll(path): warnings.warn( "Open3D was built with CUDA support, but Open3D CPU Python " "bindings were not found. Open3D will not work on systems without" - " CUDA devices.", ImportWarning) + " CUDA devices.", + ImportWarning, + ) try: # Check CUDA availability without importing CUDA pybind symbols to # prevent "symbol already registered" errors if first import fails. _pybind_cuda = load_cdll( str(next((Path(__file__).parent / "cuda").glob("pybind*")))) if _pybind_cuda.open3d_core_cuda_device_count() > 0: - from open3d.cuda.pybind import (core, camera, data, geometry, io, - pipelines, utility, t) + from open3d.cuda.pybind import ( + core, + camera, + data, + geometry, + io, + pipelines, + utility, + t, + ) from open3d.cuda import pybind + __DEVICE_API__ = "cuda" else: warnings.warn( "Open3D was built with CUDA support, but no suitable CUDA " "devices found. If your system has CUDA devices, check your " - "CUDA drivers and runtime.", ImportWarning) + "CUDA drivers and runtime.", + ImportWarning, + ) except OSError as os_error: warnings.warn( - f'Open3D was built with CUDA support, but an error ocurred while loading the Open3D CUDA Python bindings. This is usually because the CUDA libraries could not be found. Check your CUDA installation. Falling back to the CPU pybind library. Reported error: {os_error}.', - ImportWarning) + f"Open3D was built with CUDA support, but an error ocurred while loading the Open3D CUDA Python bindings. This is usually because the CUDA libraries could not be found. Check your CUDA installation. Falling back to the CPU pybind library. Reported error: {os_error}.", + ImportWarning, + ) except StopIteration: warnings.warn( "Open3D was built with CUDA support, but Open3D CUDA Python " "binding library not found! Falling back to the CPU Python " - "binding library.", ImportWarning) + "binding library.", + ImportWarning, + ) if __DEVICE_API__ == "cpu": - from open3d.cpu.pybind import (core, camera, data, geometry, io, pipelines, - utility, t) + from open3d.cpu.pybind import ( + core, + camera, + data, + geometry, + io, + pipelines, + utility, + t, + ) from open3d.cpu import pybind @@ -110,6 +126,7 @@ def _insert_pybind_names(skip_names=()): import open3d.visualization + _insert_pybind_names(skip_names=("ml",)) __version__ = "@PROJECT_VERSION@" @@ -117,9 +134,10 @@ def _insert_pybind_names(skip_names=()): if int(sys.version_info[0]) < 3: raise Exception("Open3D only supports Python 3.") -if _build_config["BUILD_JUPYTER_EXTENSION"] and os.environ.get( - "OPEN3D_DISABLE_WEB_VISUALIZER", "False").lower() != "true": +if (_build_config["BUILD_JUPYTER_EXTENSION"] and os.environ.get( + "OPEN3D_DISABLE_WEB_VISUALIZER", "False").lower() != "true"): import platform + if not (platform.machine().startswith("arm") or platform.machine().startswith("aarch")): try: @@ -188,8 +206,10 @@ def _jupyter_nbextension_paths(): "section": "notebook", "src": "nbextension", "dest": "open3d", - "require": "open3d/extension" + "require": "open3d/extension", }] +if sys.platform == "win32": + _win32_dll_dir.close() del os, sys, CDLL, load_cdll, find_library, Path, warnings, _insert_pybind_names diff --git a/python/open3d/ml/__init__.py b/python/open3d/ml/__init__.py index 0f28a3e9512..cf7342e0a27 100644 --- a/python/open3d/ml/__init__.py +++ b/python/open3d/ml/__init__.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/open3d/ml/configs.py b/python/open3d/ml/configs.py index c178bf52a2b..1149be8a9c3 100644 --- a/python/open3d/ml/configs.py +++ b/python/open3d/ml/configs.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/open3d/ml/contrib/__init__.py b/python/open3d/ml/contrib/__init__.py index 1d870d5e72c..b883e8024fd 100644 --- a/python/open3d/ml/contrib/__init__.py +++ b/python/open3d/ml/contrib/__init__.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/open3d/ml/datasets.py b/python/open3d/ml/datasets.py index 3234aee7d3c..4c7397d6ddf 100644 --- a/python/open3d/ml/datasets.py +++ b/python/open3d/ml/datasets.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/open3d/ml/tf/__init__.py b/python/open3d/ml/tf/__init__.py index b3178944067..86ce9dd38fa 100644 --- a/python/open3d/ml/tf/__init__.py +++ b/python/open3d/ml/tf/__init__.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """TensorFlow specific machine learning functions.""" diff --git a/python/open3d/ml/tf/configs.py b/python/open3d/ml/tf/configs.py index f87c9dcb6d4..6926bc45942 100644 --- a/python/open3d/ml/tf/configs.py +++ b/python/open3d/ml/tf/configs.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """Config files for ml3d.""" diff --git a/python/open3d/ml/tf/dataloaders.py b/python/open3d/ml/tf/dataloaders.py index f1d6ff02e91..42e9c2585ad 100644 --- a/python/open3d/ml/tf/dataloaders.py +++ b/python/open3d/ml/tf/dataloaders.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """Dataloader for TensorFlow.""" diff --git a/python/open3d/ml/tf/datasets.py b/python/open3d/ml/tf/datasets.py index bdcc65a16fb..023f8d0dd93 100644 --- a/python/open3d/ml/tf/datasets.py +++ b/python/open3d/ml/tf/datasets.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """I/O, attributes, and processing for different datasets.""" diff --git a/python/open3d/ml/tf/layers/__init__.py b/python/open3d/ml/tf/layers/__init__.py index 33d1089474f..599726b5c09 100644 --- a/python/open3d/ml/tf/layers/__init__.py +++ b/python/open3d/ml/tf/layers/__init__.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """High level layer API for building networks. diff --git a/python/open3d/ml/tf/models.py b/python/open3d/ml/tf/models.py index 4a358e8c513..e04d251e9c3 100644 --- a/python/open3d/ml/tf/models.py +++ b/python/open3d/ml/tf/models.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """TensorFlow network models.""" diff --git a/python/open3d/ml/tf/modules.py b/python/open3d/ml/tf/modules.py index 40da95cb41a..bc8e70f5e22 100644 --- a/python/open3d/ml/tf/modules.py +++ b/python/open3d/ml/tf/modules.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """Loss and Metric modules for TensorFlow.""" diff --git a/python/open3d/ml/tf/ops/__init__.py b/python/open3d/ml/tf/ops/__init__.py index e771da8a3ff..fdb8c107f41 100644 --- a/python/open3d/ml/tf/ops/__init__.py +++ b/python/open3d/ml/tf/ops/__init__.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """Functional API with operators. diff --git a/python/open3d/ml/tf/pipelines.py b/python/open3d/ml/tf/pipelines.py index d0fa0467bbc..d168634445f 100644 --- a/python/open3d/ml/tf/pipelines.py +++ b/python/open3d/ml/tf/pipelines.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """3D ML pipelines for TensorFlow.""" diff --git a/python/open3d/ml/tf/python/layers/convolutions.py b/python/open3d/ml/tf/python/layers/convolutions.py index fc0eba6d61d..fc1c3a111e2 100644 --- a/python/open3d/ml/tf/python/layers/convolutions.py +++ b/python/open3d/ml/tf/python/layers/convolutions.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/open3d/ml/tf/python/layers/neighbor_search.py b/python/open3d/ml/tf/python/layers/neighbor_search.py index 8a9059ef485..212dc3b9005 100644 --- a/python/open3d/ml/tf/python/layers/neighbor_search.py +++ b/python/open3d/ml/tf/python/layers/neighbor_search.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- @@ -121,6 +121,11 @@ def call(self, queries_row_splits = queries.row_splits queries = queries.values + if isinstance(radius, tf.Tensor): + radius_ = tf.cast(radius, points.dtype) + else: + radius_ = radius + if points_row_splits is None: points_row_splits = tf.cast(tf.stack([0, tf.shape(points)[0]]), dtype=tf.int64) @@ -131,7 +136,7 @@ def call(self, table = ops.build_spatial_hash_table( max_hash_table_size=self.max_hash_table_size, points=points, - radius=radius, + radius=radius_, points_row_splits=points_row_splits, hash_table_size_factor=hash_table_size_factor) else: @@ -142,7 +147,7 @@ def call(self, metric=self.metric, points=points, queries=queries, - radius=radius, + radius=radius_, points_row_splits=points_row_splits, queries_row_splits=queries_row_splits, hash_table_splits=table.hash_table_splits, diff --git a/python/open3d/ml/tf/python/layers/voxel_pooling.py b/python/open3d/ml/tf/python/layers/voxel_pooling.py index 4217e63195c..1b5e1370d24 100644 --- a/python/open3d/ml/tf/python/layers/voxel_pooling.py +++ b/python/open3d/ml/tf/python/layers/voxel_pooling.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/open3d/ml/tf/python/ops/gradients.py b/python/open3d/ml/tf/python/ops/gradients.py index 7ccb3b1108d..1cd75291fad 100644 --- a/python/open3d/ml/tf/python/ops/gradients.py +++ b/python/open3d/ml/tf/python/ops/gradients.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/open3d/ml/tf/python/ops/lib.py b/python/open3d/ml/tf/python/ops/lib.py index 271d3aade16..4e55e26382d 100644 --- a/python/open3d/ml/tf/python/ops/lib.py +++ b/python/open3d/ml/tf/python/ops/lib.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """This module loads the op library.""" diff --git a/python/open3d/ml/tf/python/ops/ops.py.in b/python/open3d/ml/tf/python/ops/ops.py.in index 228fc8cb894..b44713940c3 100644 --- a/python/open3d/ml/tf/python/ops/ops.py.in +++ b/python/open3d/ml/tf/python/ops/ops.py.in @@ -3,7 +3,7 @@ # ---------------------------------------------------------------------------- # The MIT License (MIT) # -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/python/open3d/ml/tf/vis.py b/python/open3d/ml/tf/vis.py index a2173cc3dd2..1d4d44f1a27 100644 --- a/python/open3d/ml/tf/vis.py +++ b/python/open3d/ml/tf/vis.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """Visualizer for 3D ML.""" diff --git a/python/open3d/ml/torch/__init__.py b/python/open3d/ml/torch/__init__.py index 5867abfdfb3..09a48b131aa 100644 --- a/python/open3d/ml/torch/__init__.py +++ b/python/open3d/ml/torch/__init__.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """Torch specific machine learning functions.""" diff --git a/python/open3d/ml/torch/classes/__init__.py b/python/open3d/ml/torch/classes/__init__.py index 0188ba1bc49..d162913dd15 100644 --- a/python/open3d/ml/torch/classes/__init__.py +++ b/python/open3d/ml/torch/classes/__init__.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """Torch specific machine learning classes.""" diff --git a/python/open3d/ml/torch/classes/ragged_tensor.py b/python/open3d/ml/torch/classes/ragged_tensor.py index 02a11568a8d..e3cc3fd6916 100644 --- a/python/open3d/ml/torch/classes/ragged_tensor.py +++ b/python/open3d/ml/torch/classes/ragged_tensor.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/open3d/ml/torch/configs.py b/python/open3d/ml/torch/configs.py index f87c9dcb6d4..6926bc45942 100644 --- a/python/open3d/ml/torch/configs.py +++ b/python/open3d/ml/torch/configs.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """Config files for ml3d.""" diff --git a/python/open3d/ml/torch/dataloaders.py b/python/open3d/ml/torch/dataloaders.py index fb5370cac59..70464b2ebb8 100644 --- a/python/open3d/ml/torch/dataloaders.py +++ b/python/open3d/ml/torch/dataloaders.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """Dataloader for PyTorch.""" diff --git a/python/open3d/ml/torch/datasets.py b/python/open3d/ml/torch/datasets.py index bdcc65a16fb..023f8d0dd93 100644 --- a/python/open3d/ml/torch/datasets.py +++ b/python/open3d/ml/torch/datasets.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """I/O, attributes, and processing for different datasets.""" diff --git a/python/open3d/ml/torch/layers/__init__.py b/python/open3d/ml/torch/layers/__init__.py index a0ba32db9c4..ae8c471b178 100644 --- a/python/open3d/ml/torch/layers/__init__.py +++ b/python/open3d/ml/torch/layers/__init__.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """High level layer API for building networks. diff --git a/python/open3d/ml/torch/models.py b/python/open3d/ml/torch/models.py index 328050bbbe1..8e99aba0f5b 100644 --- a/python/open3d/ml/torch/models.py +++ b/python/open3d/ml/torch/models.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """PyTorch network models.""" diff --git a/python/open3d/ml/torch/modules.py b/python/open3d/ml/torch/modules.py index 816a1df3537..a5b3994a6c1 100644 --- a/python/open3d/ml/torch/modules.py +++ b/python/open3d/ml/torch/modules.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """Loss and Metric modules for PyTorch.""" diff --git a/python/open3d/ml/torch/ops/__init__.py b/python/open3d/ml/torch/ops/__init__.py index c89f2bd54d5..bf547ce815e 100644 --- a/python/open3d/ml/torch/ops/__init__.py +++ b/python/open3d/ml/torch/ops/__init__.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """Functional API with operators. diff --git a/python/open3d/ml/torch/pipelines.py b/python/open3d/ml/torch/pipelines.py index cf418488825..9f2dac3a0c4 100644 --- a/python/open3d/ml/torch/pipelines.py +++ b/python/open3d/ml/torch/pipelines.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """3D ML pipelines for PyTorch.""" diff --git a/python/open3d/ml/torch/python/layers/convolutions.py b/python/open3d/ml/torch/python/layers/convolutions.py index ec22d845f4f..5e9fe3b1c7f 100644 --- a/python/open3d/ml/torch/python/layers/convolutions.py +++ b/python/open3d/ml/torch/python/layers/convolutions.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/open3d/ml/torch/python/layers/neighbor_search.py b/python/open3d/ml/torch/python/layers/neighbor_search.py index 3d25b426991..bb1eac55165 100644 --- a/python/open3d/ml/torch/python/layers/neighbor_search.py +++ b/python/open3d/ml/torch/python/layers/neighbor_search.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/open3d/ml/torch/python/layers/voxel_pooling.py b/python/open3d/ml/torch/python/layers/voxel_pooling.py index cc0cfc7377b..d95112f433f 100644 --- a/python/open3d/ml/torch/python/layers/voxel_pooling.py +++ b/python/open3d/ml/torch/python/layers/voxel_pooling.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/open3d/ml/torch/python/ops.py.in b/python/open3d/ml/torch/python/ops.py.in index 4ecd5b59105..14fa5fea1a6 100644 --- a/python/open3d/ml/torch/python/ops.py.in +++ b/python/open3d/ml/torch/python/ops.py.in @@ -3,7 +3,7 @@ # ---------------------------------------------------------------------------- # The MIT License (MIT) # -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/python/open3d/ml/torch/python/return_types.py.in b/python/open3d/ml/torch/python/return_types.py.in index 9af42040ab2..a73a0765ed9 100644 --- a/python/open3d/ml/torch/python/return_types.py.in +++ b/python/open3d/ml/torch/python/return_types.py.in @@ -3,7 +3,7 @@ # ---------------------------------------------------------------------------- # The MIT License (MIT) # -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/python/open3d/ml/torch/vis.py b/python/open3d/ml/torch/vis.py index a2173cc3dd2..1d4d44f1a27 100644 --- a/python/open3d/ml/torch/vis.py +++ b/python/open3d/ml/torch/vis.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """Visualizer for 3D ML.""" diff --git a/python/open3d/ml/utils.py b/python/open3d/ml/utils.py index 8d3ceeb99d1..5dfd3dc70d1 100644 --- a/python/open3d/ml/utils.py +++ b/python/open3d/ml/utils.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/open3d/ml/vis.py b/python/open3d/ml/vis.py index afc08de5dab..c6b2f3bf5d5 100644 --- a/python/open3d/ml/vis.py +++ b/python/open3d/ml/vis.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/open3d/visualization/__init__.py b/python/open3d/visualization/__init__.py index 5360a69b270..ba464d7d54a 100644 --- a/python/open3d/visualization/__init__.py +++ b/python/open3d/visualization/__init__.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/open3d/visualization/__main__.py b/python/open3d/visualization/__main__.py index 2416fa4dbd3..31cdc7d082e 100644 --- a/python/open3d/visualization/__main__.py +++ b/python/open3d/visualization/__main__.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/open3d/visualization/_external_visualizer.py b/python/open3d/visualization/_external_visualizer.py index ac7209127f0..b3de5b812d1 100644 --- a/python/open3d/visualization/_external_visualizer.py +++ b/python/open3d/visualization/_external_visualizer.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- @@ -37,17 +37,23 @@ def set(self, obj=None, path='', time=0, layer='', connection=None): Example: To quickly send a single object just write:: + ev.set(point_cloud) To place the object at a specific location in the scene tree do:: + ev.set(point_cloud, path='group/mypoints', time=42, layer='') + Note that depending on the visualizer some arguments like time or layer may not be supported and will be ignored. To set multiple objects use a list to pass multiple objects:: + ev.set([point_cloud, mesh, camera]) + Each entry in the list can be a tuple specifying all or some of the location parameters:: + ev.set(objs=[(point_cloud,'group/mypoints', 1, 'layer1'), (mesh, 'group/mymesh'), camera @@ -147,6 +153,7 @@ def draw(self, geometry=None, *args, **kwargs): Example: Here we use draw with the default external visualizer:: + import open3d as o3d torus = o3d.geometry.TriangleMesh.create_torus() diff --git a/python/open3d/visualization/async_event_loop.py b/python/open3d/visualization/async_event_loop.py index 1126638b152..3b89da8a02d 100644 --- a/python/open3d/visualization/async_event_loop.py +++ b/python/open3d/visualization/async_event_loop.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """Run the GUI event loop in a non-main thread. This allows using the diff --git a/python/open3d/visualization/draw.py b/python/open3d/visualization/draw.py index f7764b41400..57b1a7cbdb2 100644 --- a/python/open3d/visualization/draw.py +++ b/python/open3d/visualization/draw.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- @@ -83,9 +83,10 @@ def draw(geometry=None, animation_time_step (float): Duration in seconds for each animation frame. animation_duration (float): Total animation duration in seconds. - rpc_interface (bool): Start an RPC interface at http://localhost:51454 and - listen for drawing requests. The requests can be made with - :class:`open3d.visualization.ExternalVisualizer`. + rpc_interface (bool or str): Start an RPC interface at this local + address and listen for drawing requests. If rpc_interface is True, the + default address "tcp://localhost:51454" is used. The requests can be + made with :class:`open3d.visualization.ExternalVisualizer`. on_init (Callable): Extra initialization procedure for the underlying GUI window. The procedure receives a single argument of type :class:`open3d.visualization.O3DVisualizer`. @@ -202,7 +203,9 @@ def add(g, n): w.show_skybox(show_skybox) if rpc_interface: - w.start_rpc_interface(address="tcp://127.0.0.1:51454", timeout=10000) + if not isinstance(rpc_interface, str): + rpc_interface = "tcp://127.0.0.1:51454" + w.start_rpc_interface(address=rpc_interface, timeout=10000) def stop_rpc(): w.stop_rpc_interface() diff --git a/python/open3d/visualization/draw_plotly.py b/python/open3d/visualization/draw_plotly.py index 366299a130b..6b04df3b2a5 100644 --- a/python/open3d/visualization/draw_plotly.py +++ b/python/open3d/visualization/draw_plotly.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/open3d/visualization/tensorboard_plugin/colormap.py b/python/open3d/visualization/tensorboard_plugin/colormap.py index 15c04c60d2a..a5dbfdbbcf4 100644 --- a/python/open3d/visualization/tensorboard_plugin/colormap.py +++ b/python/open3d/visualization/tensorboard_plugin/colormap.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- class Colormap: diff --git a/python/open3d/visualization/tensorboard_plugin/frontend/index.js b/python/open3d/visualization/tensorboard_plugin/frontend/index.js index adc1fd0f92d..74dfc069fc9 100644 --- a/python/open3d/visualization/tensorboard_plugin/frontend/index.js +++ b/python/open3d/visualization/tensorboard_plugin/frontend/index.js @@ -1,27 +1,8 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// The MIT License (MIT) -// -// Copyright (c) 2018-2023 www.open3d.org -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. +// Copyright (c) 2018-2024 www.open3d.org +// SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- import './adapter.min.js'; diff --git a/python/open3d/visualization/tensorboard_plugin/frontend/style.css b/python/open3d/visualization/tensorboard_plugin/frontend/style.css index 244a5e47d4b..40fc00601b4 100644 --- a/python/open3d/visualization/tensorboard_plugin/frontend/style.css +++ b/python/open3d/visualization/tensorboard_plugin/frontend/style.css @@ -1,27 +1,8 @@ /* ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// The MIT License (MIT) -// -// Copyright (c) 2018-2023 www.open3d.org -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. +// Copyright (c) 2018-2024 www.open3d.org +// SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- */ diff --git a/python/open3d/visualization/tensorboard_plugin/labellut.py b/python/open3d/visualization/tensorboard_plugin/labellut.py index ef209588f82..a73e3831712 100644 --- a/python/open3d/visualization/tensorboard_plugin/labellut.py +++ b/python/open3d/visualization/tensorboard_plugin/labellut.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- from colorsys import rgb_to_yiq diff --git a/python/open3d/visualization/tensorboard_plugin/metadata.py b/python/open3d/visualization/tensorboard_plugin/metadata.py index e19e71b362c..9e247677177 100644 --- a/python/open3d/visualization/tensorboard_plugin/metadata.py +++ b/python/open3d/visualization/tensorboard_plugin/metadata.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """Internal information about the Open3D plugin.""" diff --git a/python/open3d/visualization/tensorboard_plugin/plugin.py b/python/open3d/visualization/tensorboard_plugin/plugin.py index 69da28c35eb..d6da0aba8af 100644 --- a/python/open3d/visualization/tensorboard_plugin/plugin.py +++ b/python/open3d/visualization/tensorboard_plugin/plugin.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """Open3D visualization plugin for TensorBoard.""" diff --git a/python/open3d/visualization/tensorboard_plugin/plugin_data.proto b/python/open3d/visualization/tensorboard_plugin/plugin_data.proto index 466ca8cdbf1..e40ed41a7a2 100644 --- a/python/open3d/visualization/tensorboard_plugin/plugin_data.proto +++ b/python/open3d/visualization/tensorboard_plugin/plugin_data.proto @@ -1,27 +1,8 @@ // ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// The MIT License (MIT) -// -// Copyright (c) 2018-2023 www.open3d.org -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. +// Copyright (c) 2018-2024 www.open3d.org +// SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- // To generate plugin_data_pb2.py, use this command: diff --git a/python/open3d/visualization/tensorboard_plugin/plugin_data_pb2.py b/python/open3d/visualization/tensorboard_plugin/plugin_data_pb2.py index 33d3b9c9641..30bd56e72cf 100644 --- a/python/open3d/visualization/tensorboard_plugin/plugin_data_pb2.py +++ b/python/open3d/visualization/tensorboard_plugin/plugin_data_pb2.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- # -*- coding: utf-8 -*- diff --git a/python/open3d/visualization/tensorboard_plugin/summary.py b/python/open3d/visualization/tensorboard_plugin/summary.py index 0b6e254b754..8e35948b5be 100644 --- a/python/open3d/visualization/tensorboard_plugin/summary.py +++ b/python/open3d/visualization/tensorboard_plugin/summary.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """Summary writer for the TensorBoard Open3D plugin""" @@ -424,7 +424,7 @@ def get_or_check_shape(prop, tensor_tuple, exp_shape): raise ValueError( f"Property {prop} tensor should have shape[{k}]" f"={s} for all elements but is " - f"{tensor.shape[k-1] for tensor in tensor_tuple}.") + f"{[tensor.shape[k-1] for tensor in tensor_tuple]}.") return shape[:2] @@ -575,6 +575,7 @@ def add_3d(name, data (dict): A dictionary of tensors representing 3D data. Tensorflow, PyTorch, Numpy and Open3D tensors are supported. The following keys are supported: + - ``vertex_positions``: shape `(B, N, 3)` where B is the number of point clouds and must be same for each key. N is the number of 3D points. Will be cast to ``float32``. diff --git a/python/open3d/visualization/tensorboard_plugin/util.py b/python/open3d/visualization/tensorboard_plugin/util.py index 8c8a5beda34..6980c6f0c76 100644 --- a/python/open3d/visualization/tensorboard_plugin/util.py +++ b/python/open3d/visualization/tensorboard_plugin/util.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """Utility functions for the Open3D TensorBoard plugin.""" diff --git a/python/open3d/visualization/to_mitsuba.py b/python/open3d/visualization/to_mitsuba.py index 2af657757ec..4b4ce4e3a42 100644 --- a/python/open3d/visualization/to_mitsuba.py +++ b/python/open3d/visualization/to_mitsuba.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/open3d/web_visualizer.py b/python/open3d/web_visualizer.py index 9101f610926..c65c8c08f4a 100644 --- a/python/open3d/web_visualizer.py +++ b/python/open3d/web_visualizer.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/requirements.txt b/python/requirements.txt index 148650326df..a7da4963446 100644 --- a/python/requirements.txt +++ b/python/requirements.txt @@ -1,5 +1,6 @@ numpy>=1.18.0,<2.0.0 dash>=2.6.0 -werkzeug>=2.2.3 +werkzeug>=3.0.0 +flask>=3.0.0 nbformat>=5.7.0 configargparse diff --git a/python/requirements_test.txt b/python/requirements_test.txt index 7bb3fd72143..38caaf57575 100644 --- a/python/requirements_test.txt +++ b/python/requirements_test.txt @@ -1,6 +1,8 @@ pytest==7.1.2 pytest-randomly==3.8.0 -scipy==1.10.1 -tensorboard==2.13.0 +scipy==1.10.1; python_version < "3.12" +scipy==1.11.4; python_version >= "3.12" +tensorboard==2.13.0; python_version < "3.12" +tensorboard==2.16.2; python_version >= "3.12" oauthlib==3.2.2 certifi==2024.7.4 diff --git a/python/setup.cfg b/python/setup.cfg index 93a8586735a..b9b1509477a 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -1,27 +1,8 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# The MIT License (MIT) -# -# Copyright (c) 2018-2023 www.open3d.org -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. +# Copyright (c) 2018-2024 www.open3d.org +# SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- [metadata] diff --git a/python/setup.py b/python/setup.py index e32f69ab615..341d91f361c 100644 --- a/python/setup.py +++ b/python/setup.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- @@ -136,6 +136,7 @@ def finalize_options(self): "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Education", "Topic :: Multimedia :: Graphics :: 3D Modeling", "Topic :: Multimedia :: Graphics :: 3D Rendering", diff --git a/python/test/conftest.py b/python/test/conftest.py index e05fa3f44a3..882c23164a0 100644 --- a/python/test/conftest.py +++ b/python/test/conftest.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/core/test_core.py b/python/test/core/test_core.py index 47200dfe338..c94a961e1fe 100644 --- a/python/test/core/test_core.py +++ b/python/test/core/test_core.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/core/test_hashmap.py b/python/test/core/test_hashmap.py index d1b0bee07cd..a0604cdea4d 100644 --- a/python/test/core/test_hashmap.py +++ b/python/test/core/test_hashmap.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/core/test_linalg.py b/python/test/core/test_linalg.py index ca6edb1818d..7d1580570f8 100644 --- a/python/test/core/test_linalg.py +++ b/python/test/core/test_linalg.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/core/test_nn.py b/python/test/core/test_nn.py index efa01a528a9..374ebea11ec 100644 --- a/python/test/core/test_nn.py +++ b/python/test/core/test_nn.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/core/test_size_vector.py b/python/test/core/test_size_vector.py index 03942dc10a8..57ab9f8ab88 100644 --- a/python/test/core/test_size_vector.py +++ b/python/test/core/test_size_vector.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/core/test_sycl_utils.py b/python/test/core/test_sycl_utils.py index cc06b80a1f9..97546abf92b 100644 --- a/python/test/core/test_sycl_utils.py +++ b/python/test/core/test_sycl_utils.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/core/test_tensor_function.py b/python/test/core/test_tensor_function.py index 9b36c83cf34..4a45b06f599 100644 --- a/python/test/core/test_tensor_function.py +++ b/python/test/core/test_tensor_function.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/core/test_torch_integration.py b/python/test/core/test_torch_integration.py index 4b974fc4ff5..c30e32fa499 100644 --- a/python/test/core/test_torch_integration.py +++ b/python/test/core/test_torch_integration.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/data/test_data.py b/python/test/data/test_data.py index 7faa634c93e..657530c1a81 100644 --- a/python/test/data/test_data.py +++ b/python/test/data/test_data.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/io/rpc/test_remote_functions.py b/python/test/io/rpc/test_remote_functions.py index 328c1143b39..532668c146b 100644 --- a/python/test/io/rpc/test_remote_functions.py +++ b/python/test/io/rpc/test_remote_functions.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/io/rpc/test_serialization.py b/python/test/io/rpc/test_serialization.py index 8c8ae60f114..d44d65fd31c 100644 --- a/python/test/io/rpc/test_serialization.py +++ b/python/test/io/rpc/test_serialization.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/io/test_io.py b/python/test/io/test_io.py index 0678bb4ae9c..f8a316474e5 100644 --- a/python/test/io/test_io.py +++ b/python/test/io/test_io.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/io/test_pathlib.py b/python/test/io/test_pathlib.py index ad3313a6067..09b94cdc731 100644 --- a/python/test/io/test_pathlib.py +++ b/python/test/io/test_pathlib.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/ml/test_contrib_iou.py b/python/test/ml/test_contrib_iou.py index 2862e619477..31d06ad6801 100644 --- a/python/test/ml/test_contrib_iou.py +++ b/python/test/ml/test_contrib_iou.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/ml/test_contrib_subsample.py b/python/test/ml/test_contrib_subsample.py index 6d91b188d60..dc8a625a736 100644 --- a/python/test/ml/test_contrib_subsample.py +++ b/python/test/ml/test_contrib_subsample.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/ml_ops/cconv_python.py b/python/test/ml_ops/cconv_python.py index e4fe8118e54..7770a1ae461 100644 --- a/python/test/ml_ops/cconv_python.py +++ b/python/test/ml_ops/cconv_python.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """This is a python implementation for the continuous convolutions meant for diff --git a/python/test/ml_ops/check_gradients.py b/python/test/ml_ops/check_gradients.py index d1fac6ff06f..143278ff64f 100644 --- a/python/test/ml_ops/check_gradients.py +++ b/python/test/ml_ops/check_gradients.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/ml_ops/mltest.py b/python/test/ml_ops/mltest.py index c4761466e1e..0f25f5d46f6 100644 --- a/python/test/ml_ops/mltest.py +++ b/python/test/ml_ops/mltest.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/ml_ops/particle_network_tf.py b/python/test/ml_ops/particle_network_tf.py index 892c97d53ae..1775bb78425 100644 --- a/python/test/ml_ops/particle_network_tf.py +++ b/python/test/ml_ops/particle_network_tf.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/ml_ops/test_cconv.py b/python/test/ml_ops/test_cconv.py index 891498b69d0..8f07d7f9b5e 100644 --- a/python/test/ml_ops/test_cconv.py +++ b/python/test/ml_ops/test_cconv.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """Tests the implementation of the continuous convolution ops""" diff --git a/python/test/ml_ops/test_cconv_python.py b/python/test/ml_ops/test_cconv_python.py index 2461d84b114..0adb7657481 100644 --- a/python/test/ml_ops/test_cconv_python.py +++ b/python/test/ml_ops/test_cconv_python.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """Tests the reference python implementation of the continuous conv""" diff --git a/python/test/ml_ops/test_cublas.py b/python/test/ml_ops/test_cublas.py index 5aa6c671b90..64299bb3df8 100644 --- a/python/test/ml_ops/test_cublas.py +++ b/python/test/ml_ops/test_cublas.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/ml_ops/test_fixed_radius_search.py b/python/test/ml_ops/test_fixed_radius_search.py index f0ccf87eada..b0a8f720129 100644 --- a/python/test/ml_ops/test_fixed_radius_search.py +++ b/python/test/ml_ops/test_fixed_radius_search.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/ml_ops/test_general_sparseconv.py b/python/test/ml_ops/test_general_sparseconv.py index 923b6da9bca..deae230826d 100644 --- a/python/test/ml_ops/test_general_sparseconv.py +++ b/python/test/ml_ops/test_general_sparseconv.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """Tests the implementation of the general sparse convolution ops""" diff --git a/python/test/ml_ops/test_invert_neighbors_list.py b/python/test/ml_ops/test_invert_neighbors_list.py index acc3b9ffdc9..eb7d51427a9 100644 --- a/python/test/ml_ops/test_invert_neighbors_list.py +++ b/python/test/ml_ops/test_invert_neighbors_list.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/ml_ops/test_knn_search.py b/python/test/ml_ops/test_knn_search.py index 175835f6593..38d0e11d644 100644 --- a/python/test/ml_ops/test_knn_search.py +++ b/python/test/ml_ops/test_knn_search.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/ml_ops/test_nms.py b/python/test/ml_ops/test_nms.py index b0f1c1da772..81340717bbc 100644 --- a/python/test/ml_ops/test_nms.py +++ b/python/test/ml_ops/test_nms.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/ml_ops/test_query_pts.py b/python/test/ml_ops/test_query_pts.py index 5791282cc3e..e3d7d902acb 100644 --- a/python/test/ml_ops/test_query_pts.py +++ b/python/test/ml_ops/test_query_pts.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/ml_ops/test_radius_search.py b/python/test/ml_ops/test_radius_search.py index b799b2c7602..c23590c5596 100644 --- a/python/test/ml_ops/test_radius_search.py +++ b/python/test/ml_ops/test_radius_search.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/ml_ops/test_ragged_tensor.py b/python/test/ml_ops/test_ragged_tensor.py index 6f018debf67..a61a668a587 100644 --- a/python/test/ml_ops/test_ragged_tensor.py +++ b/python/test/ml_ops/test_ragged_tensor.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/ml_ops/test_ragged_to_dense.py b/python/test/ml_ops/test_ragged_to_dense.py index cae16e98f1b..9121faa1b46 100644 --- a/python/test/ml_ops/test_ragged_to_dense.py +++ b/python/test/ml_ops/test_ragged_to_dense.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/ml_ops/test_reduce_subarrays_sum.py b/python/test/ml_ops/test_reduce_subarrays_sum.py index 30b8569c43f..ef04afe1426 100644 --- a/python/test/ml_ops/test_reduce_subarrays_sum.py +++ b/python/test/ml_ops/test_reduce_subarrays_sum.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/ml_ops/test_roi_pool.py b/python/test/ml_ops/test_roi_pool.py index ee39d653553..60d17c52d17 100644 --- a/python/test/ml_ops/test_roi_pool.py +++ b/python/test/ml_ops/test_roi_pool.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/ml_ops/test_sampling.py b/python/test/ml_ops/test_sampling.py index 6438f1e1c0f..4590c7afed4 100644 --- a/python/test/ml_ops/test_sampling.py +++ b/python/test/ml_ops/test_sampling.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/ml_ops/test_sparseconv.py b/python/test/ml_ops/test_sparseconv.py index 1fd6ed5058b..5ed8881e9cb 100644 --- a/python/test/ml_ops/test_sparseconv.py +++ b/python/test/ml_ops/test_sparseconv.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """Tests the reference python implementation of the sparse conv""" @@ -89,9 +89,15 @@ def bias_initializer(a): if ml.module.__name__ == 'torch': sparse_conv.to(ml.device) - y = mltest.run_op(ml, ml.device, True, sparse_conv, inp_features, - inp_positions * voxel_size, out_positions * voxel_size, - voxel_size, inp_importance) + y = mltest.run_op(ml, + ml.device, + True, + sparse_conv, + inp_features, + inp_positions * voxel_size, + out_positions * voxel_size, + voxel_size=voxel_size, + inp_importance=inp_importance) # Compare the output to a standard 3d conv # store features in a volume to use standard 3d convs @@ -210,9 +216,15 @@ def test_compare_to_conv3d_batches(ml, dtype, kernel_size, out_channels, inp_features = tf.RaggedTensor.from_row_splits( values=inp_features, row_splits=inp_positions_row_splits) - y = mltest.run_op(ml, ml.device, True, sparse_conv, inp_features, - inp_positions * voxel_size, out_positions * voxel_size, - voxel_size, inp_importance) + y = mltest.run_op(ml, + ml.device, + True, + sparse_conv, + inp_features, + inp_positions * voxel_size, + out_positions * voxel_size, + voxel_size=voxel_size, + inp_importance=inp_importance) for idx in range(batch_size): inp_pos = inp_positions[idx].numpy() inp_feat = inp_features[idx].numpy() @@ -336,9 +348,15 @@ def bias_initializer(a): if ml.module.__name__ == 'torch': sparse_conv_transpose.to(ml.device) - y = mltest.run_op(ml, ml.device, True, sparse_conv_transpose, inp_features, - inp_positions * voxel_size, out_positions * voxel_size, - voxel_size, out_importance) + y = mltest.run_op(ml, + ml.device, + True, + sparse_conv_transpose, + inp_features, + inp_positions * voxel_size, + out_positions * voxel_size, + voxel_size=voxel_size, + out_importance=out_importance) # Compare the output to a standard 3d conv # store features in a volume to use standard 3d convs @@ -463,9 +481,15 @@ def test_compare_to_conv3dtranspose_batches(ml, dtype, kernel_size, inp_features = tf.RaggedTensor.from_row_splits( values=inp_features, row_splits=inp_positions_row_splits) - y = mltest.run_op(ml, ml.device, True, sparse_conv_transpose, inp_features, - inp_positions * voxel_size, out_positions * voxel_size, - voxel_size, out_importance) + y = mltest.run_op(ml, + ml.device, + True, + sparse_conv_transpose, + inp_features, + inp_positions * voxel_size, + out_positions * voxel_size, + voxel_size=voxel_size, + out_importance=out_importance) for idx in range(batch_size): inp_pos = inp_positions[idx].numpy() inp_feat = inp_features[idx].numpy() diff --git a/python/test/ml_ops/test_subsampling.py b/python/test/ml_ops/test_subsampling.py index 21812d45792..f4eec270b5b 100644 --- a/python/test/ml_ops/test_subsampling.py +++ b/python/test/ml_ops/test_subsampling.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/ml_ops/test_tf_training_graph_mode.py b/python/test/ml_ops/test_tf_training_graph_mode.py index d9e3c178234..d00beca6484 100644 --- a/python/test/ml_ops/test_tf_training_graph_mode.py +++ b/python/test/ml_ops/test_tf_training_graph_mode.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """This test simulates a network training by running some ops in graph mode for diff --git a/python/test/ml_ops/test_three_interp.py b/python/test/ml_ops/test_three_interp.py index d4383567587..097bafc9dee 100644 --- a/python/test/ml_ops/test_three_interp.py +++ b/python/test/ml_ops/test_three_interp.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/ml_ops/test_three_nn.py b/python/test/ml_ops/test_three_nn.py index 57e96b58b23..a005dc94335 100644 --- a/python/test/ml_ops/test_three_nn.py +++ b/python/test/ml_ops/test_three_nn.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/ml_ops/test_voxel_pooling.py b/python/test/ml_ops/test_voxel_pooling.py index 90426acef93..a5198cdfc42 100644 --- a/python/test/ml_ops/test_voxel_pooling.py +++ b/python/test/ml_ops/test_voxel_pooling.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/ml_ops/test_voxelize.py b/python/test/ml_ops/test_voxelize.py index bf98a406262..e4b1a760078 100644 --- a/python/test/ml_ops/test_voxelize.py +++ b/python/test/ml_ops/test_voxelize.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/open3d_test.py b/python/test/open3d_test.py old mode 100644 new mode 100755 index 46a768746d0..21fb7bf9c51 --- a/python/test/open3d_test.py +++ b/python/test/open3d_test.py @@ -1,18 +1,10 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- -import os -import sys -import urllib.request -import zipfile - -import numpy as np -import pytest - def torch_available(): try: @@ -23,20 +15,22 @@ def torch_available(): return True -def list_devices(): +def list_devices(enable_cuda=True, enable_sycl=False): """ - If Open3D is built with CUDA support: - - If cuda device is available, returns [Device("CPU:0"), Device("CUDA:0")]. - - If cuda device is not available, returns [Device("CPU:0")]. - - If Open3D is built without CUDA support: - - returns [Device("CPU:0")]. + Returns a list of devices that are available for Open3D to use: + - Device("CPU:0") + - Device("CUDA:0") if built with CUDA support and a CUDA device is available. + - Device("SYCL:0") if built with SYCL support and a SYCL GPU device is available. """ import open3d as o3d - if o3d.core.cuda.device_count() > 0: - return [o3d.core.Device("CPU:0"), o3d.core.Device("CUDA:0")] - else: - return [o3d.core.Device("CPU:0")] + + devices = [o3d.core.Device("CPU:0")] + if enable_cuda and o3d.core.cuda.device_count() > 0: + devices.append(o3d.core.Device("CUDA:0")) + # Ignore fallback SYCL CPU device + if enable_sycl and len(o3d.core.sycl.get_available_devices()) > 1: + devices.append(o3d.core.Device("SYCL:0")) + return devices def list_devices_with_torch(): diff --git a/python/test/t/geometry/test_image.py b/python/test/t/geometry/test_image.py index 863fb1acb83..54d75e90d5d 100644 --- a/python/test/t/geometry/test_image.py +++ b/python/test/t/geometry/test_image.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/t/geometry/test_lineset.py b/python/test/t/geometry/test_lineset.py index eaa38767fe8..2d3daceccaa 100644 --- a/python/test/t/geometry/test_lineset.py +++ b/python/test/t/geometry/test_lineset.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/t/geometry/test_pointcloud.py b/python/test/t/geometry/test_pointcloud.py index e6c194477ca..dc98b1db951 100644 --- a/python/test/t/geometry/test_pointcloud.py +++ b/python/test/t/geometry/test_pointcloud.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- @@ -193,3 +193,24 @@ def test_pickle(device): assert pcd_load.point.positions.device == device and pcd_load.point.positions.dtype == o3c.float32 np.testing.assert_equal(pcd.point.positions.cpu().numpy(), pcd_load.point.positions.cpu().numpy()) + + +def test_metrics(): + + from open3d.t.geometry import TriangleMesh, PointCloud, Metric, MetricParameters + # box is a cube with one vertex at the origin and a side length 1 + pos = TriangleMesh.create_box().vertex.positions + pcd1 = PointCloud(pos.clone()) + pcd2 = PointCloud(pos * 1.1) + + # (1, 3, 3, 1) vertices are shifted by (0, 0.1, 0.1*sqrt(2), 0.1*sqrt(3)) + # respectively + metric_params = MetricParameters(fscore_radius=(0.01, 0.11, 0.15, 0.18)) + metrics = pcd1.compute_metrics( + pcd2, (Metric.ChamferDistance, Metric.HausdorffDistance, Metric.FScore), + metric_params) + + np.testing.assert_allclose( + metrics.cpu().numpy(), + (0.22436734, np.sqrt(3) / 10, 100. / 8, 400. / 8, 700. / 8, 100.), + rtol=1e-6) diff --git a/python/test/t/geometry/test_raycasting_scene.py b/python/test/t/geometry/test_raycasting_scene.py old mode 100644 new mode 100755 index 3ce024a2b29..2164f96d6fe --- a/python/test/t/geometry/test_raycasting_scene.py +++ b/python/test/t/geometry/test_raycasting_scene.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- @@ -9,57 +9,86 @@ import numpy as np import pytest +import sys +import os + +sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../..") +from open3d_test import list_devices + # test intersection with a single triangle -def test_cast_rays(): +@pytest.mark.parametrize("device", + list_devices(enable_cuda=False, enable_sycl=True)) +def test_cast_rays(device): vertices = o3d.core.Tensor([[0, 0, 0], [1, 0, 0], [1, 1, 0]], - dtype=o3d.core.float32) - triangles = o3d.core.Tensor([[0, 1, 2]], dtype=o3d.core.uint32) + dtype=o3d.core.float32, + device=device) + triangles = o3d.core.Tensor([[0, 1, 2]], + dtype=o3d.core.uint32, + device=device) - scene = o3d.t.geometry.RaycastingScene() + scene = o3d.t.geometry.RaycastingScene(device=device) geom_id = scene.add_triangles(vertices, triangles) - rays = o3d.core.Tensor([[0.2, 0.1, 1, 0, 0, -1], [10, 10, 10, 1, 0, 0]], - dtype=o3d.core.float32) + rays = o3d.core.Tensor( + [[0.2, 0.1, 1, 0, 0, -1], [10, 10, 10, 1, 0, 0]], + dtype=o3d.core.float32, + device=device, + ) ans = scene.cast_rays(rays) # first ray hits the triangle - assert geom_id == ans['geometry_ids'][0] - assert np.isclose(ans['t_hit'][0].item(), 1.0) + assert geom_id == ans["geometry_ids"][0].cpu() + assert np.isclose(ans["t_hit"][0].item(), 1.0) # second ray misses - assert o3d.t.geometry.RaycastingScene.INVALID_ID == ans['geometry_ids'][1] - assert np.isinf(ans['t_hit'][1].item()) + assert o3d.t.geometry.RaycastingScene.INVALID_ID == ans["geometry_ids"][ + 1].cpu() + assert np.isinf(ans["t_hit"][1].item()) # cast lots of random rays to test the internal batching # we expect no errors for this test -def test_cast_lots_of_rays(): +@pytest.mark.parametrize("device", + list_devices(enable_cuda=False, enable_sycl=True)) +def test_cast_lots_of_rays(device): vertices = o3d.core.Tensor([[0, 0, 0], [1, 0, 0], [1, 1, 0]], - dtype=o3d.core.float32) - triangles = o3d.core.Tensor([[0, 1, 2]], dtype=o3d.core.uint32) + dtype=o3d.core.float32, + device=device) + triangles = o3d.core.Tensor([[0, 1, 2]], + dtype=o3d.core.uint32, + device=device) - scene = o3d.t.geometry.RaycastingScene() + scene = o3d.t.geometry.RaycastingScene(device=device) scene.add_triangles(vertices, triangles) rs = np.random.RandomState(123) rays = o3d.core.Tensor.from_numpy(rs.rand(7654321, 6).astype(np.float32)) + rays = rays.to(device) _ = scene.cast_rays(rays) # test occlusion with a single triangle -def test_test_occlusions(): +@pytest.mark.parametrize("device", + list_devices(enable_cuda=False, enable_sycl=True)) +def test_test_occlusions(device): vertices = o3d.core.Tensor([[0, 0, 0], [1, 0, 0], [1, 1, 0]], - dtype=o3d.core.float32) - triangles = o3d.core.Tensor([[0, 1, 2]], dtype=o3d.core.uint32) + dtype=o3d.core.float32, + device=device) + triangles = o3d.core.Tensor([[0, 1, 2]], + dtype=o3d.core.uint32, + device=device) - scene = o3d.t.geometry.RaycastingScene() + scene = o3d.t.geometry.RaycastingScene(device=device) scene.add_triangles(vertices, triangles) - rays = o3d.core.Tensor([[0.2, 0.1, 1, 0, 0, -1], [10, 10, 10, 1, 0, 0]], - dtype=o3d.core.float32) - ans = scene.test_occlusions(rays) + rays = o3d.core.Tensor( + [[0.2, 0.1, 1, 0, 0, -1], [10, 10, 10, 1, 0, 0]], + dtype=o3d.core.float32, + device=device, + ) + ans = scene.test_occlusions(rays).cpu() # first ray is occluded by the triangle assert ans[0] == True @@ -68,88 +97,124 @@ def test_test_occlusions(): assert ans[1] == False # set tfar such that no ray is occluded - ans = scene.test_occlusions(rays, tfar=0.5) + ans = scene.test_occlusions(rays, tfar=0.5).cpu() assert ans.any() == False # set tnear such that no ray is occluded - ans = scene.test_occlusions(rays, tnear=1.5) + ans = scene.test_occlusions(rays, tnear=1.5).cpu() assert ans.any() == False # test lots of random rays for occlusions to test the internal batching # we expect no errors for this test -def test_test_lots_of_occlusions(): +@pytest.mark.parametrize("device", + list_devices(enable_cuda=False, enable_sycl=True)) +def test_test_lots_of_occlusions(device): vertices = o3d.core.Tensor([[0, 0, 0], [1, 0, 0], [1, 1, 0]], - dtype=o3d.core.float32) - triangles = o3d.core.Tensor([[0, 1, 2]], dtype=o3d.core.uint32) + dtype=o3d.core.float32, + device=device) + triangles = o3d.core.Tensor([[0, 1, 2]], + dtype=o3d.core.uint32, + device=device) - scene = o3d.t.geometry.RaycastingScene() + scene = o3d.t.geometry.RaycastingScene(device=device) scene.add_triangles(vertices, triangles) rs = np.random.RandomState(123) rays = o3d.core.Tensor.from_numpy(rs.rand(7654321, 6).astype(np.float32)) + rays = rays.to(device) _ = scene.test_occlusions(rays) -def test_add_triangle_mesh(): - cube = o3d.t.geometry.TriangleMesh.from_legacy( - o3d.geometry.TriangleMesh.create_box()) +@pytest.mark.parametrize("device", + list_devices(enable_cuda=False, enable_sycl=True)) +def test_add_triangle_mesh(device): + cube = o3d.t.geometry.TriangleMesh.create_box() + cube = cube.to(device) - scene = o3d.t.geometry.RaycastingScene() + scene = o3d.t.geometry.RaycastingScene(device=device) scene.add_triangles(cube) - rays = o3d.core.Tensor([[0.5, 0.5, -1, 0, 0, 1], [0.5, 0.5, 0.5, 0, 0, 1], - [10, 10, 10, 1, 0, 0]], - dtype=o3d.core.float32) + rays = o3d.core.Tensor( + [[0.5, 0.5, -1, 0, 0, 1], [0.5, 0.5, 0.5, 0, 0, 1], + [10, 10, 10, 1, 0, 0]], + dtype=o3d.core.float32, + device=device, + ) ans = scene.count_intersections(rays) - np.testing.assert_equal(ans.numpy(), [2, 1, 0]) + np.testing.assert_equal(ans.cpu().numpy(), [2, 1, 0]) -def test_count_intersections(): - cube = o3d.t.geometry.TriangleMesh.from_legacy( - o3d.geometry.TriangleMesh.create_box()) +@pytest.mark.parametrize("device", + list_devices(enable_cuda=False, enable_sycl=True)) +def test_count_intersections(device): + cube = o3d.t.geometry.TriangleMesh.create_box() + vertex_positions = cube.vertex.positions + vertex_positions = vertex_positions.to(device) + triangle_indices = cube.triangle.indices + triangle_indices = triangle_indices.to(o3d.core.Dtype.UInt32) + triangle_indices = triangle_indices.to(device) - scene = o3d.t.geometry.RaycastingScene() - scene.add_triangles(cube) + scene = o3d.t.geometry.RaycastingScene(device=device) + scene.add_triangles(vertex_positions, triangle_indices) - rays = o3d.core.Tensor([[0.5, 0.5, -1, 0, 0, 1], [0.5, 0.5, 0.5, 0, 0, 1], - [10, 10, 10, 1, 0, 0]], - dtype=o3d.core.float32) + rays = o3d.core.Tensor( + [[0.5, 0.5, -1, 0, 0, 1], [0.5, 0.5, 0.5, 0, 0, 1], + [10, 10, 10, 1, 0, 0]], + dtype=o3d.core.float32, + device=device, + ) ans = scene.count_intersections(rays) - np.testing.assert_equal(ans.numpy(), [2, 1, 0]) + np.testing.assert_equal(ans.cpu().numpy(), [2, 1, 0]) # count lots of random ray intersections to test the internal batching # we expect no errors for this test -def test_count_lots_of_intersections(): - cube = o3d.t.geometry.TriangleMesh.from_legacy( - o3d.geometry.TriangleMesh.create_box()) - - scene = o3d.t.geometry.RaycastingScene() - scene.add_triangles(cube) +@pytest.mark.parametrize("device", + list_devices(enable_cuda=False, enable_sycl=True)) +def test_count_lots_of_intersections(device): + cube = o3d.t.geometry.TriangleMesh.create_box() + vertex_positions = cube.vertex.positions + vertex_positions = vertex_positions.to(device) + triangle_indices = cube.triangle.indices + triangle_indices = triangle_indices.to(o3d.core.Dtype.UInt32) + triangle_indices = triangle_indices.to(device) + + scene = o3d.t.geometry.RaycastingScene(device=device) + scene.add_triangles(vertex_positions, triangle_indices) rs = np.random.RandomState(123) rays = o3d.core.Tensor.from_numpy(rs.rand(1234567, 6).astype(np.float32)) + rays = rays.to(device) _ = scene.count_intersections(rays) -def test_list_intersections(): - cube = o3d.t.geometry.TriangleMesh.from_legacy( - o3d.geometry.TriangleMesh.create_box()) - - scene = o3d.t.geometry.RaycastingScene() - scene.add_triangles(cube) - - rays = o3d.core.Tensor([[0.5, 0.5, -1, 0, 0, 1], [0.5, 0.5, 0.5, 0, 0, 1], - [10, 10, 10, 1, 0, 0]], - dtype=o3d.core.float32) +@pytest.mark.parametrize("device", + list_devices(enable_cuda=False, enable_sycl=True)) +def test_list_intersections(device): + cube = o3d.t.geometry.TriangleMesh.create_box() + vertex_positions = cube.vertex.positions + vertex_positions = vertex_positions.to(device) + triangle_indices = cube.triangle.indices + triangle_indices = triangle_indices.to(o3d.core.Dtype.UInt32) + triangle_indices = triangle_indices.to(device) + + scene = o3d.t.geometry.RaycastingScene(device=device) + scene.add_triangles(vertex_positions, triangle_indices) + + rays = o3d.core.Tensor( + [[0.5, 0.5, -1, 0, 0, 1], [0.5, 0.5, 0.5, 0, 0, 1], + [10, 10, 10, 1, 0, 0]], + dtype=o3d.core.float32, + device=device, + ) ans = scene.list_intersections(rays) - np.testing.assert_allclose(ans['t_hit'].numpy(), + np.testing.assert_allclose(ans["t_hit"].cpu().numpy(), np.array([1.0, 2.0, 0.5]), rtol=1e-6, atol=1e-6) @@ -157,15 +222,22 @@ def test_list_intersections(): # list lots of random ray intersections to test the internal batching # we expect no errors for this test -def test_list_lots_of_intersections(): - cube = o3d.t.geometry.TriangleMesh.from_legacy( - o3d.geometry.TriangleMesh.create_box()) - - scene = o3d.t.geometry.RaycastingScene() - scene.add_triangles(cube) +@pytest.mark.parametrize("device", + list_devices(enable_cuda=False, enable_sycl=True)) +def test_list_lots_of_intersections(device): + cube = o3d.t.geometry.TriangleMesh.create_box() + vertex_positions = cube.vertex.positions + vertex_positions = vertex_positions.to(device) + triangle_indices = cube.triangle.indices + triangle_indices = triangle_indices.to(o3d.core.Dtype.UInt32) + triangle_indices = triangle_indices.to(device) + + scene = o3d.t.geometry.RaycastingScene(device=device) + scene.add_triangles(vertex_positions, triangle_indices) rs = np.random.RandomState(123) rays = o3d.core.Tensor.from_numpy(rs.rand(123456, 6).astype(np.float32)) + rays = rays.to(device) _ = scene.list_intersections(rays) @@ -182,12 +254,14 @@ def test_compute_closest_points(): dtype=o3d.core.float32) ans = scene.compute_closest_points(query_points) - assert (geom_id == ans['geometry_ids']).all() - assert (0 == ans['primitive_ids']).all() - np.testing.assert_allclose(ans['points'].numpy(), - np.array([[0.2, 0.1, 0.0], [1, 1, 0]]), - rtol=1e-6, - atol=1e-6) + assert (geom_id == ans["geometry_ids"]).all() + assert (0 == ans["primitive_ids"]).all() + np.testing.assert_allclose( + ans["points"].numpy(), + np.array([[0.2, 0.1, 0.0], [1, 1, 0]]), + rtol=1e-6, + atol=1e-6, + ) # compute lots of closest points to test the internal batching @@ -207,8 +281,7 @@ def test_compute_lots_of_closest_points(): def test_compute_distance(): - cube = o3d.t.geometry.TriangleMesh.from_legacy( - o3d.geometry.TriangleMesh.create_box()) + cube = o3d.t.geometry.TriangleMesh.create_box() scene = o3d.t.geometry.RaycastingScene() scene.add_triangles(cube) @@ -221,8 +294,7 @@ def test_compute_distance(): def test_compute_signed_distance(): - cube = o3d.t.geometry.TriangleMesh.from_legacy( - o3d.geometry.TriangleMesh.create_box()) + cube = o3d.t.geometry.TriangleMesh.create_box() scene = o3d.t.geometry.RaycastingScene() scene.add_triangles(cube) @@ -235,8 +307,7 @@ def test_compute_signed_distance(): def test_compute_occupancy(): - cube = o3d.t.geometry.TriangleMesh.from_legacy( - o3d.geometry.TriangleMesh.create_box()) + cube = o3d.t.geometry.TriangleMesh.create_box() scene = o3d.t.geometry.RaycastingScene() scene.add_triangles(cube) @@ -276,53 +347,49 @@ def test_output_shapes(shape): # some outputs append a specific last dim last_dim = { - 't_hit': [], - 'geometry_ids': [], - 'primitive_ids': [], - 'primitive_uvs': [2], - 'primitive_normals': [3], - 'points': [3], - 'ray_ids': [], - 'ray_splits': [] + "t_hit": [], + "geometry_ids": [], + "primitive_ids": [], + "primitive_uvs": [2], + "primitive_normals": [3], + "points": [3], + "ray_ids": [], + "ray_splits": [], } ans = scene.cast_rays(rays) for k, v in ans.items(): expected_shape = shape + last_dim[k] - assert list( - v.shape - ) == expected_shape, 'shape mismatch: expected {} but got {} for {}'.format( - expected_shape, list(v.shape), k) + assert (list(v.shape) == expected_shape + ), "shape mismatch: expected {} but got {} for {}".format( + expected_shape, list(v.shape), k) ans = scene.compute_closest_points(query_points) for k, v in ans.items(): expected_shape = shape + last_dim[k] - assert list( - v.shape - ) == expected_shape, 'shape mismatch: expected {} but got {} for {}'.format( - expected_shape, list(v.shape), k) + assert (list(v.shape) == expected_shape + ), "shape mismatch: expected {} but got {} for {}".format( + expected_shape, list(v.shape), k) ans = scene.list_intersections(rays) nx = np.sum(scene.count_intersections(rays).numpy()).tolist() for k, v in ans.items(): - if k == 'ray_splits': + if k == "ray_splits": alt_shape = [np.prod(rays.shape[:-1]) + 1] else: alt_shape = [nx] - #use np.append otherwise issues if alt_shape = [0] and last_dim[k] = [] + # use np.append otherwise issues if alt_shape = [0] and last_dim[k] = [] expected_shape = np.append(alt_shape, last_dim[k]).tolist() - assert list( - v.shape - ) == expected_shape, 'shape mismatch: expected {} but got {} for {}'.format( - expected_shape, list(v.shape), k) + assert (list(v.shape) == expected_shape + ), "shape mismatch: expected {} but got {} for {}".format( + expected_shape, list(v.shape), k) def test_sphere_wrong_occupancy(): # This test checks a specific scenario where the old implementation # without ray jitter produced wrong results for a sphere because some # rays miss hitting exactly a vertex or an edge. - mesh = o3d.geometry.TriangleMesh.create_sphere(0.8) - mesh = o3d.t.geometry.TriangleMesh.from_legacy(mesh) + mesh = o3d.t.geometry.TriangleMesh.create_sphere(0.8) scene = o3d.t.geometry.RaycastingScene() scene.add_triangles(mesh) @@ -336,25 +403,58 @@ def test_sphere_wrong_occupancy(): occupancy = scene.compute_occupancy(query_points) expected = np.array( - [[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], - [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], - [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]], - [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 1.0, 1.0, 0.0, 0.0], - [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], - [0.0, 0.0, 1.0, 1.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]], - [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], - [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], - [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]], - [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], - [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], - [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]], - [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 1.0, 1.0, 0.0, 0.0], - [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], - [0.0, 0.0, 1.0, 1.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]], - [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], - [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], - [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]]], - dtype=np.float32) + [ + [ + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + ], + [ + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 1.0, 1.0, 0.0, 0.0], + [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], + [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], + [0.0, 0.0, 1.0, 1.0, 0.0, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + ], + [ + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], + [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], + [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], + [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + ], + [ + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], + [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], + [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], + [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + ], + [ + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 1.0, 1.0, 0.0, 0.0], + [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], + [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], + [0.0, 0.0, 1.0, 1.0, 0.0, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + ], + [ + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + ], + ], + dtype=np.float32, + ) np.testing.assert_equal(occupancy.numpy(), expected) # we should get the same result with more samples diff --git a/python/test/t/geometry/test_tensormap.py b/python/test/t/geometry/test_tensormap.py index fc1b6232aae..255c1ef55b2 100644 --- a/python/test/t/geometry/test_tensormap.py +++ b/python/test/t/geometry/test_tensormap.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/t/geometry/test_trianglemesh.py b/python/test/t/geometry/test_trianglemesh.py index f626cb4dc89..bc1cd21db3c 100644 --- a/python/test/t/geometry/test_trianglemesh.py +++ b/python/test/t/geometry/test_trianglemesh.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- @@ -616,6 +616,19 @@ def test_create_text(): assert mesh.triangle.indices.shape == (936, 3) +def test_create_isosurfaces(): + """Create signed distance field for sphere of radius 0.5 and extract sphere + from it. + """ + coords = np.stack(np.meshgrid(*3 * [np.linspace(-1, 1, num=64)], + indexing='ij'), + axis=-1) + vol = np.linalg.norm(coords, axis=-1) - 0.5 + mesh = o3d.t.geometry.TriangleMesh.create_isosurfaces(vol) + assert mesh.vertex.positions.shape[0] == 4728 + assert mesh.triangle.indices.shape[0] == 9452 + + def test_simplify_quadric_decimation(): cube = o3d.t.geometry.TriangleMesh.from_legacy( o3d.geometry.TriangleMesh.create_box().subdivide_midpoint(3)) @@ -1385,3 +1398,23 @@ def test_remove_non_manifold_edges(device, int_t, float_t): device=device) assert test_box.vertex.positions.allclose(verts) assert test_box.triangle.indices.allclose(box.triangle.indices) + + +def test_metrics(): + + from open3d.t.geometry import TriangleMesh, Metric, MetricParameters + # box is a cube with one vertex at the origin and a side length 1 + box1 = TriangleMesh.create_box() + box2 = TriangleMesh.create_box() + box2.vertex.positions *= 1.1 + + # 3 faces of the cube are the same, and 3 are shifted up by 0.1 - raycast + # distances should follow this. + metric_params = MetricParameters(fscore_radius=(0.05, 0.15), + n_sampled_points=100000) + metrics = box1.compute_metrics( + box2, (Metric.ChamferDistance, Metric.HausdorffDistance, Metric.FScore), + metric_params) + + np.testing.assert_allclose(metrics.cpu().numpy(), (0.1, 0.17, 50, 100), + rtol=0.05) diff --git a/python/test/t/io/test_noise.py b/python/test/t/io/test_noise.py index 00316bd1c9d..52a807762ce 100644 --- a/python/test/t/io/test_noise.py +++ b/python/test/t/io/test_noise.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/t/io/test_realsense.py b/python/test/t/io/test_realsense.py index 2d05e1c28d7..ae325249c5d 100755 --- a/python/test/t/io/test_realsense.py +++ b/python/test/t/io/test_realsense.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- @@ -64,7 +64,7 @@ def test_RSBagReader(): assert n_frames == 6 # save_frames - bag_reader = o3d.t.io.RGBDVideoReader.create("L515_test_s.bag") + bag_reader = o3d.t.io.RGBDVideoReader.create(sample_l515_bag.path) bag_reader.save_frames("L515_test_s") # Use issubset() since there may be other OS files present assert {'depth', 'color', @@ -79,8 +79,6 @@ def test_RSBagReader(): }.issubset(os.listdir('L515_test_s/color')) shutil.rmtree("L515_test_s") - if os.name != 'nt': # Permission error in Windows - os.remove("L515_test_s.bag") # Test recording from a RealSense camera, if one is connected diff --git a/python/test/t/registration/test_registration.py b/python/test/t/registration/test_registration.py index c9bed8f5c84..4cbea101c7f 100644 --- a/python/test/t/registration/test_registration.py +++ b/python/test/t/registration/test_registration.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/t/registration/test_transformation_estimation.py b/python/test/t/registration/test_transformation_estimation.py index f95b63c874e..f59408b84a5 100644 --- a/python/test/t/registration/test_transformation_estimation.py +++ b/python/test/t/registration/test_transformation_estimation.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/test_color_map_optimization.py b/python/test/test_color_map_optimization.py index 593088b2349..cc7e276315d 100644 --- a/python/test/test_color_map_optimization.py +++ b/python/test/test_color_map_optimization.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/test_flags.py b/python/test/test_flags.py index 0077d41604f..b614183f648 100644 --- a/python/test/test_flags.py +++ b/python/test/test_flags.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/test_octree.py b/python/test/test_octree.py index 2cc9754b827..27dc6f28a03 100644 --- a/python/test/test_octree.py +++ b/python/test/test_octree.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/test_open3d_eigen.py b/python/test/test_open3d_eigen.py index 24535fff95c..d3b3ad1d13f 100644 --- a/python/test/test_open3d_eigen.py +++ b/python/test/test_open3d_eigen.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/visualization/test_cpu_rendering.py b/python/test/visualization/test_cpu_rendering.py index 53c92edd0f5..ffaf9021c32 100644 --- a/python/test/visualization/test_cpu_rendering.py +++ b/python/test/visualization/test_cpu_rendering.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/test/visualization/test_tensorboard_plugin.py b/python/test/visualization/test_tensorboard_plugin.py index c1913a3ec29..db728647e0b 100644 --- a/python/test/visualization/test_tensorboard_plugin.py +++ b/python/test/visualization/test_tensorboard_plugin.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- import os diff --git a/python/tools/app.py b/python/tools/app.py index 02c8cc65e79..73434e6440d 100644 --- a/python/tools/app.py +++ b/python/tools/app.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/python/tools/cli.py b/python/tools/cli.py index 7f8aefa3aca..1b8dcb2d406 100644 --- a/python/tools/cli.py +++ b/python/tools/cli.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- diff --git a/util/check_style.py b/util/check_style.py index 34442dec310..4b54e02a916 100644 --- a/util/check_style.py +++ b/util/check_style.py @@ -1,7 +1,7 @@ # ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- @@ -64,7 +64,7 @@ class CppFormatter: standard_header = """// ---------------------------------------------------------------------------- // - Open3D: www.open3d.org - // ---------------------------------------------------------------------------- -// Copyright (c) 2018-2023 www.open3d.org +// Copyright (c) 2018-2024 www.open3d.org // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- """ @@ -78,8 +78,13 @@ def _check_style(file_path, clang_format_bin): """ Returns (true, true) if (style, header) is valid. """ - with open(file_path, 'r', encoding='utf-8') as f: - is_valid_header = f.read().startswith(CppFormatter.standard_header) + try: + with open(file_path, 'r', encoding='utf-8') as f: + is_valid_header = (f.read(len(CppFormatter.standard_header)) == + CppFormatter.standard_header) + except Exception as exp: + print(f"Error reading file header {file_path}: {exp}") + is_valid_header = False cmd = [ clang_format_bin, @@ -141,7 +146,7 @@ class PythonFormatter: standard_header = """# ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- -# Copyright (c) 2018-2023 www.open3d.org +# Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------------------------------------------------------------------------- """ @@ -156,10 +161,14 @@ def _check_style(file_path, style_config): Returns (true, true) if (style, header) is valid. """ - with open(file_path, 'r', encoding='utf-8') as f: - content = f.read() - is_valid_header = (len(content) == 0 or content.startswith( - PythonFormatter.standard_header)) + try: + with open(file_path, 'r', encoding='utf-8') as f: + content = f.read() + is_valid_header = (len(content) == 0 or content.startswith( + PythonFormatter.standard_header)) + except Exception as exp: + print(f"Error reading file header {file_path}: {exp}") + is_valid_header = False _, _, changed = yapf.yapflib.yapf_api.FormatFile( file_path, style_config=style_config, in_place=False) @@ -296,7 +305,9 @@ def _glob_files(directories, extensions): for extension in extensions: extension_regex = "*." + extension file_paths.extend(directory.rglob(extension_regex)) - file_paths = [str(file_path) for file_path in file_paths] + file_paths = [ + str(file_path) for file_path in file_paths if file_path.name[0] != '.' + ] file_paths = sorted(list(set(file_paths))) return file_paths diff --git a/util/ci_utils.sh b/util/ci_utils.sh index aa30d2c12ad..1adb4b7d8c5 100644 --- a/util/ci_utils.sh +++ b/util/ci_utils.sh @@ -25,11 +25,8 @@ LOW_MEM_USAGE=${LOW_MEM_USAGE:-OFF} # Dependency versions: # CUDA: see docker/docker_build.sh # ML -TENSORFLOW_VER="2.13.0" -TORCH_VER="2.0.1" -TORCH_CPU_GLNX_VER="${TORCH_VER}+cpu" -TORCH_CUDA_GLNX_VER="${TORCH_VER}+cu117" # match CUDA_VERSION in docker/docker_build.sh -TORCH_MACOS_VER="${TORCH_VER}" +TENSORFLOW_VER="2.16.2" +TORCH_VER="2.2.2" TORCH_REPO_URL="https://download.pytorch.org/whl/torch/" # Python PIP_VER="23.2.1" @@ -53,7 +50,8 @@ install_python_dependencies() { if [[ "with-cuda" =~ ^($options)$ ]]; then TF_ARCH_NAME=tensorflow TF_ARCH_DISABLE_NAME=tensorflow-cpu - TORCH_GLNX="torch==$TORCH_CUDA_GLNX_VER" + CUDA_VER=$(nvcc --version | grep "release " | cut -c33-37 | sed 's|[^0-9]||g') # e.g.: 117, 118, 121, ... + TORCH_GLNX="torch==${TORCH_VER}+cu${CUDA_VER}" else # tensorflow-cpu wheels for macOS arm64 are not available if [[ "$OSTYPE" == "darwin"* ]]; then @@ -63,7 +61,7 @@ install_python_dependencies() { TF_ARCH_NAME=tensorflow-cpu TF_ARCH_DISABLE_NAME=tensorflow fi - TORCH_GLNX="torch==$TORCH_CPU_GLNX_VER" + TORCH_GLNX="torch==${TORCH_VER}+cpu" fi # TODO: modify other locations to use requirements.txt @@ -83,7 +81,7 @@ install_python_dependencies() { python -m pip install -U "${TORCH_GLNX}" -f "$TORCH_REPO_URL" tensorboard elif [[ "$OSTYPE" == "darwin"* ]]; then - python -m pip install -U torch=="$TORCH_MACOS_VER" -f "$TORCH_REPO_URL" tensorboard + python -m pip install -U torch=="$TORCH_VER" -f "$TORCH_REPO_URL" tensorboard else echo "unknown OS $OSTYPE" exit 1 @@ -251,8 +249,8 @@ test_wheel() { python -m pip --version echo "Installing Open3D wheel $wheel_path in virtual environment..." python -m pip install "$wheel_path" - python -c "import open3d; print('Installed:', open3d); print('BUILD_CUDA_MODULE: ', open3d._build_config['BUILD_CUDA_MODULE'])" - python -c "import open3d; print('CUDA available: ', open3d.core.cuda.is_available())" + python -W default -c "import open3d; print('Installed:', open3d); print('BUILD_CUDA_MODULE: ', open3d._build_config['BUILD_CUDA_MODULE'])" + python -W default -c "import open3d; print('CUDA available: ', open3d.core.cuda.is_available())" echo # echo "Dynamic libraries used:" # DLL_PATH=$(dirname $(python -c "import open3d; print(open3d.cpu.pybind.__file__)"))/.. @@ -262,27 +260,23 @@ test_wheel() { # find "$DLL_PATH"/cpu/ -type f -execdir otool -L {} \; # fi echo - # FIXME: Needed because Open3D-ML main TF and PyTorch is older than dev. - if [ $BUILD_CUDA_MODULE == ON ]; then - install_python_dependencies with-cuda - else - install_python_dependencies - fi - if [ "$BUILD_PYTORCH_OPS" == ON ]; then - # python -m pip install -r "$OPEN3D_ML_ROOT/requirements-torch.txt" - python -c \ + if python -c "import sys, open3d; sys.exit(not open3d._build_config['BUILD_PYTORCH_OPS'])"; then + BUILD_PYTORCH_OPS=ON + python -m pip install -r "$OPEN3D_ML_ROOT/requirements-torch.txt" + python -W default -c \ "import open3d.ml.torch; print('PyTorch Ops library loaded:', open3d.ml.torch._loaded)" fi - if [ "$BUILD_TENSORFLOW_OPS" == ON ]; then - # python -m pip install -r "$OPEN3D_ML_ROOT/requirements-tensorflow.txt" - python -c \ + if python -c "import sys, open3d; sys.exit(not open3d._build_config['BUILD_TENSORFLOW_OPS'])"; then + BUILD_TENSORFLOW_OPS=ON + python -m pip install -r "$OPEN3D_ML_ROOT/requirements-tensorflow.txt" + python -W default -c \ "import open3d.ml.tf.ops; print('TensorFlow Ops library loaded:', open3d.ml.tf.ops)" fi if [ "$BUILD_TENSORFLOW_OPS" == ON ] && [ "$BUILD_PYTORCH_OPS" == ON ]; then echo "Importing TensorFlow and torch in the reversed order" - python -c "import tensorflow as tf; import torch; import open3d.ml.torch as o3d" + python -W default -c "import tensorflow as tf; import torch; import open3d.ml.torch as o3d" echo "Importing TensorFlow and torch in the normal order" - python -c "import open3d.ml.torch as o3d; import tensorflow as tf; import torch" + python -W default -c "import open3d.ml.torch as o3d; import tensorflow as tf; import torch" fi deactivate open3d_test.venv # argument prevents unbound variable error } @@ -316,11 +310,9 @@ run_cpp_unit_tests() { # Need variable OPEN3D_INSTALL_DIR test_cpp_example() { # Now I am in Open3D/build/ - cd .. - git clone https://github.com/isl-org/open3d-cmake-find-package.git - cd open3d-cmake-find-package + pushd ../examples/cmake/open3d-cmake-find-package mkdir build - cd build + pushd build echo Testing build with cmake cmake -DCMAKE_INSTALL_PREFIX=${OPEN3D_INSTALL_DIR} .. make -j"$NPROC" VERBOSE=1 @@ -338,18 +330,19 @@ test_cpp_example() { ./Draw --skip-for-unit-test fi fi - # Now I am in Open3D/open3d-cmake-find-package/build/ - cd ../../build + popd + popd + # Now I am in Open3D/build/ } -# Install dependencies needed for building documentation (on Ubuntu 18.04) +# Install dependencies needed for building documentation (on Ubuntu 20.04) # Usage: install_docs_dependencies "${OPEN3D_ML_ROOT}" install_docs_dependencies() { echo echo Install ubuntu dependencies - echo Update cmake needed in Ubuntu 18.04 + echo Update cmake needed in Ubuntu 20.04 sudo apt-key adv --fetch-keys https://apt.kitware.com/keys/kitware-archive-latest.asc - sudo apt-add-repository --yes 'deb https://apt.kitware.com/ubuntu/ bionic main' + sudo apt-add-repository --yes 'deb https://apt.kitware.com/ubuntu/ focal main' ./util/install_deps_ubuntu.sh assume-yes sudo apt-get install --yes cmake sudo apt-get install --yes libxml2-dev libxslt-dev python3-dev @@ -371,8 +364,7 @@ install_docs_dependencies() { echo Installing Open3D-ML dependencies from "${OPEN3D_ML_ROOT}" python -m pip install -r "${OPEN3D_ML_ROOT}/requirements.txt" python -m pip install -r "${OPEN3D_ML_ROOT}/requirements-torch.txt" - python -m pip install -r "${OPEN3D_ML_ROOT}/requirements-tensorflow.txt" || - python -m pip install tensorflow # FIXME: Remove after Open3D-ML update + python -m pip install -r "${OPEN3D_ML_ROOT}/requirements-tensorflow.txt" else echo OPEN3D_ML_ROOT="$OPEN3D_ML_ROOT" not specified or invalid. Skipping ML dependencies. fi diff --git a/util/install_deps_ubuntu.sh b/util/install_deps_ubuntu.sh index a2a3ad6e4d3..2786b19c23b 100755 --- a/util/install_deps_ubuntu.sh +++ b/util/install_deps_ubuntu.sh @@ -11,6 +11,7 @@ else fi deps=( + git # Open3D xorg-dev libxcb-shm0 @@ -38,17 +39,22 @@ eval $( echo DISTRIB_ID="$DISTRIB_ID"; echo DISTRIB_RELEASE="$DISTRIB_RELEASE" ) -if [ "$DISTRIB_ID" == "Ubuntu" -a "$DISTRIB_RELEASE" == "18.04" ]; then - # Ubuntu 18.04's clang/libc++-dev/libc++abi-dev are version 6. - # To build Filament from source, we need version 7+. - deps=("${deps[@]/clang/clang-7}") - deps=("${deps[@]/libc++-dev/libc++-7-dev}") - deps=("${deps[@]/libc++abi-dev/libc++abi-7-dev}") +# To avoid dependence on libunwind, we don't want to use clang / libc++ versions later than 11. +# Ubuntu 20.04's has versions 8, 10 or 12 while Ubuntu 22.04 has versions 11 and later. +if [ "$DISTRIB_ID" == "Ubuntu" -a "$DISTRIB_RELEASE" == "20.04" ]; then + deps=("${deps[@]/clang/clang-10}") + deps=("${deps[@]/libc++-dev/libc++-10-dev}") + deps=("${deps[@]/libc++abi-dev/libc++abi-10-dev}") +fi +if [ "$DISTRIB_ID" == "Ubuntu" -a "$DISTRIB_RELEASE" == "22.04" ]; then + deps=("${deps[@]/clang/clang-11}") + deps=("${deps[@]/libc++-dev/libc++-11-dev}") + deps=("${deps[@]/libc++abi-dev/libc++abi-11-dev}") fi # Special case for ARM64 if [ "$(uname -m)" == "aarch64" ]; then - # For compling LAPACK in OpenBLAS + # For compiling LAPACK in OpenBLAS deps+=("gfortran") fi