Skip to content

Commit 162f5b1

Browse files
committed
Merge branch 'main' into typing-fixes
2 parents abd291e + 48ccf2a commit 162f5b1

File tree

9 files changed

+37
-39
lines changed

9 files changed

+37
-39
lines changed

3rdparty/embree/embree.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ endif()
6767
ExternalProject_Add(
6868
ext_embree
6969
PREFIX embree
70-
URL https://github.com/embree/embree/archive/refs/tags/v4.3.1.tar.gz
71-
URL_HASH SHA256=824edcbb7a8cd393c5bdb7a16738487b21ecc4e1d004ac9f761e934f97bb02a4
70+
URL https://github.com/embree/embree/archive/refs/tags/v4.3.3.tar.gz
71+
URL_HASH SHA256=8a3bc3c3e21aa209d9861a28f8ba93b2f82ed0dc93341dddac09f1f03c36ef2d
7272
DOWNLOAD_DIR "${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/embree"
7373
UPDATE_COMMAND ""
7474
CMAKE_ARGS

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
- Fix build with fmt v10.2.0 (#6783)
4141
- Fix segmentation fault (lambda reference capture) of VisualizerWithCustomAnimation::Play (PR #6804)
4242
- Add O3DVisualizer API to enable collapse control of verts in the side panel (PR #6865)
43+
- Split pybind declarations/definitions to avoid C++ types in Python docs (PR #6869)
4344
- Fix minimal oriented bounding box of MeshBase derived classes and add new unit tests (PR #6898)
4445
- Split pybind declarations/definitions to avoid C++ types in Python docs (PR #6869)
4546

cpp/open3d/t/geometry/RaycastingScene.cpp

+1-25
Original file line numberDiff line numberDiff line change
@@ -1180,31 +1180,7 @@ template <>
11801180
struct formatter<RTCError> {
11811181
template <typename FormatContext>
11821182
auto format(const RTCError& c, FormatContext& ctx) {
1183-
const char* name = nullptr;
1184-
switch (c) {
1185-
case RTC_ERROR_NONE:
1186-
name = "RTC_ERROR_NONE";
1187-
break;
1188-
case RTC_ERROR_UNKNOWN:
1189-
name = "RTC_ERROR_UNKNOWN";
1190-
break;
1191-
case RTC_ERROR_INVALID_ARGUMENT:
1192-
name = "RTC_ERROR_INVALID_ARGUMENT";
1193-
break;
1194-
case RTC_ERROR_INVALID_OPERATION:
1195-
name = "RTC_ERROR_INVALID_OPERATION";
1196-
break;
1197-
case RTC_ERROR_OUT_OF_MEMORY:
1198-
name = "RTC_ERROR_OUT_OF_MEMORY";
1199-
break;
1200-
case RTC_ERROR_UNSUPPORTED_CPU:
1201-
name = "RTC_ERROR_UNSUPPORTED_CPU";
1202-
break;
1203-
case RTC_ERROR_CANCELLED:
1204-
name = "RTC_ERROR_CANCELLED";
1205-
break;
1206-
}
1207-
// return formatter<string_view>::format(name, ctx);
1183+
const char* name = rtcGetErrorString(c);
12081184
return format_to(ctx.out(), name);
12091185
}
12101186

cpp/pybind/visualization/rendering/rendering.cpp

+10-11
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,9 @@ void pybind_rendering_definitions(py::module &m) {
242242
"parameter is optional and is True if the image is in the "
243243
"sRGB colorspace and False otherwise")
244244
.def("update_texture",
245-
(bool (Renderer::*)(TextureHandle,
246-
const std::shared_ptr<geometry::Image>,
247-
bool)) &
245+
(bool(Renderer::*)(TextureHandle,
246+
const std::shared_ptr<geometry::Image>,
247+
bool)) &
248248
Renderer::UpdateTexture,
249249
"texture"_a, "image"_a, "is_sRGB"_a = false,
250250
"Updates the contents of the texture to be the new image, or "
@@ -316,21 +316,20 @@ void pybind_rendering_definitions(py::module &m) {
316316
auto cam = static_cast<py::class_<Camera, std::shared_ptr<Camera>>>(
317317
m_rendering.attr("Camera"));
318318
cam.def("set_projection",
319-
(void (Camera::*)(double, double, double, double,
320-
Camera::FovType)) &
319+
(void(Camera::*)(double, double, double, double, Camera::FovType)) &
321320
Camera::SetProjection,
322321
"field_of_view"_a, "aspect_ratio"_a, "near_plane"_a, "far_plane"_a,
323322
"field_of_view_type"_a, "Sets a perspective projection.")
324323
.def("set_projection",
325-
(void (Camera::*)(Camera::Projection, double, double, double,
326-
double, double, double)) &
324+
(void(Camera::*)(Camera::Projection, double, double, double,
325+
double, double, double)) &
327326
Camera::SetProjection,
328327
"projection_type"_a, "left"_a, "right"_a, "bottom"_a, "top"_a,
329328
"near"_a, "far"_a,
330329
"Sets the camera projection via a viewing frustum. ")
331330
.def("set_projection",
332-
(void (Camera::*)(const Eigen::Matrix3d &, double, double,
333-
double, double)) &
331+
(void(Camera::*)(const Eigen::Matrix3d &, double, double,
332+
double, double)) &
334333
Camera::SetProjection,
335334
"intrinsics"_a, "near_plane"_a, "far_plane"_a, "image_width"_a,
336335
"image_height"_a,
@@ -538,15 +537,15 @@ void pybind_rendering_definitions(py::module &m) {
538537
"Sets the camera with the given name as the active camera for "
539538
"the scene")
540539
.def("add_geometry",
541-
(bool (Scene::*)(
540+
(bool(Scene::*)(
542541
const std::string &, const geometry::Geometry3D &,
543542
const MaterialRecord &, const std::string &, size_t)) &
544543
Scene::AddGeometry,
545544
"name"_a, "geometry"_a, "material"_a,
546545
"downsampled_name"_a = "", "downsample_threshold"_a = SIZE_MAX,
547546
"Adds a Geometry with a material to the scene")
548547
.def("add_geometry",
549-
(bool (Scene::*)(
548+
(bool(Scene::*)(
550549
const std::string &, const t::geometry::Geometry &,
551550
const MaterialRecord &, const std::string &, size_t)) &
552551
Scene::AddGeometry,

docs/builddocs.rst

+19
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,22 @@ Open ``docs/_out/html/index.html`` in a web browser to preview the docs.
9797
.. code-block:: bash
9898
9999
google-chrome docs/_out/html/index.html
100+
101+
102+
Create Python stubs (type hints) for type checking and autocomplete
103+
-------------------------------------------------------------------
104+
105+
You can get type checking and auto-complete features in editors and IDES (e.g.
106+
VS Code, PyCharm, etc.) using type hints produced from Open3D. These can be
107+
created with the pybind11-stubgen tool and placed alongside the Open3D files:
108+
109+
.. code-block:: bash
110+
111+
# Install open3d and pybind11-stubgen
112+
pip install pybind11-stubgen open3d
113+
# Print location of install open3d library
114+
pip show open3d
115+
# This outputs a line like:
116+
# Location: path/to/venv/site-packages
117+
# Create stubs and place them next to Open3D files
118+
pybind11-stubgen -o <path/to/venv/site-packages/> --root-suffix "" open3d

examples/python/benchmark/benchmark_fgr.py

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import os
99
import sys
1010
import numpy as np
11+
import open3d as o3d
1112

1213
pyexample_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
1314
sys.path.append(pyexample_path)

examples/python/benchmark/benchmark_pre.py

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import os
99
import sys
1010
import pickle
11+
import open3d as o3d
1112

1213
pyexample_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
1314
sys.path.append(pyexample_path)

examples/python/benchmark/benchmark_ransac.py

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import os
99
import sys
1010
import numpy as np
11+
import open3d as o3d
1112

1213
pyexample_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
1314
sys.path.append(pyexample_path)

examples/python/benchmark/benchmark_tsdf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
# SPDX-License-Identifier: MIT
66
# ----------------------------------------------------------------------------
77

8-
import open3d as o3d
98
import numpy as np
109
import time
1110
import os
1211
import sys
12+
import open3d as o3d
1313

1414
pyexample_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
1515
sys.path.append(pyexample_path)

0 commit comments

Comments
 (0)