Skip to content

Commit

Permalink
Merge branch 'main' into typing-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
timohl committed Aug 14, 2024
2 parents abd291e + 48ccf2a commit 162f5b1
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 39 deletions.
4 changes: 2 additions & 2 deletions 3rdparty/embree/embree.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ 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
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
- Fix build with fmt v10.2.0 (#6783)
- Fix segmentation fault (lambda reference capture) of VisualizerWithCustomAnimation::Play (PR #6804)
- 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)
- Split pybind declarations/definitions to avoid C++ types in Python docs (PR #6869)

Expand Down
26 changes: 1 addition & 25 deletions cpp/open3d/t/geometry/RaycastingScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1180,31 +1180,7 @@ template <>
struct formatter<RTCError> {
template <typename FormatContext>
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<string_view>::format(name, ctx);
const char* name = rtcGetErrorString(c);
return format_to(ctx.out(), name);
}

Expand Down
21 changes: 10 additions & 11 deletions cpp/pybind/visualization/rendering/rendering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,9 @@ void pybind_rendering_definitions(py::module &m) {
"parameter is optional and is True if the image is in the "
"sRGB colorspace and False otherwise")
.def("update_texture",
(bool (Renderer::*)(TextureHandle,
const std::shared_ptr<geometry::Image>,
bool)) &
(bool(Renderer::*)(TextureHandle,
const std::shared_ptr<geometry::Image>,
bool)) &
Renderer::UpdateTexture,
"texture"_a, "image"_a, "is_sRGB"_a = false,
"Updates the contents of the texture to be the new image, or "
Expand Down Expand Up @@ -316,21 +316,20 @@ void pybind_rendering_definitions(py::module &m) {
auto cam = static_cast<py::class_<Camera, std::shared_ptr<Camera>>>(
m_rendering.attr("Camera"));
cam.def("set_projection",
(void (Camera::*)(double, double, double, double,
Camera::FovType)) &
(void(Camera::*)(double, double, double, double, Camera::FovType)) &
Camera::SetProjection,
"field_of_view"_a, "aspect_ratio"_a, "near_plane"_a, "far_plane"_a,
"field_of_view_type"_a, "Sets a perspective projection.")
.def("set_projection",
(void (Camera::*)(Camera::Projection, double, double, double,
double, double, double)) &
(void(Camera::*)(Camera::Projection, double, double, double,
double, double, double)) &
Camera::SetProjection,
"projection_type"_a, "left"_a, "right"_a, "bottom"_a, "top"_a,
"near"_a, "far"_a,
"Sets the camera projection via a viewing frustum. ")
.def("set_projection",
(void (Camera::*)(const Eigen::Matrix3d &, double, double,
double, double)) &
(void(Camera::*)(const Eigen::Matrix3d &, double, double,
double, double)) &
Camera::SetProjection,
"intrinsics"_a, "near_plane"_a, "far_plane"_a, "image_width"_a,
"image_height"_a,
Expand Down Expand Up @@ -538,15 +537,15 @@ void pybind_rendering_definitions(py::module &m) {
"Sets the camera with the given name as the active camera for "
"the scene")
.def("add_geometry",
(bool (Scene::*)(
(bool(Scene::*)(
const std::string &, const geometry::Geometry3D &,
const MaterialRecord &, const std::string &, size_t)) &
Scene::AddGeometry,
"name"_a, "geometry"_a, "material"_a,
"downsampled_name"_a = "", "downsample_threshold"_a = SIZE_MAX,
"Adds a Geometry with a material to the scene")
.def("add_geometry",
(bool (Scene::*)(
(bool(Scene::*)(
const std::string &, const t::geometry::Geometry &,
const MaterialRecord &, const std::string &, size_t)) &
Scene::AddGeometry,
Expand Down
19 changes: 19 additions & 0 deletions docs/builddocs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <path/to/venv/site-packages/> --root-suffix "" open3d
1 change: 1 addition & 0 deletions examples/python/benchmark/benchmark_fgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
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)
Expand Down
1 change: 1 addition & 0 deletions examples/python/benchmark/benchmark_pre.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
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)
Expand Down
1 change: 1 addition & 0 deletions examples/python/benchmark/benchmark_ransac.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
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)
Expand Down
2 changes: 1 addition & 1 deletion examples/python/benchmark/benchmark_tsdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
# 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)
Expand Down

0 comments on commit 162f5b1

Please sign in to comment.