Skip to content

Commit

Permalink
ported reflector data aeroplane
Browse files Browse the repository at this point in the history
  • Loading branch information
tf17270 committed Apr 26, 2024
1 parent cb3532e commit 8c8c73f
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 544 deletions.
14 changes: 4 additions & 10 deletions docs/examples/01_aperture_projection.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import copy

import numpy as np
import open3d as o3d

# %%
# Setting Farfield Resolution and Wavelength
Expand All @@ -54,21 +53,17 @@

body, array, _ = data.exampleUAV(10e9)

# visualise UAV and Array
o3d.visualization.draw_geometries([body, array])


# %%
## .. image:: ../_static/open3d_structure.png

# crop the inner surface of the array trianglemesh (not strictly required, as the UAV main body provides blocking to
# the hidden surfaces, but correctly an aperture will only have an outer face.
surface_array = copy.deepcopy(array)
surface_array.triangles = o3d.utility.Vector3iVector(
np.asarray(array.triangles)[: len(array.triangles) // 2, :]
)
surface_array.triangle_normals = o3d.utility.Vector3dVector(
np.asarray(array.triangle_normals)[: len(array.triangle_normals) // 2, :]
)
surface_array.cells[0].data = np.asarray(array.cells[0].data)[: (array.cells[0].data).shape[0] // 2, :]

surface_array.cell_data["normals"] = np.array(array.cell_data["normals"])[: (array.cells[0].data).shape[0] // 2]

# %%
# Structures
Expand Down Expand Up @@ -104,7 +99,6 @@
# also as an open3d point cloud. This allows easy visualisation using :func:`open3d.visualization.draw_geometries`.
# %%

o3d.visualization.draw_geometries([body, surface_array, pcd])

# %%
# .. image:: ../_static/open3d_results_rendering.png
Expand Down
32 changes: 11 additions & 21 deletions docs/examples/02_coherently_polarised_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
import copy

import numpy as np
import open3d as o3d

import meshio
# %%
# Setting Farfield Resolution and Wavelength
# -------------------------------------------
Expand All @@ -39,41 +38,32 @@

body, array, source_coords = data.exampleUAV(10e9)

# %%
# Visualise the Resultant UAV and Array
# ---------------------------------------
# :func:`open3d.visualization.draw_geometries` can be used to visualise the open3d data
# structures :class:`open3d.geometry.PointCloud` and :class:`open3d.geometry.PointCloud`

mesh_frame = o3d.geometry.TriangleMesh.create_coordinate_frame(
size=0.5, origin=[0, 0, 0]
)
o3d.visualization.draw_geometries([body, array, source_coords, mesh_frame])

# %%
# .. image:: ../_static/UAVArraywithPoints.png
## .. image:: ../_static/open3d_structure.png

# crop the inner surface of the array trianglemesh (not strictly required, as the UAV main body provides blocking to
# the hidden surfaces, but correctly an aperture will only have an outer face.
surface_array = copy.deepcopy(array)
surface_array.triangles = o3d.utility.Vector3iVector(
np.asarray(array.triangles)[: len(array.triangles) // 2, :]
)
surface_array.triangle_normals = o3d.utility.Vector3dVector(
np.asarray(array.triangle_normals)[: len(array.triangle_normals) // 2, :]
)
surface_array.cells[0].data = np.asarray(array.cells[0].data)[: (array.cells[0].data).shape[0] // 2, :]

surface_array.cell_data["normals"] = np.array(array.cell_data["normals"])[: (array.cells[0].data).shape[0] // 2]

from lyceanem.base_classes import structures

blockers = structures([body, array])

from lyceanem.models.frequency_domain import calculate_farfield

from lyceanem.geometry.targets import source_cloud_from_shape

source_points, _ = source_cloud_from_shape(surface_array, wavelength * 0.5)

o3d.visualization.draw_geometries([body, array, source_points])

import pyvista as pv


source_points = surface_array.points


# %%
# .. image:: ../_static/sourcecloudfromshapeuav.png
Expand Down
7 changes: 1 addition & 6 deletions docs/examples/03_frequency_domain_channel_modelling.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@
transmit_horn_structure, transmitting_antenna_surface_coords = TL.meshedHorn(
58e-3, 58e-3, 128e-3, 2e-3, 0.21, mesh_resolution
)
print("hi",transmit_horn_structure)
print("hii",transmit_horn_structure.points.shape)
print("hiiii",transmit_horn_structure.point_data)
print("len", len(transmit_horn_structure.cells))
print("cells", transmit_horn_structure.cells[0])
print("data", transmitting_antenna_surface_coords.cell_data)

receive_horn_structure, receiving_antenna_surface_coords = TL.meshedHorn(
58e-3, 58e-3, 128e-3, 2e-3, 0.21, mesh_resolution
)
Expand Down
Loading

0 comments on commit 8c8c73f

Please sign in to comment.