diff options
author | Sameer Sheorey <41028320+ssheorey@users.noreply.github.com> | 2023-03-07 16:21:25 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-07 16:21:25 -0800 |
commit | 23400b820978e6b07f6060b26990960893dc7546 (patch) | |
tree | f187be03da0feeac88b0bb3c605fdead65926a53 | |
parent | 2264cdcc7086b57267666232040a0dcd93dc51f1 (diff) | |
download | Open3D-23400b820978e6b07f6060b26990960893dc7546.tar.gz Open3D-23400b820978e6b07f6060b26990960893dc7546.tar.bz2 Open3D-23400b820978e6b07f6060b26990960893dc7546.zip |
Minor pre v0.17 fixes (#5972)
* Fix examples display in docs.
* Easier install command for devel Open3D
* Remove space after open3d.pc -isystem for AppleClang compatibility.
* Install GUI resources with libOpen3D
* Fix resources path for Windows
* Set camera with intrinsic, extrinsic matrix from draw()
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | cpp/open3d/CMakeLists.txt | 8 | ||||
-rw-r--r-- | cpp/open3d/visualization/gui/Application.cpp | 5 | ||||
-rw-r--r-- | docs/getting_started.in.rst | 16 | ||||
-rw-r--r-- | docs/make_docs.py | 2 | ||||
-rw-r--r-- | python/open3d/visualization/draw.py | 4 |
6 files changed, 26 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2659d7d2..2c37ce5f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -354,11 +354,15 @@ if(UNIX OR CYGWIN) set(Open3D_INSTALL_INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}") set(Open3D_INSTALL_BIN_DIR "${CMAKE_INSTALL_BINDIR}") set(Open3D_INSTALL_LIB_DIR "${CMAKE_INSTALL_LIBDIR}") + # Put resources in */share/ + set(Open3D_INSTALL_RESOURCE_DIR "${CMAKE_INSTALL_DATADIR}") set(Open3D_INSTALL_CMAKE_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") else() set(Open3D_INSTALL_INCLUDE_DIR include) set(Open3D_INSTALL_BIN_DIR bin) set(Open3D_INSTALL_LIB_DIR lib) + # Put resources in */bin, with executables / DLLs + set(Open3D_INSTALL_RESOURCE_DIR bin) set(Open3D_INSTALL_CMAKE_DIR CMake) endif() diff --git a/cpp/open3d/CMakeLists.txt b/cpp/open3d/CMakeLists.txt index 5b938fe5..6da3581e 100644 --- a/cpp/open3d/CMakeLists.txt +++ b/cpp/open3d/CMakeLists.txt @@ -173,6 +173,12 @@ install(FILES "${PROJECT_BINARY_DIR}/Open3DConfigVersion.cmake" DESTINATION "${Open3D_INSTALL_CMAKE_DIR}" COMPONENT dev) +# Install GUI resources +if (BUILD_GUI) + install(DIRECTORY ${GUI_RESOURCE_DIR} + DESTINATION "${Open3D_INSTALL_RESOURCE_DIR}") +endif() + if (BUILD_SHARED_LIBS AND UNIX) file(CONFIGURE OUTPUT Open3D.pc.in CONTENT [=[ @@ -184,7 +190,7 @@ Name: Open3D Description: @PROJECT_DESCRIPTION@ URL: @PROJECT_HOMEPAGE_URL@ Version: @PROJECT_VERSION@ -Cflags: -std=c++@CMAKE_CXX_STANDARD@ -isystem ${includedir} -isystem ${includedir}/open3d/3rdparty -D$<JOIN:$<TARGET_PROPERTY:INTERFACE_COMPILE_DEFINITIONS>, -D> +Cflags: -std=c++@CMAKE_CXX_STANDARD@ -isystem${includedir} -isystem${includedir}/open3d/3rdparty -D$<JOIN:$<TARGET_PROPERTY:INTERFACE_COMPILE_DEFINITIONS>, -D> Libs: -L${libdir} -Wl,-rpath,${libdir} -lOpen3D]=] @ONLY NEWLINE_STYLE LF) file(GENERATE OUTPUT Open3D.pc INPUT "${CMAKE_CURRENT_BINARY_DIR}/Open3D.pc.in" TARGET "Open3D::Open3D") diff --git a/cpp/open3d/visualization/gui/Application.cpp b/cpp/open3d/visualization/gui/Application.cpp index 956999a5..94fc0e00 100644 --- a/cpp/open3d/visualization/gui/Application.cpp +++ b/cpp/open3d/visualization/gui/Application.cpp @@ -87,7 +87,10 @@ std::string FindResourcePath(int argc, const char *argv[]) { auto resource_path = path + "/resources"; if (!open3d::utility::filesystem::DirectoryExists(resource_path)) { - return path + "/../resources"; // building with Xcode + resource_path = path + "/../resources"; // building with Xcode + if (!open3d::utility::filesystem::DirectoryExists(resource_path)) { + resource_path = path + "/share/resources"; // GNU + } } return resource_path; } diff --git a/docs/getting_started.in.rst b/docs/getting_started.in.rst index 347f97f7..e3ff7529 100644 --- a/docs/getting_started.in.rst +++ b/docs/getting_started.in.rst @@ -49,9 +49,8 @@ Pip (PyPI) In general, we recommend using a `virtual environment <https://docs.python-guide.org/dev/virtualenvs/>`_ or `conda environment <https://docs.conda.io/en/latest/miniconda.html>`_. - Otherwise, depending on the configurations, ``pip3`` may be needed for - Python 3, or the ``--user`` option may need to be used to avoid permission - issues. For example: + Otherwise, depending on the configurations, you may need ``pip3`` for + Python 3, or the ``--user`` option to avoid permission issues. For example: .. code-block:: bash @@ -96,13 +95,12 @@ version (``HEAD`` of ``master`` branch): - `Python 3.10 <https://storage.googleapis.com/open3d-releases-master/python-wheels/open3d-@OPEN3D_VERSION_FULL@-cp310-cp310-win_amd64.whl>`__ Please use these links from the `latest version of this page -<http://www.open3d.org/docs/latest/getting_started.html>`__ only. For example, -to install the latest development version on Linux for Python 3.9: +<http://www.open3d.org/docs/latest/getting_started.html>`__ only. You can also +install the latest development version directly with pip: .. code-block:: bash - pip install --user --pre \ - https://storage.googleapis.com/open3d-releases-master/python-wheels/open3d-@OPEN3D_VERSION_FULL@-cp39-cp39-linux_x86_64.whl + pip install --trusted-host www.open3d.org -f http://www.open3d.org/docs/latest/getting_started.html open3d .. note:: The development wheels for Linux are named according to PEP600. Please @@ -194,8 +192,8 @@ provided here [#]_: Linux versions (e.g. if the OS came with GCC versions 5+) use the CXX11 ABI, while PyTorch and Tensorflow libraries typically use the pre CXX11 ABI. -If you need only a subset of features, or a custom build configuration, please -refer to :ref:`compilation` and compile Open3D from source. +If you need a subset of features, or a custom build configuration, please refer +to :ref:`compilation` and compile Open3D from source. Try it ------ diff --git a/docs/make_docs.py b/docs/make_docs.py index 7a3b77de..64880410 100644 --- a/docs/make_docs.py +++ b/docs/make_docs.py @@ -312,8 +312,6 @@ class PyExampleDocsBuilder: f"\n.. literalinclude:: {example.stem}.py" f"\n :language: python" f"\n :linenos:" - f"\n :lineno-start: 27" - f"\n :lines: 27-" f"\n\n\n") with open(output_path / "index.rst", "a") as f: diff --git a/python/open3d/visualization/draw.py b/python/open3d/visualization/draw.py index cf1c821b..70c5eb06 100644 --- a/python/open3d/visualization/draw.py +++ b/python/open3d/visualization/draw.py @@ -18,6 +18,8 @@ def draw(geometry=None, eye=None, up=None, field_of_view=60.0, + intrinsic_matrix=None, + extrinsic_matrix=None, bg_color=(1.0, 1.0, 1.0, 1.0), bg_image=None, ibl=None, @@ -65,6 +67,8 @@ def draw(geometry=None, w.reset_camera_to_default() # make sure far/near get setup nicely if lookat is not None and eye is not None and up is not None: w.setup_camera(field_of_view, lookat, eye, up) + elif intrinsic_matrix is not None and extrinsic_matrix is not None: + w.setup_camera(intrinsic_matrix, extrinsic_matrix, width, height) w.animation_time_step = animation_time_step if animation_duration is not None: |