From b6f13d72de082a929cf1d943d3cd3774372cc118 Mon Sep 17 00:00:00 2001 From: LyceanEM <60020395+LyceanEM@users.noreply.github.com> Date: Wed, 29 May 2024 14:28:58 +0100 Subject: [PATCH] Removing references to open3d in the documentation. --- docs/examples/01_aperture_projection.py | 12 ++++++------ docs/examples/02_coherently_polarised_array.py | 2 +- docs/examples/04_time_domain_channel_modelling.py | 3 +-- docs/examples/05_array_beamforming.py | 2 +- lyceanem/geometry/geometryfunctions.py | 11 ++++++++++- 5 files changed, 19 insertions(+), 11 deletions(-) diff --git a/docs/examples/01_aperture_projection.py b/docs/examples/01_aperture_projection.py index 1a2504b..561c512 100644 --- a/docs/examples/01_aperture_projection.py +++ b/docs/examples/01_aperture_projection.py @@ -48,7 +48,7 @@ # Geometries # ------------------------ # In order to make things easy to start, an example geometry has been included within LyceanEM for a UAV, and the -# open3d trianglemesh structures can be accessed by importing the data subpackage +# meshio trianglemesh structures can be accessed by importing the data subpackage import lyceanem.tests.reflectordata as data body, array, _ = data.exampleUAV(10e9) @@ -71,7 +71,7 @@ # LyceanEM uses a class named 'structures' to store and maniuplate joined 3D solids. Currently all that is implemented # is the class itself, and methods to allow translation and rotation of the trianglemesh solids. A structure can be # passed to the models to provide the environment to be considered as blockers. -# structures are created by calling the class, and passing it a list of the open3d trianglemesh structures to be added. +# structures are created by calling the class, and passing it a list of the meshio trianglemesh structures to be added. from lyceanem.base_classes import structures blockers = structures([body]) @@ -81,7 +81,7 @@ # ----------------------- # Aperture Projection is imported from the frequency domain models, requiring the aperture of interest, wavelength to # be considered, and the azimuth and elevation ranges. The function then returns the directivity envelope as a numpy -# array of floats, and an open3d point cloud with points and colors corresponding to the directivity envelope of the +# array of floats, and a meshio point cloud with points and colors corresponding to the directivity envelope of the # provided aperture, scaling from yellow at maximum to dark purple at minimum. from lyceanem.models.frequency_domain import aperture_projection @@ -93,10 +93,10 @@ elev_range=np.linspace(-90.0, 90.0, elev_res), ) # %% -# Open3D Visualisation +# Visualisation # ------------------------ # The resultant maximum directivity envelope is provided as both a numpy array of directivities for each angle, but -# also as an open3d point cloud. This allows easy visualisation using :func:`open3d.visualization.draw_geometries`. +# also as an meshio point cloud. This allows easy visualisation using pyvista. # %% @@ -114,7 +114,7 @@ # %% # Plotting the Output # ------------------------ -# While the open3d visualisation is very intuitive for examining the results of the aperture projection, it is +# While the pyvista visualisation is very intuitive for examining the results of the aperture projection, it is # difficult to consider the full 3D space, and cannot be included in documentation in this form. However, matplotlib # can be used to generate contour plots with 3dB contours to give a more systematic understanding of the resultant # maximum directivity envelope. diff --git a/docs/examples/02_coherently_polarised_array.py b/docs/examples/02_coherently_polarised_array.py index 148b933..d21e13c 100644 --- a/docs/examples/02_coherently_polarised_array.py +++ b/docs/examples/02_coherently_polarised_array.py @@ -33,7 +33,7 @@ # Geometries # ------------------------ # In order to make things easy to start, an example geometry has been included within LyceanEM for a UAV, and the -# :class:`open3d.geometry.TriangleMesh` structures can be accessed by importing the data subpackage +# triangle structures can be accessed by importing the data subpackage import lyceanem.tests.reflectordata as data body, array, source_coords = data.exampleUAV(10e9) diff --git a/docs/examples/04_time_domain_channel_modelling.py b/docs/examples/04_time_domain_channel_modelling.py index 94e1c20..6737487 100644 --- a/docs/examples/04_time_domain_channel_modelling.py +++ b/docs/examples/04_time_domain_channel_modelling.py @@ -51,8 +51,7 @@ # Position Transmitter # ---------------------- # rotate the transmitting antenna to the desired orientation, and then translate to final position. -# :func:`lyceanem.geometry.geometryfunctions.open3drotate` allows both the center of rotation to be defined, and -# ensures the right syntax is used for Open3d, as it was changed from 0.9.0 to 0.10.0 and onwards. +# :func:`lyceanem.geometry.geometryfunctions.translate_mesh`, :func:`lyceanem.geometry.geometryfunctions.mesh_rotate` and :func:`lyceanem.geometry.geometryfunctions.mesh_transform` are included, allowing translation, rotation, and transformation of the meshio objects as required. # rotation_vector1 = np.radians(np.asarray([90.0, 0.0, 0.0])) rotation_vector2 = np.radians(np.asarray([0.0, 0.0, -90.0])) diff --git a/docs/examples/05_array_beamforming.py b/docs/examples/05_array_beamforming.py index 5b764e3..5d26b79 100644 --- a/docs/examples/05_array_beamforming.py +++ b/docs/examples/05_array_beamforming.py @@ -32,7 +32,7 @@ # Geometries # ------------------------ # In order to make things easy to start, an example geometry has been included within LyceanEM for a UAV, and the -# :class:`open3d.geometry.TriangleMesh` structures can be accessed by importing the data subpackage +# mesh structures can be accessed by importing the data subpackage import lyceanem.tests.reflectordata as data body, array, source_coords = data.exampleUAV(10e9) diff --git a/lyceanem/geometry/geometryfunctions.py b/lyceanem/geometry/geometryfunctions.py index bb7eb4b..2d02dba 100644 --- a/lyceanem/geometry/geometryfunctions.py +++ b/lyceanem/geometry/geometryfunctions.py @@ -43,7 +43,16 @@ def tri_centroids(triangle_mesh): def mesh_rotate(mesh, rotation, rotation_centre=np.zeros((1, 3), dtype=np.float32)): """ - Rotate a mesh by a given rotation vector about a given center. + Rotate the provided meshio mesh about an arbitary center using either rotation vector or rotation matrix. + Parameters + ---------- + mesh + rotation + rotation_centre + + Returns + ------- + mesh """ if rotation.shape == (3,): r = R.from_rotvec(rotation)