From f5dfd54b75bc08ea8fbdbb0873492e4d2af50296 Mon Sep 17 00:00:00 2001 From: Liangliang Nan Date: Sat, 11 Jan 2025 12:38:21 +0100 Subject: [PATCH] hint about path --- python/README.md | 4 ++-- python/tutorials/tutorial_101_data_types.py | 2 +- python/tutorials/tutorial_102_point_cloud.py | 2 +- python/tutorials/tutorial_103_surface_mesh.py | 2 +- python/tutorials/tutorial_104_properties.py | 11 +++++++---- python/tutorials/tutorial_201_viewer.py | 2 +- python/tutorials/tutorial_202_multiviewer.py | 2 +- python/tutorials/tutorial_203_drawables.py | 2 +- python/tutorials/tutorial_204_imposters.py | 2 +- python/tutorials/tutorial_205_offscreen.py | 2 +- python/tutorials/tutorial_206_text_mesher.py | 11 +++++++---- python/tutorials/tutorial_207_scalar_field.py | 11 +++++++---- ...torial_208_interactive_function_execution.py | 11 +++++++---- .../tutorials/tutorial_301_normal_estimation.py | 10 ++++++---- .../tutorial_302_surface_reconstruction.py | 13 ++++++------- .../tutorials/tutorial_303_plane_extraction.py | 17 ++++++----------- .../tutorial_304_point_cloud_downsampling.py | 11 +++++++---- python/tutorials/tutorial_401_mesh_sampler.py | 11 +++++++---- .../tutorials/tutorial_402_mesh_hole_filling.py | 9 +++++++-- .../tutorial_403_mesh_simplification.py | 11 +++++++---- .../tutorials/tutorial_404_mesh_subdivision.py | 12 +++++++----- .../tutorial_405_mesh_parameterization.py | 14 +++++++------- 22 files changed, 98 insertions(+), 74 deletions(-) diff --git a/python/README.md b/python/README.md index e339d7f2..16277c46 100644 --- a/python/README.md +++ b/python/README.md @@ -36,7 +36,7 @@ file for the bindings and install it globally. This will make Easy3D work like o Below are the detailed steps for creating the wheel file and installation. -- Step 1: Install the build Tool (if not exist) +- Step 1: Install the build Tool (only if not installed) - `pip install build` @@ -48,7 +48,7 @@ Below are the detailed steps for creating the wheel file and installation. - Step 3: Install the Wheel - - `pip install dist/easy3d-2.6.0-py3-none-any.whl` + - `pip install dist/easy3d-2.6.0-py3-none-any.whl` # Update the wheel file name accordingly You can verify the installation by running the following command: diff --git a/python/tutorials/tutorial_101_data_types.py b/python/tutorials/tutorial_101_data_types.py index d9ae8a82..8477e6ca 100644 --- a/python/tutorials/tutorial_101_data_types.py +++ b/python/tutorials/tutorial_101_data_types.py @@ -14,7 +14,7 @@ # ------------------------------------------------------------------------------- # This is required if the bindings are not installed via `pip` but are located in # a local build directory. For building and installing Python bindings of Easy3D, -# please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/ReadMe.md +# please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/README.md # ------------------------------------------------------------------------------- import sys sys.path.append("../../cmake-build-release/lib/python") # Update this path to point to your Easy3D build directory. diff --git a/python/tutorials/tutorial_102_point_cloud.py b/python/tutorials/tutorial_102_point_cloud.py index 99671efa..680bb9dc 100644 --- a/python/tutorials/tutorial_102_point_cloud.py +++ b/python/tutorials/tutorial_102_point_cloud.py @@ -13,7 +13,7 @@ # ------------------------------------------------------------------------------- # This is required if the bindings are not installed via `pip` but are located in # a local build directory. For building and installing Python bindings of Easy3D, -# please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/ReadMe.md +# please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/README.md # ------------------------------------------------------------------------------- import sys sys.path.append("../../cmake-build-release/lib/python") # Update this path to point to your Easy3D build directory. diff --git a/python/tutorials/tutorial_103_surface_mesh.py b/python/tutorials/tutorial_103_surface_mesh.py index 920a196d..87241b84 100644 --- a/python/tutorials/tutorial_103_surface_mesh.py +++ b/python/tutorials/tutorial_103_surface_mesh.py @@ -20,7 +20,7 @@ # ------------------------------------------------------------------------------- # This is required if the bindings are not installed via `pip` but are located in # a local build directory. For building and installing Python bindings of Easy3D, -# please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/ReadMe.md +# please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/README.md # ------------------------------------------------------------------------------- import sys sys.path.append("../../cmake-build-release/lib/python") # Update this path to point to your Easy3D build directory. diff --git a/python/tutorials/tutorial_104_properties.py b/python/tutorials/tutorial_104_properties.py index 874051f9..64571230 100644 --- a/python/tutorials/tutorial_104_properties.py +++ b/python/tutorials/tutorial_104_properties.py @@ -8,10 +8,13 @@ # The same principles apply to PointCloud as well. # ----------------------------------------------------------------------------- -# If Easy3D was built locally, add its Python bindings to the system path. -# This step is not required if Easy3D is installed globally via `pip`. -# For detailed instructions on building and installing Easy3D, refer to: -# https://github.com/LiangliangNan/Easy3D/blob/main/ReadMe.md +# ------------------------------------------------------------------------------- +# Adding Easy3D Python Bindings to the System Path +# ------------------------------------------------------------------------------- +# This is required if the bindings are not installed via `pip` but are located in +# a local build directory. For building and installing Python bindings of Easy3D, +# please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/README.md +# ------------------------------------------------------------------------------- import sys sys.path.append("../../cmake-build-release/lib/python") # Update this path to point to your Easy3D build directory. diff --git a/python/tutorials/tutorial_201_viewer.py b/python/tutorials/tutorial_201_viewer.py index 614e725e..9038bfc2 100644 --- a/python/tutorials/tutorial_201_viewer.py +++ b/python/tutorials/tutorial_201_viewer.py @@ -13,7 +13,7 @@ # ------------------------------------------------------------------------------- # This is required if the bindings are not installed via `pip` but are located in # a local build directory. For building and installing Python bindings of Easy3D, -# please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/ReadMe.md +# please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/README.md # ------------------------------------------------------------------------------- import sys sys.path.append("../../cmake-build-release/lib/python") # Update this path to point to your Easy3D build directory. diff --git a/python/tutorials/tutorial_202_multiviewer.py b/python/tutorials/tutorial_202_multiviewer.py index 0b5453e0..e50143cf 100644 --- a/python/tutorials/tutorial_202_multiviewer.py +++ b/python/tutorials/tutorial_202_multiviewer.py @@ -14,7 +14,7 @@ # ------------------------------------------------------------------------------- # This is required if the bindings are not installed via `pip` but are located in # a local build directory. For building and installing Python bindings of Easy3D, -# please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/ReadMe.md +# please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/README.md # ------------------------------------------------------------------------------- import sys sys.path.append("../../cmake-build-release/lib/python") # Update this path to point to your Easy3D build directory. diff --git a/python/tutorials/tutorial_203_drawables.py b/python/tutorials/tutorial_203_drawables.py index a4c595f9..828154eb 100644 --- a/python/tutorials/tutorial_203_drawables.py +++ b/python/tutorials/tutorial_203_drawables.py @@ -16,7 +16,7 @@ # ------------------------------------------------------------------------------- # This is required if the bindings are not installed via `pip` but are located in # a local build directory. For building and installing Python bindings of Easy3D, -# please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/ReadMe.md +# please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/README.md # ------------------------------------------------------------------------------- import sys sys.path.append("../../cmake-build-release/lib/python") # Update this path to point to your Easy3D build directory. diff --git a/python/tutorials/tutorial_204_imposters.py b/python/tutorials/tutorial_204_imposters.py index 8b010a94..17425ec8 100644 --- a/python/tutorials/tutorial_204_imposters.py +++ b/python/tutorials/tutorial_204_imposters.py @@ -13,7 +13,7 @@ # ------------------------------------------------------------------------------- # This is required if the bindings are not installed via `pip` but are located in # a local build directory. For building and installing Python bindings of Easy3D, -# please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/ReadMe.md +# please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/README.md # ------------------------------------------------------------------------------- import sys sys.path.append("../../cmake-build-release/lib/python") # Update this path to point to your Easy3D build directory. diff --git a/python/tutorials/tutorial_205_offscreen.py b/python/tutorials/tutorial_205_offscreen.py index 46c92fc8..0685b8a3 100644 --- a/python/tutorials/tutorial_205_offscreen.py +++ b/python/tutorials/tutorial_205_offscreen.py @@ -11,7 +11,7 @@ # ------------------------------------------------------------------------------- # This is required if the bindings are not installed via `pip` but are located in # a local build directory. For building and installing Python bindings of Easy3D, -# please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/ReadMe.md +# please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/README.md # ------------------------------------------------------------------------------- import sys sys.path.append("../../cmake-build-release/lib/python") # Update this path to point to your Easy3D build directory. diff --git a/python/tutorials/tutorial_206_text_mesher.py b/python/tutorials/tutorial_206_text_mesher.py index 18514001..e099c60d 100644 --- a/python/tutorials/tutorial_206_text_mesher.py +++ b/python/tutorials/tutorial_206_text_mesher.py @@ -6,10 +6,13 @@ # 2. Visualize the generated 3D text meshes using the default Easy3D Viewer. # ----------------------------------------------------------------------------- -# If Easy3D was built locally, add its Python bindings to the system path. -# This is not required if Easy3D is installed globally via `pip'. -# For detailed instructions on building and installing Easy3D, refer to: -# https://github.com/LiangliangNan/Easy3D/blob/main/ReadMe.md +# ------------------------------------------------------------------------------- +# Adding Easy3D Python Bindings to the System Path +# ------------------------------------------------------------------------------- +# This is required if the bindings are not installed via `pip` but are located in +# a local build directory. For building and installing Python bindings of Easy3D, +# please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/README.md +# ------------------------------------------------------------------------------- import sys sys.path.append("../../cmake-build-release/lib/python") # Update this path to point to your Easy3D build directory. diff --git a/python/tutorials/tutorial_207_scalar_field.py b/python/tutorials/tutorial_207_scalar_field.py index 20d6d9d1..e220f526 100644 --- a/python/tutorials/tutorial_207_scalar_field.py +++ b/python/tutorials/tutorial_207_scalar_field.py @@ -9,10 +9,13 @@ # - Visualizing the scalar field by mapping scalar values to colors. # ----------------------------------------------------------------------------- -# If Easy3D was built locally, add its Python bindings to the system path. -# This step is not required if Easy3D is installed globally via `pip`. -# For detailed instructions on building and installing Easy3D, refer to: -# https://github.com/LiangliangNan/Easy3D/blob/main/ReadMe.md +# ------------------------------------------------------------------------------- +# Adding Easy3D Python Bindings to the System Path +# ------------------------------------------------------------------------------- +# This is required if the bindings are not installed via `pip` but are located in +# a local build directory. For building and installing Python bindings of Easy3D, +# please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/README.md +# ------------------------------------------------------------------------------- import sys sys.path.append("../../cmake-build-release/lib/python") # Update this path to point to your Easy3D build directory. diff --git a/python/tutorials/tutorial_208_interactive_function_execution.py b/python/tutorials/tutorial_208_interactive_function_execution.py index 7fd15ec0..ca5ffbce 100644 --- a/python/tutorials/tutorial_208_interactive_function_execution.py +++ b/python/tutorials/tutorial_208_interactive_function_execution.py @@ -7,10 +7,13 @@ # useful for demonstrating and testing 3D data processing algorithms. # ----------------------------------------------------------------------------- -# If Easy3D was built locally, add its Python bindings to the system path. -# This step is not required if Easy3D is installed globally via `pip`. -# For detailed instructions on building and installing Easy3D, refer to: -# https://github.com/LiangliangNan/Easy3D/blob/main/ReadMe.md +# ------------------------------------------------------------------------------- +# Adding Easy3D Python Bindings to the System Path +# ------------------------------------------------------------------------------- +# This is required if the bindings are not installed via `pip` but are located in +# a local build directory. For building and installing Python bindings of Easy3D, +# please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/README.md +# ------------------------------------------------------------------------------- import sys sys.path.append("../../cmake-build-release/lib/python") # Update this path to point to your Easy3D build directory. diff --git a/python/tutorials/tutorial_301_normal_estimation.py b/python/tutorials/tutorial_301_normal_estimation.py index cc7c8ae2..7badee36 100644 --- a/python/tutorials/tutorial_301_normal_estimation.py +++ b/python/tutorials/tutorial_301_normal_estimation.py @@ -10,14 +10,16 @@ # ------------------------------------------------------------------------------- # Adding Easy3D Python Bindings to the System Path # ------------------------------------------------------------------------------- -# If Easy3D was built locally, you need to add its Python bindings to the system path. -# This step is not required if Easy3D is installed globally via `pip`. -# For detailed instructions on building and installing Easy3D, refer to: -# https://github.com/LiangliangNan/Easy3D/blob/main/ReadMe.md +# This is required if the bindings are not installed via `pip` but are located in +# a local build directory. For building and installing Python bindings of Easy3D, +# please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/README.md # ------------------------------------------------------------------------------- import sys sys.path.append("../../cmake-build-release/lib/python") # Update this path to point to your Easy3D build directory. +import sys +sys.path.append("../../cmake-build-release/lib/python") # Update this path to point to your Easy3D build directory. + # Import the Easy3D library, which provides tools for 3D visualization and geometry processing. import easy3d diff --git a/python/tutorials/tutorial_302_surface_reconstruction.py b/python/tutorials/tutorial_302_surface_reconstruction.py index 899b8b6f..44688b42 100644 --- a/python/tutorials/tutorial_302_surface_reconstruction.py +++ b/python/tutorials/tutorial_302_surface_reconstruction.py @@ -14,14 +14,13 @@ # 5. Visualize the reconstructed surface mesh in an interactive viewer. # ----------------------------------------------------------------------------- -# ----------------------------------------------------------------------------- +# ------------------------------------------------------------------------------- # Adding Easy3D Python Bindings to the System Path -# ----------------------------------------------------------------------------- -# If the Easy3D Python bindings are located in a custom directory (e.g., from -# a local build), you'll need to add that directory to the system path to -# access them. You can skip this step if the bindings are installed globally -# via `pip'. For building and installing Python bindings of Easy3D, -# # please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/ReadMe.md +# ------------------------------------------------------------------------------- +# This is required if the bindings are not installed via `pip` but are located in +# a local build directory. For building and installing Python bindings of Easy3D, +# please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/README.md +# ------------------------------------------------------------------------------- import sys sys.path.append("../../cmake-build-release/lib/python") # Update this path to point to your Easy3D build directory. diff --git a/python/tutorials/tutorial_303_plane_extraction.py b/python/tutorials/tutorial_303_plane_extraction.py index 393b54de..0415d437 100644 --- a/python/tutorials/tutorial_303_plane_extraction.py +++ b/python/tutorials/tutorial_303_plane_extraction.py @@ -12,18 +12,13 @@ # 4. Visualize the extracted planar segments. # ----------------------------------------------------------------------------- -# ----------------------------------------------------------------------------- +# ------------------------------------------------------------------------------- # Adding Easy3D Python Bindings to the System Path -# ----------------------------------------------------------------------------- -# If the Easy3D Python bindings are located in a custom directory (e.g., from -# a local build), you'll need to add that directory to the system path to -# access them. You can skip this step if the bindings are installed globally -# via `pip`. -# -# Please refer to the official documentation for building and installing -# Easy3D Python bindings: -# https://github.com/LiangliangNan/Easy3D/blob/main/ReadMe.md - +# ------------------------------------------------------------------------------- +# This is required if the bindings are not installed via `pip` but are located in +# a local build directory. For building and installing Python bindings of Easy3D, +# please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/README.md +# ------------------------------------------------------------------------------- import sys sys.path.append("../../cmake-build-release/lib/python") # Update this path to point to your Easy3D build directory. diff --git a/python/tutorials/tutorial_304_point_cloud_downsampling.py b/python/tutorials/tutorial_304_point_cloud_downsampling.py index 85067410..98ce9d67 100644 --- a/python/tutorials/tutorial_304_point_cloud_downsampling.py +++ b/python/tutorials/tutorial_304_point_cloud_downsampling.py @@ -13,10 +13,13 @@ # using Easy3D's `MultiViewer`. # ----------------------------------------------------------------------------- -# If you built Easy3D locally, you'll need to add its Python bindings to the -# system path to access them. If Easy3D is globally installed via `pip`, this -# step is not necessary. For building and installing Python bindings of Easy3D, -# # please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/ReadMe.md +# ------------------------------------------------------------------------------- +# Adding Easy3D Python Bindings to the System Path +# ------------------------------------------------------------------------------- +# This is required if the bindings are not installed via `pip` but are located in +# a local build directory. For building and installing Python bindings of Easy3D, +# please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/README.md +# ------------------------------------------------------------------------------- import sys sys.path.append("../../cmake-build-release/lib/python") # Update this path to point to your Easy3D build directory. diff --git a/python/tutorials/tutorial_401_mesh_sampler.py b/python/tutorials/tutorial_401_mesh_sampler.py index 846d553a..b03dc62b 100644 --- a/python/tutorials/tutorial_401_mesh_sampler.py +++ b/python/tutorials/tutorial_401_mesh_sampler.py @@ -9,10 +9,13 @@ # surface of the mesh. # ----------------------------------------------------------------------------- -# If Easy3D is not installed via `pip` but built locally, add its Python bindings -# to the system path. For detailed instructions on building and installing -# Python bindings of Easy3D, visit: -# https://github.com/LiangliangNan/Easy3D/blob/main/ReadMe.md +# ------------------------------------------------------------------------------- +# Adding Easy3D Python Bindings to the System Path +# ------------------------------------------------------------------------------- +# This is required if the bindings are not installed via `pip` but are located in +# a local build directory. For building and installing Python bindings of Easy3D, +# please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/README.md +# ------------------------------------------------------------------------------- import sys sys.path.append("../../cmake-build-release/lib/python") # Update this path to point to your Easy3D build directory. diff --git a/python/tutorials/tutorial_402_mesh_hole_filling.py b/python/tutorials/tutorial_402_mesh_hole_filling.py index 930c61a7..1b074589 100644 --- a/python/tutorials/tutorial_402_mesh_hole_filling.py +++ b/python/tutorials/tutorial_402_mesh_hole_filling.py @@ -18,8 +18,13 @@ # vertices are connected but do not form a closed surface. The size of the hole # is measured by the number of boundary edges in the loop. -# If Easy3D is not installed via `pip`, you may need to add its Python bindings -# to the system path. Modify the path below according to your setup. +# ------------------------------------------------------------------------------- +# Adding Easy3D Python Bindings to the System Path +# ------------------------------------------------------------------------------- +# This is required if the bindings are not installed via `pip` but are located in +# a local build directory. For building and installing Python bindings of Easy3D, +# please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/README.md +# ------------------------------------------------------------------------------- import sys sys.path.append("../../cmake-build-release/lib/python") # Update this path to point to your Easy3D build directory. diff --git a/python/tutorials/tutorial_403_mesh_simplification.py b/python/tutorials/tutorial_403_mesh_simplification.py index 9f34800e..9d2fec01 100644 --- a/python/tutorials/tutorial_403_mesh_simplification.py +++ b/python/tutorials/tutorial_403_mesh_simplification.py @@ -14,10 +14,13 @@ # - Level-of-detail (LOD) modeling in computer graphics. # ----------------------------------------------------------------------------- -# If Easy3D is not installed via `pip`, you may need to add its Python bindings -# to the system path. For detailed instructions on building and installing -# # Python bindings of Easy3D, visit: -# # https://github.com/LiangliangNan/Easy3D/blob/main/ReadMe.md +# ------------------------------------------------------------------------------- +# Adding Easy3D Python Bindings to the System Path +# ------------------------------------------------------------------------------- +# This is required if the bindings are not installed via `pip` but are located in +# a local build directory. For building and installing Python bindings of Easy3D, +# please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/README.md +# ------------------------------------------------------------------------------- import sys sys.path.append("../../cmake-build-release/lib/python") # Update this path to point to your Easy3D build directory. diff --git a/python/tutorials/tutorial_404_mesh_subdivision.py b/python/tutorials/tutorial_404_mesh_subdivision.py index 83856622..bd33f1e6 100644 --- a/python/tutorials/tutorial_404_mesh_subdivision.py +++ b/python/tutorials/tutorial_404_mesh_subdivision.py @@ -15,11 +15,13 @@ # built-in visualization tools. # ----------------------------------------------------------------------------- -# If Easy3D is not installed via `pip`, you may need to add its Python bindings -# to the system path. For detailed instructions on building and installing -# Python bindings of Easy3D, visit: -# https://github.com/LiangliangNan/Easy3D/blob/main/ReadMe.md - +# ------------------------------------------------------------------------------- +# Adding Easy3D Python Bindings to the System Path +# ------------------------------------------------------------------------------- +# This is required if the bindings are not installed via `pip` but are located in +# a local build directory. For building and installing Python bindings of Easy3D, +# please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/README.md +# ------------------------------------------------------------------------------- import sys sys.path.append("../../cmake-build-release/lib/python") # Update this path to point to your Easy3D build directory. diff --git a/python/tutorials/tutorial_405_mesh_parameterization.py b/python/tutorials/tutorial_405_mesh_parameterization.py index 5f339327..d54f31b5 100644 --- a/python/tutorials/tutorial_405_mesh_parameterization.py +++ b/python/tutorials/tutorial_405_mesh_parameterization.py @@ -26,12 +26,13 @@ # distortion in the parameterized space. # ----------------------------------------------------------------------------- - -# If Easy3D is not installed via `pip`, you may need to add its Python bindings -# to the system path. For detailed instructions on building and installing -# Python bindings of Easy3D, visit: -# https://github.com/LiangliangNan/Easy3D/blob/main/ReadMe.md - +# ------------------------------------------------------------------------------- +# Adding Easy3D Python Bindings to the System Path +# ------------------------------------------------------------------------------- +# This is required if the bindings are not installed via `pip` but are located in +# a local build directory. For building and installing Python bindings of Easy3D, +# please refer to: https://github.com/LiangliangNan/Easy3D/blob/main/README.md +# ------------------------------------------------------------------------------- import sys sys.path.append("../../cmake-build-release/lib/python") # Update this path to point to your Easy3D build directory. @@ -39,7 +40,6 @@ import easy3d easy3d.initialize(False) - # In this example, we load a 3D surface mesh file of a girl's face. mesh_harmonic = easy3d.SurfaceMeshIO.load(easy3d.resource_directory() + "/data/girl_face.ply")