diff --git a/3rdparty/fmt/fmt.cmake b/3rdparty/fmt/fmt.cmake index f53e2f49214..88cd8e2fcef 100644 --- a/3rdparty/fmt/fmt.cmake +++ b/3rdparty/fmt/fmt.cmake @@ -2,9 +2,8 @@ include(ExternalProject) set(FMT_LIB_NAME fmt) -if (MSVC AND MSVC_VERSION VERSION_LESS 1930 OR - CMAKE_CXX_COMPILER_ID MATCHES "IntelLLVM") - # MSVC 17.x required for building fmt >6 +if (MSVC OR CMAKE_CXX_COMPILER_ID MATCHES "IntelLLVM") + # MSVC has errors when building fmt >6, up till 9.1 # SYCL / DPC++ needs fmt ver <=6 or >= 9.2: https://github.com/fmtlib/fmt/issues/3005 set(FMT_VER "6.0.0") set(FMT_SHA256 diff --git a/3rdparty/possionrecon/possionrecon.cmake b/3rdparty/possionrecon/possionrecon.cmake index 0328804d0ce..ef5f87f940c 100644 --- a/3rdparty/possionrecon/possionrecon.cmake +++ b/3rdparty/possionrecon/possionrecon.cmake @@ -3,8 +3,8 @@ include(ExternalProject) ExternalProject_Add( ext_poisson PREFIX poisson - URL https://github.com/isl-org/Open3D-PoissonRecon/archive/fd273ea8c77a36973d6565a495c9969ccfb12d3b.tar.gz - URL_HASH SHA256=917d98e037982d57a159fa166b259ff3dc90ffffe09c6a562a71b400f6869ddf + URL https://github.com/isl-org/Open3D-PoissonRecon/archive/90f3f064e275b275cff445881ecee5a7c495c9e0.tar.gz + URL_HASH SHA256=1310df0c80ff0616b8fcf9b2fb568aa9b2190d0e071b0ead47dba339c146b1d3 DOWNLOAD_DIR "${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/poisson" SOURCE_DIR "poisson/src/ext_poisson/PoissonRecon" # Add extra directory level for POISSON_INCLUDE_DIRS. UPDATE_COMMAND "" diff --git a/docs/conf.in.py b/docs/conf.in.py index 39fd31ad673..82a791e42b2 100644 --- a/docs/conf.in.py +++ b/docs/conf.in.py @@ -71,7 +71,7 @@ def get_git_short_hash(): 'm2r2', ] -if os.environ["skip_notebooks"] == "true": +if os.environ.get("skip_notebooks", "false") == "true": print("Skipping Jupyter notebooks") extensions = [e for e in extensions if e != "nbsphinx"] @@ -94,7 +94,7 @@ def get_git_short_hash(): # General information about the project. project = u"Open3D" -copyright = u"2018 - 2021, www.open3d.org" +copyright = u"2018 - 2023, www.open3d.org" author = u"www.open3d.org" # The version info for the project you're documenting, acts as replacement for diff --git a/docs/tutorial/visualization/non_blocking_visualization.rst b/docs/tutorial/visualization/non_blocking_visualization.rst index 2a3397f1578..c76a020abd8 100644 --- a/docs/tutorial/visualization/non_blocking_visualization.rst +++ b/docs/tutorial/visualization/non_blocking_visualization.rst @@ -39,8 +39,6 @@ The full script implementing this idea is displayed below. .. literalinclude:: ../../../examples/python/visualization/non_blocking_visualization.py :language: python - :lineno-start: 27 - :lines: 27- :linenos: The following sections explain this script. @@ -50,8 +48,8 @@ Prepare example data .. literalinclude:: ../../../examples/python/visualization/non_blocking_visualization.py :language: python - :lineno-start: 35 - :lines: 35-46 + :lineno-start: 14 + :lines: 14-27 :linenos: This part reads two point clouds and downsamples them. The source point cloud is intentionally transformed for the misalignment. Both point clouds are flipped for better visualization. @@ -61,8 +59,8 @@ Initialize Visualizer class .. literalinclude:: ../../../examples/python/visualization/non_blocking_visualization.py :language: python - :lineno-start: 47 - :lines: 47-59 + :lineno-start: 29 + :lines: 29-35 :linenos: These lines make an instance of the visualizer class, open a visualizer window, and add two geometries to the visualizer. @@ -72,8 +70,8 @@ Transform geometry and visualize it .. literalinclude:: ../../../examples/python/visualization/non_blocking_visualization.py :language: python - :lineno-start: 59 - :lines: 59-72 + :lineno-start: 37 + :lines: 37-49 :linenos: This script calls ``registration_icp`` for every iteration. Note that it explicitly forces only one ICP iteration via ``ICPConvergenceCriteria(max_iteration = 1)``. This is a trick to retrieve a slight pose update from a single ICP iteration. After ICP, source geometry is transformed accordingly. diff --git a/examples/python/reconstruction_system/run_system.py b/examples/python/reconstruction_system/run_system.py index 91fd073b3c4..dedfc5552d2 100644 --- a/examples/python/reconstruction_system/run_system.py +++ b/examples/python/reconstruction_system/run_system.py @@ -86,7 +86,7 @@ initialize_config(config) check_folder_structure(config['path_dataset']) else: - # load deafult dataset. + # load default dataset. config = dataset_loader(args.default_dataset) assert config is not None diff --git a/examples/python/t_reconstruction_system/dense_slam.py b/examples/python/t_reconstruction_system/dense_slam.py index a2e03795af2..e22d6eacfa8 100644 --- a/examples/python/t_reconstruction_system/dense_slam.py +++ b/examples/python/t_reconstruction_system/dense_slam.py @@ -16,7 +16,8 @@ import time from config import ConfigParser -from common import get_default_dataset, load_rgbd_file_names, save_poses, load_intrinsic, extract_trianglemesh, get_default_testdata, extract_rgbd_frames +from common import (get_default_dataset, load_rgbd_file_names, save_poses, + load_intrinsic, extract_trianglemesh, extract_rgbd_frames) def slam(depth_file_names, color_file_names, intrinsic, config): diff --git a/examples/python/visualization/draw.py b/examples/python/visualization/draw.py index 3c2de61889c..f354f55783e 100644 --- a/examples/python/visualization/draw.py +++ b/examples/python/visualization/draw.py @@ -319,6 +319,8 @@ def main(): multi_objects() actions() selections() + groups() + time_animation() if __name__ == "__main__": diff --git a/python/open3d/visualization/draw.py b/python/open3d/visualization/draw.py index 70c5eb06ba0..f7764b41400 100644 --- a/python/open3d/visualization/draw.py +++ b/python/open3d/visualization/draw.py @@ -36,6 +36,121 @@ def draw(geometry=None, on_animation_frame=None, on_animation_tick=None, non_blocking_and_return_uid=False): + """Draw 3D geometry types and 3D models. This is a high level interface to + :class:`open3d.visualization.O3DVisualizer`. + + The initial view may be specified either as a combination of (lookat, eye, + up, and field of view) or (intrinsic matrix, extrinsic matrix) pair. A + simple pinhole camera model is used. + + Args: + geometry (List[Geometry] or List[Dict]): The 3D data to be displayed can be provided in different types: + - A list of any Open3D geometry types (``PointCloud``, ``TriangleMesh``, ``LineSet`` or ``TriangleMeshModel``). + - A list of dictionaries with geometry data and additional metadata. The following keys are used: + - **name** (str): Geometry name. + - **geometry** (Geometry): Open3D geometry to be drawn. + - **material** (:class:`open3d.visualization.rendering.MaterialRecord`): PBR material for the geometry. + - **group** (str): Assign the geometry to a group. Groups are shown in the settings panel and users can take take joint actions on a group as a whole. + - **time** (float): If geometry elements are assigned times, a time bar is displayed and the elements can be animated. + - **is_visible** (bool): Show this geometry? + title (str): Window title. + width (int): Viewport width. + height (int): Viewport height. + actions (List[(str, Callable)]): A list of pairs of action names and the + corresponding functions to execute. These actions are presented as + buttons in the settings panel. Each callable receives the window + (``O3DVisualizer``) as an argument. + lookat (array of shape (3,)): Camera principal axis direction. + eye (array of shape (3,)): Camera location. + up (array of shape (3,)): Camera up direction. + field_of_view (float): Camera horizontal field of view (degrees). + intrinsic_matrix (array of shape (3,3)): Camera intrinsic matrix. + extrinsic_matrix (array of shape (4,4)): Camera extrinsic matrix (world + to camera transformation). + bg_color (array of shape (4,)): Background color float with range [0,1], + default white. + bg_image (open3d.geometry.Image): Background image. + ibl (open3d.geometry.Image): Environment map for image based lighting + (IBL). + ibl_intensity (float): IBL intensity. + show_skybox (bool): Show skybox as scene background (default False). + show_ui (bool): Show settings user interface (default False). This can + be toggled from the Actions menu. + raw_mode (bool): Use raw mode for simpler rendering of the basic + geometry (Default false). + point_size (int): 3D point size (default 3). + line_width (int): 3D line width (default 1). + 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`. + on_init (Callable): Extra initialization procedure for the underlying + GUI window. The procedure receives a single argument of type + :class:`open3d.visualization.O3DVisualizer`. + on_animation_frame (Callable): Callback for each animation frame update + with signature:: + + Callback(O3DVisualizer, double time) -> None + + on_animation_tick (Callable): Callback for each animation time step with + signature:: + + Callback(O3DVisualizer, double tick_duration, double time) -> TickResult + + If the callback returns ``TickResult.REDRAW``, the scene is redrawn. + It should return ``TickResult.NOCHANGE`` if redraw is not required. + non_blocking_and_return_uid (bool): Do not block waiting for the user + to close the window. Instead return the window ID. This is useful + for embedding the visualizer and is used in the WebRTC interface and + Tensorboard plugin. + + Example: + See `examples/visualization/draw.py` for examples of advanced usage. The ``actions()`` + example from that file is shown below:: + + import open3d as o3d + import open3d.visualization as vis + + SOURCE_NAME = "Source" + RESULT_NAME = "Result (Poisson reconstruction)" + TRUTH_NAME = "Ground truth" + + bunny = o3d.data.BunnyMesh() + bunny_mesh = o3d.io.read_triangle_mesh(bunny.path) + bunny_mesh.compute_vertex_normals() + + bunny_mesh.paint_uniform_color((1, 0.75, 0)) + bunny_mesh.compute_vertex_normals() + cloud = o3d.geometry.PointCloud() + cloud.points = bunny_mesh.vertices + cloud.normals = bunny_mesh.vertex_normals + + def make_mesh(o3dvis): + mesh, _ = o3d.geometry.TriangleMesh.create_from_point_cloud_poisson( + cloud) + mesh.paint_uniform_color((1, 1, 1)) + mesh.compute_vertex_normals() + o3dvis.add_geometry({"name": RESULT_NAME, "geometry": mesh}) + o3dvis.show_geometry(SOURCE_NAME, False) + + def toggle_result(o3dvis): + truth_vis = o3dvis.get_geometry(TRUTH_NAME).is_visible + o3dvis.show_geometry(TRUTH_NAME, not truth_vis) + o3dvis.show_geometry(RESULT_NAME, truth_vis) + + vis.draw([{ + "name": SOURCE_NAME, + "geometry": cloud + }, { + "name": TRUTH_NAME, + "geometry": bunny_mesh, + "is_visible": False + }], + actions=[("Create Mesh", make_mesh), + ("Toggle truth/result", toggle_result)]) + """ gui.Application.instance.initialize() w = O3DVisualizer(title, width, height) w.set_background(bg_color, bg_image) diff --git a/python/setup.py b/python/setup.py index d2fea21ef7e..5322d230915 100644 --- a/python/setup.py +++ b/python/setup.py @@ -178,6 +178,9 @@ def finalize_options(self): description="@PROJECT_DESCRIPTION@", long_description=long_description, long_description_content_type="text/x-rst", + # Metadata below is valid but currently ignored by pip (<=v23) + obsoletes=["open3d_python"], + provides=["open3d", "open3d_cpu"], # For open3d-cpu ) setup(**setup_args)