Added ability to rotate antenna models 90 degrees CCW in the x-y plane.

这个提交包含在:
Craig Warren
2016-10-21 12:51:04 +01:00
父节点 121549eca6
当前提交 e39ddcad77
共有 3 个文件被更改,包括 426 次插入140 次删除

查看文件

@@ -29,18 +29,18 @@ Module overview
How to use the module How to use the module
===================== =====================
The antenna models can be accessed from within a block of Python code in an input file. The models must be used with cubic spatial resolutions of either 1mm (default) or 2mm. The antenna models can be accessed from within a block of Python code in an input file. The models must be used with cubic spatial resolutions of either 1mm (default) or 2mm by setting the keyword argument, e.g. ``resolution=0.002``. The antenna models can be rotated 90 degrees counter-clockwise (CCW) in the x-y plane by setting the keyword argument ``rotate90=True``.
Example Example
------- -------
To include an antenna model similar to a GSSI 1.5 GHz antenna at a location 0.125m, 0.094m, 0.100m (x,y,z): To include an antenna model similar to a GSSI 1.5 GHz antenna at a location 0.125m, 0.094m, 0.100m (x,y,z) using a 2mm cubic spatial resolution:
.. code-block:: none .. code-block:: none
#python: #python:
from user_libs.antennas import antenna_like_GSSI_1500 from user_libs.antennas import antenna_like_GSSI_1500
antenna_like_GSSI_1500(0.125, 0.094, 0.100) antenna_like_GSSI_1500(0.125, 0.094, 0.100, resolution=0.002)
#end_python: #end_python:
.. figure:: images/antenna_like_GSSI_1500.png .. figure:: images/antenna_like_GSSI_1500.png

查看文件

@@ -38,6 +38,7 @@ Coordinate_tuple = namedtuple('Coordinate', ['x', 'y', 'z'])
class Coordinate(Coordinate_tuple): class Coordinate(Coordinate_tuple):
"""Subclass of a namedtuple where __str__ outputs 'x y z'""" """Subclass of a namedtuple where __str__ outputs 'x y z'"""
def __str__(self): def __str__(self):
return '{:g} {:g} {:g}'.format(self.x, self.y, self.z) return '{:g} {:g} {:g}'.format(self.x, self.y, self.z)
@@ -52,6 +53,7 @@ def command(cmd, *parameters):
Returns: Returns:
s (str): the printed string s (str): the printed string
""" """
# remove Nones # remove Nones
filtered = filter(lambda x: x is not None, parameters) filtered = filter(lambda x: x is not None, parameters)
# convert to str # convert to str
@@ -72,6 +74,81 @@ def command(cmd, *parameters):
return s return s
def rotate90_point(x, y, rotate90origin=()):
"""Rotates a point 90 degrees CCW in the x-y plane.
Args:
x, y (float): Coordinates.
rotate90origin (tuple): x, y origin for 90 degree CCW rotation in x-y plane.
Returns:
xrot, yrot (float): Rotated coordinates.
"""
# Translate point to origin
x -= rotate90origin[0]
y -= rotate90origin[1]
# 90 degree CCW rotation and translate back
xrot = -y + rotate90origin[0]
yrot = x + rotate90origin[1]
return xrot, yrot
def rotate90_edge(xs, ys, xf, yf, polarisation, rotate90origin):
"""Rotates an edge or edge-like object/source 90 degrees CCW in the x-y plane.
Args:
xs, ys, xf, yf (float): Start and finish coordinates.
polarisation (str): is the polarisation and can be 'x', 'y', or 'z'.
rotate90origin (tuple): x, y origin for 90 degree CCW rotation in x-y plane.
Returns:
xs, ys, xf, yf (float): Rotated start and finish coordinates.
"""
xsnew, ysnew = rotate90_point(xs, ys, rotate90origin)
xfnew, yfnew = rotate90_point(xf, yf, rotate90origin)
# Swap coordinates for original y-directed edge, original x-directed edge does not require this.
if polarisation == 'y':
xs = xfnew
xf = xsnew
ys = ysnew
yf = yfnew
else:
xs = xsnew
xf = xfnew
ys = ysnew
yf = yfnew
return xs, ys, xf, yf
def rotate90_plate(xs, ys, xf, yf, rotate90origin):
"""Rotates an plate or plate-like object 90 degrees CCW in the x-y plane.
Args:
xs, ys, xf, yf (float): Start and finish coordinates.
rotate90origin (tuple): x, y origin for 90 degree CCW rotation in x-y plane.
Returns:
xs, ys, xf, yf (float): Rotated start and finish coordinates.
"""
xsnew, ysnew = rotate90_point(xs, ys, rotate90origin)
xfnew, yfnew = rotate90_point(xf, yf, rotate90origin)
# Swap x-coordinates to correctly specify plate
xs = xfnew
xf = xsnew
ys = ysnew
yf = yfnew
return xs, ys, xf, yf
def domain(x, y, z): def domain(x, y, z):
"""Prints the gprMax #domain command. """Prints the gprMax #domain command.
@@ -81,6 +158,7 @@ def domain(x, y, z):
Returns: Returns:
domain (Coordinate): Namedtuple of the extent of the domain. domain (Coordinate): Namedtuple of the extent of the domain.
""" """
domain = Coordinate(x, y, z) domain = Coordinate(x, y, z)
command('domain', domain) command('domain', domain)
@@ -96,6 +174,7 @@ def dx_dy_dz(x, y, z):
Returns: Returns:
dx_dy_dz (float): Tuple of the spatial resolutions. dx_dy_dz (float): Tuple of the spatial resolutions.
""" """
dx_dy_dz = Coordinate(x, y, z) dx_dy_dz = Coordinate(x, y, z)
command('dx_dy_dz', dx_dy_dz) command('dx_dy_dz', dx_dy_dz)
@@ -111,6 +190,7 @@ def time_window(time_window):
Returns: Returns:
time_window (float): Duration of simulation. time_window (float): Duration of simulation.
""" """
command('time_window', time_window) command('time_window', time_window)
return time_window return time_window
@@ -126,6 +206,7 @@ def material(permittivity, conductivity, permeability, magconductivity, name):
magconductivity (float): Magnetic loss of the material. magconductivity (float): Magnetic loss of the material.
name (str): Material identifier. name (str): Material identifier.
""" """
command('material', permittivity, conductivity, permeability, magconductivity, name) command('material', permittivity, conductivity, permeability, magconductivity, name)
@@ -141,6 +222,7 @@ def geometry_view(xs, ys, zs, xf, yf, zf, dx, dy, dz, filename, type='n'):
Returns: Returns:
s, f, d (tuple): 3 namedtuple Coordinate for the start, finish coordinates and spatial discretisation s, f, d (tuple): 3 namedtuple Coordinate for the start, finish coordinates and spatial discretisation
""" """
s = Coordinate(xs, ys, zs) s = Coordinate(xs, ys, zs)
f = Coordinate(xf, yf, zf) f = Coordinate(xf, yf, zf)
d = Coordinate(dx, dy, dz) d = Coordinate(dx, dy, dz)
@@ -161,6 +243,7 @@ def snapshot(xs, ys, zs, xf, yf, zf, dx, dy, dz, time, filename):
Returns: Returns:
s, f, d (tuple): 3 namedtuple Coordinate for the start, finish coordinates and spatial discretisation s, f, d (tuple): 3 namedtuple Coordinate for the start, finish coordinates and spatial discretisation
""" """
s = Coordinate(xs, ys, zs) s = Coordinate(xs, ys, zs)
f = Coordinate(xf, yf, zf) f = Coordinate(xf, yf, zf)
d = Coordinate(dx, dy, dz) d = Coordinate(dx, dy, dz)
@@ -175,16 +258,26 @@ def snapshot(xs, ys, zs, xf, yf, zf, dx, dy, dz, time, filename):
return s, f, d return s, f, d
def edge(xs, ys, zs, xf, yf, zf, material): def edge(xs, ys, zs, xf, yf, zf, material, rotate90origin=()):
"""Prints the gprMax #edge command. """Prints the gprMax #edge command.
Args: Args:
xs, ys, zs, xf, yf, zf (float): Start and finish coordinates. xs, ys, zs, xf, yf, zf (float): Start and finish coordinates.
material (str): Material identifier. material (str): Material identifier.
rotate90origin (tuple): x, y origin for 90 degree CCW rotation in x-y plane.
Returns: Returns:
s, f (tuple): 2 namedtuple Coordinate for the start and finish coordinates s, f (tuple): 2 namedtuple Coordinate for the start and finish coordinates
""" """
if rotate90origin:
if xs == xf:
polarisation = 'y'
else:
polarisation = 'x '
xs, ys, xf, yf = rotate90_edge(xs, ys, xf, yf, polarisation, rotate90origin)
s = Coordinate(xs, ys, zs) s = Coordinate(xs, ys, zs)
f = Coordinate(xf, yf, zf) f = Coordinate(xf, yf, zf)
command('edge', s, f, material) command('edge', s, f, material)
@@ -192,16 +285,21 @@ def edge(xs, ys, zs, xf, yf, zf, material):
return s, f return s, f
def plate(xs, ys, zs, xf, yf, zf, material): def plate(xs, ys, zs, xf, yf, zf, material, rotate90origin=()):
"""Prints the gprMax #plate command. """Prints the gprMax #plate command.
Args: Args:
xs, ys, zs, xf, yf, zf (float): Start and finish coordinates. xs, ys, zs, xf, yf, zf (float): Start and finish coordinates.
material (str): Material identifier(s). material (str): Material identifier(s).
rotate90origin (tuple): x, y origin for 90 degree CCW rotation in x-y plane.
Returns: Returns:
s, f (tuple): 2 namedtuple Coordinate for the start and finish coordinates s, f (tuple): 2 namedtuple Coordinate for the start and finish coordinates
""" """
if rotate90origin:
xs, ys, xf, yf = rotate90_plate(xs, ys, xf, yf, rotate90origin)
s = Coordinate(xs, ys, zs) s = Coordinate(xs, ys, zs)
f = Coordinate(xf, yf, zf) f = Coordinate(xf, yf, zf)
command('plate', s, f, material) command('plate', s, f, material)
@@ -209,36 +307,49 @@ def plate(xs, ys, zs, xf, yf, zf, material):
return s, f return s, f
def triangle(x1, y1, z1, x2, y2, z2, x3, y3, z3, thickness, material): def triangle(x1, y1, z1, x2, y2, z2, x3, y3, z3, thickness, material, averaging='', rotate90origin=()):
"""Prints the gprMax #triangle command. """Prints the gprMax #triangle command.
Args: Args:
x1, y1, z1, x2, y2, z2, x3, y3, z3 (float): Coordinates of the vertices. x1, y1, z1, x2, y2, z2, x3, y3, z3 (float): Coordinates of the vertices.
thickness (float): Thickness for a triangular prism, or zero for a triangular patch. thickness (float): Thickness for a triangular prism, or zero for a triangular patch.
material (str): Material identifier(s). material (str): Material identifier(s).
averaging (str): Turn averaging on or off.
rotate90origin (tuple): x, y origin for 90 degree CCW rotation in x-y plane.
Returns: Returns:
v1, v2, v3 (tuple): 3 namedtuple Coordinate for the vertices v1, v2, v3 (tuple): 3 namedtuple Coordinate for the vertices
""" """
if rotate90origin:
x1, y1 = rotate90_point(x1, y1, rotate90origin)
x2, y2 = rotate90_point(x2, y2, rotate90origin)
x3, y3 = rotate90_point(x3, y3, rotate90origin)
v1 = Coordinate(x1, y1, z1) v1 = Coordinate(x1, y1, z1)
v2 = Coordinate(x2, y2, z2) v2 = Coordinate(x2, y2, z2)
v3 = Coordinate(x3, y3, z3) v3 = Coordinate(x3, y3, z3)
command('triangle', v1, v2, v3, thickness, material) command('triangle', v1, v2, v3, thickness, material, averaging)
return v1, v2, v3 return v1, v2, v3
def box(xs, ys, zs, xf, yf, zf, material, averaging=''): def box(xs, ys, zs, xf, yf, zf, material, averaging='', rotate90origin=()):
"""Prints the gprMax #box command. """Prints the gprMax #box command.
Args: Args:
xs, ys, zs, xf, yf, zf (float): Start and finish coordinates. xs, ys, zs, xf, yf, zf (float): Start and finish coordinates.
material (str): Material identifier(s). material (str): Material identifier(s).
averaging (str): Turn averaging on or off. averaging (str): Turn averaging on or off.
rotate90origin (tuple): x, y origin for 90 degree CCW rotation in x-y plane.
Returns: Returns:
s, f (tuple): 2 namedtuple Coordinate for the start and finish coordinates s, f (tuple): 2 namedtuple Coordinate for the start and finish coordinates
""" """
if rotate90origin:
xs, ys, xf, yf = rotate90_plate(xs, ys, xf, yf, rotate90origin)
s = Coordinate(xs, ys, zs) s = Coordinate(xs, ys, zs)
f = Coordinate(xf, yf, zf) f = Coordinate(xf, yf, zf)
command('box', s, f, material, averaging) command('box', s, f, material, averaging)
@@ -258,13 +369,14 @@ def sphere(x, y, z, radius, material, averaging=''):
Returns: Returns:
c (tuple): namedtuple Coordinate for the center of the sphere c (tuple): namedtuple Coordinate for the center of the sphere
""" """
c = Coordinate(x, y, z) c = Coordinate(x, y, z)
command('sphere', c, radius, material, averaging) command('sphere', c, radius, material, averaging)
return c return c
def cylinder(x1, y1, z1, x2, y2, z2, radius, material, averaging=''): def cylinder(x1, y1, z1, x2, y2, z2, radius, material, averaging='', rotate90origin=()):
"""Prints the gprMax #cylinder command. """Prints the gprMax #cylinder command.
Args: Args:
@@ -272,10 +384,16 @@ def cylinder(x1, y1, z1, x2, y2, z2, radius, material, averaging=''):
radius (float): Radius. radius (float): Radius.
material (str): Material identifier(s). material (str): Material identifier(s).
averaging (str): Turn averaging on or off. averaging (str): Turn averaging on or off.
rotate90origin (tuple): x, y origin for 90 degree CCW rotation in x-y plane.
Returns: Returns:
c1, c2 (tuple): 2 namedtuple Coordinate for the centres of the two faces of the cylinder. c1, c2 (tuple): 2 namedtuple Coordinate for the centres of the two faces of the cylinder.
""" """
if rotate90origin:
x1, y1 = rotate90_point(x1, y1, rotate90origin)
x2, y2 = rotate90_point(x2, y2, rotate90origin)
c1 = Coordinate(x1, y1, z1) c1 = Coordinate(x1, y1, z1)
c2 = Coordinate(x2, y2, z2) c2 = Coordinate(x2, y2, z2)
command('cylinder', c1, c2, radius, material, averaging) command('cylinder', c1, c2, radius, material, averaging)
@@ -296,6 +414,7 @@ def cylindrical_sector(axis, ctr1, ctr2, t1, t2, radius, startingangle, sweptang
material (str): Material identifier(s). material (str): Material identifier(s).
averaging (str): Turn averaging on or off. averaging (str): Turn averaging on or off.
""" """
command('cylindrical_sector', axis, ctr1, ctr2, t1, t2, radius, startingangle, sweptangle, material, averaging) command('cylindrical_sector', axis, ctr1, ctr2, t1, t2, radius, startingangle, sweptangle, material, averaging)
@@ -308,6 +427,7 @@ def excitation_file(file1):
Returns: Returns:
file1 (str): filename file1 (str): filename
""" """
command('excitation_file', file1) command('excitation_file', file1)
return file1 return file1
@@ -325,44 +445,184 @@ def waveform(shape, amplitude, frequency, identifier):
Returns: Returns:
identifier (str): is an identifier for the waveform used to assign it to a source. identifier (str): is an identifier for the waveform used to assign it to a source.
""" """
command('waveform', shape, amplitude, frequency, identifier) command('waveform', shape, amplitude, frequency, identifier)
return identifier return identifier
def hertzian_dipole(polarization, f1, f2, f3, identifier, t0=None, t_remove=None): def hertzian_dipole(polarisation, f1, f2, f3, identifier, t0=None, t_remove=None, dxdy=None, rotate90origin=()):
"""Prints the #hertzian_dipole: polarization, f1, f2, f3, identifier, [t0, t_remove] """Prints the #hertzian_dipole: polarisation, f1, f2, f3, identifier, [t0, t_remove]
Args: Args:
polarization (str): is the polarisation of the source and can be 'x', 'y', or 'z'. polarisation (str): is the polarisation of the source and can be 'x', 'y', or 'z'.
f1 f2 f3 (float): are the coordinates (x,y,z) of the source in the model. f1 f2 f3 (float): are the coordinates (x,y,z) of the source in the model.
identifier (str): is the identifier of the waveform that should be used with the source. identifier (str): is the identifier of the waveform that should be used with the source.
t0 (float): is an optinal argument for the time delay in starting the source. t0 (float): is an optinal argument for the time delay in starting the source.
t_remove (float): is a time to remove the source. t_remove (float): is a time to remove the source.
dxdy (float): Tuple of x-y spatial resolutions. For rotation purposes only.
rotate90origin (tuple): x, y origin for 90 degree CCW rotation in x-y plane.
Returns: Returns:
coordinates (tuple): namedtuple Coordinate of the source location coordinates (tuple): namedtuple Coordinate of the source location
""" """
if rotate90origin:
if polarisation == 'x':
xf = f1 + dxdy[0]
yf = f2
newpolarisation = 'y'
elif polarisation == 'y':
xf = f1
yf = f2 + dxdy[1]
newpolarisation = 'x'
f1, f2, xf, yf = rotate90_edge(f1, f2, xf, yf, polarisation, rotate90origin)
polarisation = newpolarisation
c = Coordinate(f1, f2, f3) c = Coordinate(f1, f2, f3)
# since command ignores None, this is safe: # since command ignores None, this is safe:
command('hertzian_dipole', polarization, str(c), identifier, t0, t_remove) command('hertzian_dipole', polarisation, str(c), identifier, t0, t_remove)
return c return c
def rx(x, y, z, identifier=None, to_save=None): def magnetic_dipole(polarisation, f1, f2, f3, identifier, t0=None, t_remove=None, dxdy=None, rotate90origin=()):
"""Prints the #magnetic_dipole: polarisation, f1, f2, f3, identifier, [t0, t_remove]
Args:
polarisation (str): is the polarisation of the source and can be 'x', 'y', or 'z'.
f1 f2 f3 (float): are the coordinates (x,y,z) of the source in the model.
identifier (str): is the identifier of the waveform that should be used with the source.
t0 (float): is an optinal argument for the time delay in starting the source.
t_remove (float): is a time to remove the source.
dxdy (float): Tuple of x-y spatial resolutions. For rotation purposes only.
rotate90origin (tuple): x, y origin for 90 degree CCW rotation in x-y plane.
Returns:
coordinates (tuple): namedtuple Coordinate of the source location
"""
if rotate90origin:
if polarisation == 'x':
xf = f1 + dxdy[0]
yf = f2
newpolarisation = 'y'
elif polarisation == 'y':
xf = f1
yf = f2 + dxdy[1]
newpolarisation = 'x'
f1, f2, xf, yf = rotate90_edge(f1, f2, xf, yf, polarisation, rotate90origin)
polarisation = newpolarisation
c = Coordinate(f1, f2, f3)
# since command ignores None, this is safe:
command('magnetic_dipole', polarisation, str(c), identifier, t0, t_remove)
return c
def voltage_source(polarisation, f1, f2, f3, resistance, identifier, t0=None, t_remove=None, dxdy=None, rotate90origin=()):
"""Prints the #voltage_source: polarisation, f1, f2, f3, resistance, identifier, [t0, t_remove]
Args:
polarisation (str): is the polarisation of the source and can be 'x', 'y', or 'z'.
f1 f2 f3 (float): are the coordinates (x,y,z) of the source in the model.
identifier (str): is the identifier of the waveform that should be used with the source.
resistance (float): is the internal resistance of the voltage source.
t0 (float): is an optinal argument for the time delay in starting the source.
t_remove (float): is a time to remove the source.
dxdy (float): Tuple of x-y spatial resolutions. For rotation purposes only.
rotate90origin (tuple): x, y origin for 90 degree CCW rotation in x-y plane.
Returns:
coordinates (tuple): namedtuple Coordinate of the source location
"""
if rotate90origin:
if polarisation == 'x':
xf = f1 + dxdy[0]
yf = f2
newpolarisation = 'y'
elif polarisation == 'y':
xf = f1
yf = f2 + dxdy[1]
newpolarisation = 'x'
f1, f2, xf, yf = rotate90_edge(f1, f2, xf, yf, polarisation, rotate90origin)
polarisation = newpolarisation
c = Coordinate(f1, f2, f3)
# since command ignores None, this is safe:
command('voltage_source', polarisation, str(c), resistance, identifier, t0, t_remove)
return c
def transmission_line(polarisation, f1, f2, f3, resistance, identifier, t0=None, t_remove=None, dxdy=None, rotate90origin=()):
"""Prints the #transmission_line: polarisation, f1, f2, f3, resistance, identifier, [t0, t_remove]
Args:
polarisation (str): is the polarisation of the source and can be 'x', 'y', or 'z'.
f1 f2 f3 (float): are the coordinates (x,y,z) of the source in the model.
identifier (str): is the identifier of the waveform that should be used with the source.
resistance (float): is the characteristic resistance of the transmission_line.
t0 (float): is an optinal argument for the time delay in starting the source.
t_remove (float): is a time to remove the source.
dxdy (float): Tuple of x-y spatial resolutions. For rotation purposes only.
rotate90origin (tuple): x, y origin for 90 degree CCW rotation in x-y plane.
Returns:
coordinates (tuple): namedtuple Coordinate of the source location
"""
if rotate90origin:
if polarisation == 'x':
xf = f1 + dxdy[0]
yf = f2
newpolarisation = 'y'
elif polarisation == 'y':
xf = f1
yf = f2 + dxdy[1]
newpolarisation = 'x'
f1, f2, xf, yf = rotate90_edge(f1, f2, xf, yf, polarisation, rotate90origin)
polarisation = newpolarisation
c = Coordinate(f1, f2, f3)
# since command ignores None, this is safe:
command('transmission_line', polarisation, str(c), resistance, identifier, t0, t_remove)
return c
def rx(x, y, z, identifier=None, to_save=None, polarisation=None, dxdy=None, rotate90origin=()):
"""Prints the #rx: x, y, z, [identifier, to_save] command. """Prints the #rx: x, y, z, [identifier, to_save] command.
Args: Args:
x, y, z (float): are the coordinates (x,y,z) of the receiver in the model. x, y, z (float): are the coordinates (x,y,z) of the receiver in the model.
identifier (str): is the optional identifier of the receiver identifier (str): is the optional identifier of the receiver
to_save (list): is a list of outputs with this receiver. It can be any selection from 'Ex', 'Ey', 'Ez', 'Hx', 'Hy', 'Hz', 'Ix', 'Iy', or 'Iz'. to_save (list): is a list of outputs with this receiver. It can be any selection from 'Ex', 'Ey', 'Ez', 'Hx', 'Hy', 'Hz', 'Ix', 'Iy', or 'Iz'.
polarisation (str): is the polarisation of the source and can be 'x', 'y', or 'z'. For rotation purposes only.
dxdy (float): Tuple of x-y spatial resolutions. For rotation purposes only.
rotate90origin (tuple): x, y origin for 90 degree CCW rotation in x-y plane.
Returns: Returns:
coordinates (tuple): namedtuple Coordinate of the receiver location coordinates (tuple): namedtuple Coordinate of the receiver location
""" """
if rotate90origin:
if polarisation == 'x':
xf = x + dxdy[0]
yf = y
elif polarisation == 'y':
xf = x
yf = y + dxdy[1]
x, y, xf, yf = rotate90_edge(x, y, xf, yf, polarisation, rotate90origin)
c = Coordinate(x, y, z) c = Coordinate(x, y, z)
command('rx', str(c), identifier, to_save) command('rx', str(c), identifier, ' '.join(to_save))
return c return c

查看文件

@@ -12,12 +12,13 @@ from gprMax.input_cmd_funcs import *
moduledirectory = os.path.dirname(os.path.abspath(__file__)) moduledirectory = os.path.dirname(os.path.abspath(__file__))
def antenna_like_GSSI_1500(x, y, z, resolution=0.001, **kwargs): def antenna_like_GSSI_1500(x, y, z, resolution=0.001, rotate90=False, **kwargs):
"""Inserts a description of an antenna similar to the GSSI 1.5GHz antenna. Can be used with 1mm (default) or 2mm spatial resolution. The external dimensions of the antenna are 170x108x45mm. One output point is defined between the arms of the receiever bowtie. The bowties are aligned with the y axis so the output is the y component of the electric field. """Inserts a description of an antenna similar to the GSSI 1.5GHz antenna. Can be used with 1mm (default) or 2mm spatial resolution. The external dimensions of the antenna are 170x108x45mm. One output point is defined between the arms of the receiever bowtie. The bowties are aligned with the y axis so the output is the y component of the electric field.
Args: Args:
x, y, z (float): Coordinates of a location in the model to insert the antenna. Coordinates are relative to the geometric centre of the antenna in the x-y plane and the bottom of the antenna skid in the z direction. x, y, z (float): Coordinates of a location in the model to insert the antenna. Coordinates are relative to the geometric centre of the antenna in the x-y plane and the bottom of the antenna skid in the z direction.
resolution (float): Spatial resolution for the antenna model. resolution (float): Spatial resolution for the antenna model.
rotate90 (bool): Rotate model 90 degrees CCW in xy plane.
kwargs (dict): Optional variables, e.g. can be fed from an optimisation process. kwargs (dict): Optional variables, e.g. can be fed from an optimisation process.
""" """
@@ -32,6 +33,14 @@ def antenna_like_GSSI_1500(x, y, z, resolution=0.001, **kwargs):
bowtieheight = 0.014 bowtieheight = 0.014
patchheight = 0.015 patchheight = 0.015
# Set origin for rotation to geometric centre of antenna in x-y plane if required
if rotate90:
rotate90origin = (x, y)
output = 'Ex'
else:
rotate90origin = ()
output = 'Ey'
# Unknown properties # Unknown properties
if kwargs: if kwargs:
excitationfreq = kwargs['excitationfreq'] excitationfreq = kwargs['excitationfreq']
@@ -81,21 +90,21 @@ def antenna_like_GSSI_1500(x, y, z, resolution=0.001, **kwargs):
# Antenna geometry # Antenna geometry
# Plastic case # Plastic case
box(x, y, z + skidthickness, x + casesize[0], y + casesize[1], z + skidthickness + casesize[2], 'hdpe') box(x, y, z + skidthickness, x + casesize[0], y + casesize[1], z + skidthickness + casesize[2], 'hdpe', rotate90origin=rotate90origin)
box(x + casethickness, y + casethickness, z + skidthickness, x + casesize[0] - casethickness, y + casesize[1] - casethickness, z + skidthickness + casesize[2] - casethickness, 'free_space') box(x + casethickness, y + casethickness, z + skidthickness, x + casesize[0] - casethickness, y + casesize[1] - casethickness, z + skidthickness + casesize[2] - casethickness, 'free_space', rotate90origin=rotate90origin)
# Metallic enclosure # Metallic enclosure
box(x + 0.025, y + casethickness, z + skidthickness, x + casesize[0] - 0.025, y + casesize[1] - casethickness, z + skidthickness + 0.027, 'pec') box(x + 0.025, y + casethickness, z + skidthickness, x + casesize[0] - 0.025, y + casesize[1] - casethickness, z + skidthickness + 0.027, 'pec', rotate90origin=rotate90origin)
# Absorber material, and foam (modelled as PCB material) around edge of absorber # Absorber material, and foam (modelled as PCB material) around edge of absorber
box(x + 0.025 + shieldthickness, y + casethickness + shieldthickness, z + skidthickness, x + 0.025 + shieldthickness + 0.057, y + casesize[1] - casethickness - shieldthickness, z + skidthickness + 0.027 - shieldthickness - 0.001, 'pcb') box(x + 0.025 + shieldthickness, y + casethickness + shieldthickness, z + skidthickness, x + 0.025 + shieldthickness + 0.057, y + casesize[1] - casethickness - shieldthickness, z + skidthickness + 0.027 - shieldthickness - 0.001, 'pcb', rotate90origin=rotate90origin)
box(x + 0.025 + shieldthickness + foamsurroundthickness, y + casethickness + shieldthickness + foamsurroundthickness, z + skidthickness, x + 0.025 + shieldthickness + 0.057 - foamsurroundthickness, y + casesize[1] - casethickness - shieldthickness - foamsurroundthickness, z + skidthickness + 0.027 - shieldthickness, 'absorber') box(x + 0.025 + shieldthickness + foamsurroundthickness, y + casethickness + shieldthickness + foamsurroundthickness, z + skidthickness, x + 0.025 + shieldthickness + 0.057 - foamsurroundthickness, y + casesize[1] - casethickness - shieldthickness - foamsurroundthickness, z + skidthickness + 0.027 - shieldthickness, 'absorber', rotate90origin=rotate90origin)
box(x + 0.086, y + casethickness + shieldthickness, z + skidthickness, x + 0.086 + 0.057, y + casesize[1] - casethickness - shieldthickness, z + skidthickness + 0.027 - shieldthickness - 0.001, 'pcb') box(x + 0.086, y + casethickness + shieldthickness, z + skidthickness, x + 0.086 + 0.057, y + casesize[1] - casethickness - shieldthickness, z + skidthickness + 0.027 - shieldthickness - 0.001, 'pcb', rotate90origin=rotate90origin)
box(x + 0.086 + foamsurroundthickness, y + casethickness + shieldthickness + foamsurroundthickness, z + skidthickness, x + 0.086 + 0.057 - foamsurroundthickness, y + casesize[1] - casethickness - shieldthickness - foamsurroundthickness, z + skidthickness + 0.027 - shieldthickness, 'absorber') box(x + 0.086 + foamsurroundthickness, y + casethickness + shieldthickness + foamsurroundthickness, z + skidthickness, x + 0.086 + 0.057 - foamsurroundthickness, y + casesize[1] - casethickness - shieldthickness - foamsurroundthickness, z + skidthickness + 0.027 - shieldthickness, 'absorber', rotate90origin=rotate90origin)
# PCB # PCB
box(x + 0.025 + shieldthickness + foamsurroundthickness, y + casethickness + shieldthickness + foamsurroundthickness, z + skidthickness, x + 0.086 - shieldthickness - foamsurroundthickness, y + casesize[1] - casethickness - shieldthickness - foamsurroundthickness, z + skidthickness + pcbthickness, 'pcb') box(x + 0.025 + shieldthickness + foamsurroundthickness, y + casethickness + shieldthickness + foamsurroundthickness, z + skidthickness, x + 0.086 - shieldthickness - foamsurroundthickness, y + casesize[1] - casethickness - shieldthickness - foamsurroundthickness, z + skidthickness + pcbthickness, 'pcb', rotate90origin=rotate90origin)
box(x + 0.086 + foamsurroundthickness, y + casethickness + shieldthickness + foamsurroundthickness, z + skidthickness, x + 0.086 + 0.057 - foamsurroundthickness, y + casesize[1] - casethickness - shieldthickness - foamsurroundthickness, z + skidthickness + pcbthickness, 'pcb') box(x + 0.086 + foamsurroundthickness, y + casethickness + shieldthickness + foamsurroundthickness, z + skidthickness, x + 0.086 + 0.057 - foamsurroundthickness, y + casesize[1] - casethickness - shieldthickness - foamsurroundthickness, z + skidthickness + pcbthickness, 'pcb', rotate90origin=rotate90origin)
# PCB components # PCB components
if resolution == 0.001: if resolution == 0.001:
@@ -103,48 +112,48 @@ def antenna_like_GSSI_1500(x, y, z, resolution=0.001, **kwargs):
a = 0 a = 0
b = 0 b = 0
while b < 13: while b < 13:
plate(x + 0.045 + a*dx, y + 0.039 + b*dx, z + skidthickness, x + 0.065 - a*dx, y + 0.039 + b*dx + dy, z + skidthickness, 'pec') plate(x + 0.045 + a*dx, y + 0.039 + b*dx, z + skidthickness, x + 0.065 - a*dx, y + 0.039 + b*dx + dy, z + skidthickness, 'pec', rotate90origin=rotate90origin)
plate(x + 0.045 + a*dx, y + 0.067 - b*dx, z + skidthickness, x + 0.065 - a*dx, y + 0.067 - b*dx + dy, z + skidthickness, 'pec') plate(x + 0.045 + a*dx, y + 0.067 - b*dx, z + skidthickness, x + 0.065 - a*dx, y + 0.067 - b*dx + dy, z + skidthickness, 'pec', rotate90origin=rotate90origin)
plate(x + 0.104 + a*dx, y + 0.039 + b*dx, z + skidthickness, x + 0.124 - a*dx, y + 0.039 + b*dx + dy, z + skidthickness, 'pec') plate(x + 0.104 + a*dx, y + 0.039 + b*dx, z + skidthickness, x + 0.124 - a*dx, y + 0.039 + b*dx + dy, z + skidthickness, 'pec', rotate90origin=rotate90origin)
plate(x + 0.104 + a*dx, y + 0.067 - b*dx, z + skidthickness, x + 0.124 - a*dx, y + 0.067 - b*dx + dy, z + skidthickness, 'pec') plate(x + 0.104 + a*dx, y + 0.067 - b*dx, z + skidthickness, x + 0.124 - a*dx, y + 0.067 - b*dx + dy, z + skidthickness, 'pec', rotate90origin=rotate90origin)
b += 1 b += 1
if a == 2 or a == 4 or a == 7: if a == 2 or a == 4 or a == 7:
plate(x + 0.045 + a*dx, y + 0.039 + b*dx, z + skidthickness, x + 0.065 - a*dx, y + 0.039 + b*dx + dy, z + skidthickness, 'pec') plate(x + 0.045 + a*dx, y + 0.039 + b*dx, z + skidthickness, x + 0.065 - a*dx, y + 0.039 + b*dx + dy, z + skidthickness, 'pec', rotate90origin=rotate90origin)
plate(x + 0.045 + a*dx, y + 0.067 - b*dx, z + skidthickness, x + 0.065 - a*dx, y + 0.067 - b*dx + dy, z + skidthickness, 'pec') plate(x + 0.045 + a*dx, y + 0.067 - b*dx, z + skidthickness, x + 0.065 - a*dx, y + 0.067 - b*dx + dy, z + skidthickness, 'pec', rotate90origin=rotate90origin)
plate(x + 0.104 + a*dx, y + 0.039 + b*dx, z + skidthickness, x + 0.124 - a*dx, y + 0.039 + b*dx + dy, z + skidthickness, 'pec') plate(x + 0.104 + a*dx, y + 0.039 + b*dx, z + skidthickness, x + 0.124 - a*dx, y + 0.039 + b*dx + dy, z + skidthickness, 'pec', rotate90origin=rotate90origin)
plate(x + 0.104 + a*dx, y + 0.067 - b*dx, z + skidthickness, x + 0.124 - a*dx, y + 0.067 - b*dx + dy, z + skidthickness, 'pec') plate(x + 0.104 + a*dx, y + 0.067 - b*dx, z + skidthickness, x + 0.124 - a*dx, y + 0.067 - b*dx + dy, z + skidthickness, 'pec', rotate90origin=rotate90origin)
b += 1 b += 1
a += 1 a += 1
# Rx extension section (upper y) # Rx extension section (upper y)
plate(x + 0.044, y + 0.068, z + skidthickness, x + 0.044 + bowtiebase, y + 0.068 + patchheight, z + skidthickness, 'pec') plate(x + 0.044, y + 0.068, z + skidthickness, x + 0.044 + bowtiebase, y + 0.068 + patchheight, z + skidthickness, 'pec', rotate90origin=rotate90origin)
# Tx extension section (upper y) # Tx extension section (upper y)
plate(x + 0.103, y + 0.068, z + skidthickness, x + 0.103 + bowtiebase, y + 0.068 + patchheight, z + skidthickness, 'pec') plate(x + 0.103, y + 0.068, z + skidthickness, x + 0.103 + bowtiebase, y + 0.068 + patchheight, z + skidthickness, 'pec', rotate90origin=rotate90origin)
# Edges that represent wire between bowtie halves in 1mm model # Edges that represent wire between bowtie halves in 1mm model
edge(tx[0] - 0.059, tx[1] - dy, tx[2], tx[0] - 0.059, tx[1], tx[2], 'pec') edge(tx[0] - 0.059, tx[1] - dy, tx[2], tx[0] - 0.059, tx[1], tx[2], 'pec', rotate90origin=rotate90origin)
edge(tx[0] - 0.059, tx[1] + dy, tx[2], tx[0] - 0.059, tx[1] + 0.002, tx[2], 'pec') edge(tx[0] - 0.059, tx[1] + dy, tx[2], tx[0] - 0.059, tx[1] + 0.002, tx[2], 'pec', rotate90origin=rotate90origin)
edge(tx[0], tx[1] - dy, tx[2], tx[0], tx[1], tx[2], 'pec') edge(tx[0], tx[1] - dy, tx[2], tx[0], tx[1], tx[2], 'pec', rotate90origin=rotate90origin)
edge(tx[0], tx[1] + dz, tx[2], tx[0], tx[1] + 0.002, tx[2], 'pec') edge(tx[0], tx[1] + dz, tx[2], tx[0], tx[1] + 0.002, tx[2], 'pec', rotate90origin=rotate90origin)
elif resolution == 0.002: elif resolution == 0.002:
# Rx & Tx bowties # Rx & Tx bowties
for a in range(0,6): for a in range(0,6):
plate(x + 0.044 + a*dx, y + 0.040 + a*dx, z + skidthickness, x + 0.066 - a*dx, y + 0.040 + a*dx + dy, z + skidthickness, 'pec') plate(x + 0.044 + a*dx, y + 0.040 + a*dx, z + skidthickness, x + 0.066 - a*dx, y + 0.040 + a*dx + dy, z + skidthickness, 'pec', rotate90origin=rotate90origin)
plate(x + 0.044 + a*dx, y + 0.064 - a*dx, z + skidthickness, x + 0.066 - a*dx, y + 0.064 - a*dx + dy, z + skidthickness, 'pec') plate(x + 0.044 + a*dx, y + 0.064 - a*dx, z + skidthickness, x + 0.066 - a*dx, y + 0.064 - a*dx + dy, z + skidthickness, 'pec', rotate90origin=rotate90origin)
plate(x + 0.103 + a*dx, y + 0.040 + a*dx, z + skidthickness, x + 0.125 - a*dx, y + 0.040 + a*dx + dy, z + skidthickness, 'pec') plate(x + 0.103 + a*dx, y + 0.040 + a*dx, z + skidthickness, x + 0.125 - a*dx, y + 0.040 + a*dx + dy, z + skidthickness, 'pec', rotate90origin=rotate90origin)
plate(x + 0.103 + a*dx, y + 0.064 - a*dx, z + skidthickness, x + 0.125 - a*dx, y + 0.064 - a*dx + dy, z + skidthickness, 'pec') plate(x + 0.103 + a*dx, y + 0.064 - a*dx, z + skidthickness, x + 0.125 - a*dx, y + 0.064 - a*dx + dy, z + skidthickness, 'pec', rotate90origin=rotate90origin)
# Rx extension section (upper y) # Rx extension section (upper y)
plate(x + 0.044, y + 0.066, z + skidthickness, x + 0.044 + bowtiebase, y + 0.066 + patchheight, z + skidthickness, 'pec') plate(x + 0.044, y + 0.066, z + skidthickness, x + 0.044 + bowtiebase, y + 0.066 + patchheight, z + skidthickness, 'pec', rotate90origin=rotate90origin)
# Tx extension section (upper y) # Tx extension section (upper y)
plate(x + 0.103, y + 0.066, z + skidthickness, x + 0.103 + bowtiebase, y + 0.066 + patchheight, z + skidthickness, 'pec') plate(x + 0.103, y + 0.066, z + skidthickness, x + 0.103 + bowtiebase, y + 0.066 + patchheight, z + skidthickness, 'pec', rotate90origin=rotate90origin)
# Rx extension section (lower y) # Rx extension section (lower y)
plate(x + 0.044, y + 0.024, z + skidthickness, x + 0.044 + bowtiebase, y + 0.024 + patchheight, z + skidthickness, 'pec') plate(x + 0.044, y + 0.024, z + skidthickness, x + 0.044 + bowtiebase, y + 0.024 + patchheight, z + skidthickness, 'pec', rotate90origin=rotate90origin)
# Tx extension section (lower y) # Tx extension section (lower y)
plate(x + 0.103, y + 0.024, z + skidthickness, x + 0.103 + bowtiebase, y + 0.024 + patchheight, z + skidthickness, 'pec') plate(x + 0.103, y + 0.024, z + skidthickness, x + 0.103 + bowtiebase, y + 0.024 + patchheight, z + skidthickness, 'pec', rotate90origin=rotate90origin)
# Skid # Skid
box(x, y, z, x + casesize[0], y + casesize[1], z + skidthickness, 'hdpe') box(x, y, z, x + casesize[0], y + casesize[1], z + skidthickness, 'hdpe', rotate90origin=rotate90origin)
# Geometry views # Geometry views
#geometry_view(x - dx, y - dy, z - dz, x + casesize[0] + dx, y + casesize[1] + dy, z + skidthickness + casesize[2] + dz, dx, dy, dz, 'antenna_like_GSSI_1500') #geometry_view(x - dx, y - dy, z - dz, x + casesize[0] + dx, y + casesize[1] + dy, z + skidthickness + casesize[2] + dz, dx, dy, dz, 'antenna_like_GSSI_1500')
@@ -156,23 +165,24 @@ def antenna_like_GSSI_1500(x, y, z, resolution=0.001, **kwargs):
# Excitation - Gaussian pulse # Excitation - Gaussian pulse
print('#waveform: gaussian 1 {} myGaussian'.format(excitationfreq)) print('#waveform: gaussian 1 {} myGaussian'.format(excitationfreq))
print('#transmission_line: y {} {} {} {} myGaussian'.format(tx[0], tx[1], tx[2], sourceresistance)) transmission_line('y', tx[0], tx[1], tx[2], sourceresistance, 'myGaussian', dxdy=(resolution, resolution), rotate90origin=rotate90origin)
# Output point - receiver bowtie # Output point - receiver bowtie
if resolution == 0.001: if resolution == 0.001:
edge(tx[0] - 0.059, tx[1], tx[2], tx[0] - 0.059, tx[1] + dy, tx[2], 'rxres') edge(tx[0] - 0.059, tx[1], tx[2], tx[0] - 0.059, tx[1] + dy, tx[2], 'rxres', rotate90origin=rotate90origin)
print('#rx: {} {} {} rxbowtie Ey'.format(tx[0] - 0.059, tx[1], tx[2])) rx(tx[0] - 0.059, tx[1], tx[2], identifier='rxbowtie', to_save=[output], polarisation='y', dxdy=(resolution, resolution), rotate90origin=rotate90origin)
elif resolution == 0.002: elif resolution == 0.002:
edge(tx[0] - 0.058, tx[1], tx[2], tx[0] - 0.058, tx[1] + dy, tx[2], 'rxres') edge(tx[0] - 0.058, tx[1], tx[2], tx[0] - 0.058, tx[1] + dy, tx[2], 'rxres', rotate90origin=rotate90origin)
print('#rx: {} {} {} rxbowtie Ey'.format(tx[0] - 0.058, tx[1], tx[2])) rx(tx[0] - 0.058, tx[1], tx[2], identifier='rxbowtie', to_save=[output], polarisation='y', dxdy=(resolution, resolution), rotate90origin=rotate90origin)
def antenna_like_MALA_1200(x, y, z, resolution=0.001, **kwargs): def antenna_like_MALA_1200(x, y, z, resolution=0.001, rotate90=False, **kwargs):
"""Inserts a description of an antenna similar to the MALA 1.2GHz antenna. Can be used with 1mm (default) or 2mm spatial resolution. The external dimensions of the antenna are 184x109x46mm. One output point is defined between the arms of the receiever bowtie. The bowties are aligned with the y axis so the output is the y component of the electric field. """Inserts a description of an antenna similar to the MALA 1.2GHz antenna. Can be used with 1mm (default) or 2mm spatial resolution. The external dimensions of the antenna are 184x109x46mm. One output point is defined between the arms of the receiever bowtie. The bowties are aligned with the y axis so the output is the y component of the electric field.
Args: Args:
x, y, z (float): Coordinates of a location in the model to insert the antenna. Coordinates are relative to the geometric centre of the antenna in the x-y plane and the bottom of the antenna skid in the z direction. x, y, z (float): Coordinates of a location in the model to insert the antenna. Coordinates are relative to the geometric centre of the antenna in the x-y plane and the bottom of the antenna skid in the z direction.
resolution (float): Spatial resolution for the antenna model. resolution (float): Spatial resolution for the antenna model.
rotate90 (bool): Rotate model 90 degrees CCW in xy plane.
kwargs (dict): Optional variables, e.g. can be fed from an optimisation process. kwargs (dict): Optional variables, e.g. can be fed from an optimisation process.
""" """
@@ -187,6 +197,14 @@ def antenna_like_MALA_1200(x, y, z, resolution=0.001, **kwargs):
skidthickness = 0.006 skidthickness = 0.006
bowtieheight = 0.025 bowtieheight = 0.025
# Set origin for rotation to geometric centre of antenna in x-y plane if required
if rotate90:
rotate90origin = (x, y)
output = 'Ex'
else:
rotate90origin = ()
output = 'Ey'
# Unknown properties # Unknown properties
if kwargs: if kwargs:
excitationfreq = kwargs['excitationfreq'] excitationfreq = kwargs['excitationfreq']
@@ -247,125 +265,133 @@ def antenna_like_MALA_1200(x, y, z, resolution=0.001, **kwargs):
# Antenna geometry # Antenna geometry
# Shield - metallic enclosure # Shield - metallic enclosure
box(x, y, z + skidthickness, x + casesize[0], y + casesize[1], z + skidthickness + casesize[2], 'pec') box(x, y, z + skidthickness, x + casesize[0], y + casesize[1], z + skidthickness + casesize[2], 'pec', rotate90origin=rotate90origin)
box(x + 0.020, y + casethickness, z + skidthickness, x + 0.100, y + casesize[1] - casethickness, z + skidthickness + casethickness, 'free_space') box(x + 0.020, y + casethickness, z + skidthickness, x + 0.100, y + casesize[1] - casethickness, z + skidthickness + casethickness, 'free_space', rotate90origin=rotate90origin)
box(x + 0.100, y + casethickness, z + skidthickness, x + casesize[0] - casethickness, y + casesize[1] - casethickness, z + skidthickness + casethickness, 'free_space') box(x + 0.100, y + casethickness, z + skidthickness, x + casesize[0] - casethickness, y + casesize[1] - casethickness, z + skidthickness + casethickness, 'free_space', rotate90origin=rotate90origin)
# Absorber material # Absorber material
box(x + 0.020, y + casethickness, z + skidthickness, x + 0.100, y + casesize[1] - casethickness, z + skidthickness + casesize[2] - casethickness, 'absorber') box(x + 0.020, y + casethickness, z + skidthickness, x + 0.100, y + casesize[1] - casethickness, z + skidthickness + casesize[2] - casethickness, 'absorber', rotate90origin=rotate90origin)
box(x + 0.100, y + casethickness, z + skidthickness, x + casesize[0] - casethickness, y + casesize[1] - casethickness, z + skidthickness + casesize[2] - casethickness, 'absorber') box(x + 0.100, y + casethickness, z + skidthickness, x + casesize[0] - casethickness, y + casesize[1] - casethickness, z + skidthickness + casesize[2] - casethickness, 'absorber', rotate90origin=rotate90origin)
# Shield - cylindrical sections # Shield - cylindrical sections
cylinder(x + 0.055, y + casesize[1] - 0.008, z + skidthickness, x + 0.055, y + casesize[1] - 0.008, z + skidthickness + casesize[2] - casethickness, 0.008, 'pec') cylinder(x + 0.055, y + casesize[1] - 0.008, z + skidthickness, x + 0.055, y + casesize[1] - 0.008, z + skidthickness + casesize[2] - casethickness, 0.008, 'pec', rotate90origin=rotate90origin)
cylinder(x + 0.055, y + 0.008, z + skidthickness, x + 0.055, y + 0.008, z + skidthickness + casesize[2] - casethickness, 0.008, 'pec') cylinder(x + 0.055, y + 0.008, z + skidthickness, x + 0.055, y + 0.008, z + skidthickness + casesize[2] - casethickness, 0.008, 'pec', rotate90origin=rotate90origin)
cylinder(x + 0.147, y + casesize[1] - 0.008, z + skidthickness, x + 0.147, y + casesize[1] - 0.008, z + skidthickness + casesize[2] - casethickness, 0.008, 'pec') cylinder(x + 0.147, y + casesize[1] - 0.008, z + skidthickness, x + 0.147, y + casesize[1] - 0.008, z + skidthickness + casesize[2] - casethickness, 0.008, 'pec', rotate90origin=rotate90origin)
cylinder(x + 0.147, y + 0.008, z + skidthickness, x + 0.147, y + 0.008, z + skidthickness + casesize[2] - casethickness, 0.008, 'pec') cylinder(x + 0.147, y + 0.008, z + skidthickness, x + 0.147, y + 0.008, z + skidthickness + casesize[2] - casethickness, 0.008, 'pec', rotate90origin=rotate90origin)
cylinder(x + 0.055, y + casesize[1] - 0.008, z + skidthickness, x + 0.055, y + casesize[1] - 0.008, z + skidthickness + casesize[2] - casethickness, 0.007, 'free_space') cylinder(x + 0.055, y + casesize[1] - 0.008, z + skidthickness, x + 0.055, y + casesize[1] - 0.008, z + skidthickness + casesize[2] - casethickness, 0.007, 'free_space', rotate90origin=rotate90origin)
cylinder(x + 0.055, y + 0.008, z + skidthickness, x + 0.055, y + 0.008, z + skidthickness + casesize[2] - casethickness, 0.007, 'free_space') cylinder(x + 0.055, y + 0.008, z + skidthickness, x + 0.055, y + 0.008, z + skidthickness + casesize[2] - casethickness, 0.007, 'free_space', rotate90origin=rotate90origin)
cylinder(x + 0.147, y + casesize[1] - 0.008, z + skidthickness, x + 0.147, y + casesize[1] - 0.008, z + skidthickness + casesize[2] - casethickness, 0.007, 'free_space') cylinder(x + 0.147, y + casesize[1] - 0.008, z + skidthickness, x + 0.147, y + casesize[1] - 0.008, z + skidthickness + casesize[2] - casethickness, 0.007, 'free_space', rotate90origin=rotate90origin)
cylinder(x + 0.147, y + 0.008, z + skidthickness, x + 0.147, y + 0.008, z + skidthickness + casesize[2] - casethickness, 0.007, 'free_space') cylinder(x + 0.147, y + 0.008, z + skidthickness, x + 0.147, y + 0.008, z + skidthickness + casesize[2] - casethickness, 0.007, 'free_space', rotate90origin=rotate90origin)
box(x + 0.054, y + casesize[1] - 0.016, z + skidthickness, x + 0.056, y + casesize[1] - 0.014, z + skidthickness + casesize[2] - casethickness, 'free_space') box(x + 0.054, y + casesize[1] - 0.016, z + skidthickness, x + 0.056, y + casesize[1] - 0.014, z + skidthickness + casesize[2] - casethickness, 'free_space', rotate90origin=rotate90origin)
box(x + 0.054, y + 0.014, z + skidthickness, x + 0.056, y + 0.016, z + skidthickness + casesize[2] - casethickness, 'free_space') box(x + 0.054, y + 0.014, z + skidthickness, x + 0.056, y + 0.016, z + skidthickness + casesize[2] - casethickness, 'free_space', rotate90origin=rotate90origin)
box(x + 0.146, y + casesize[1] - 0.016, z + skidthickness, x + 0.148, y + casesize[1] - 0.014, z + skidthickness + casesize[2] - casethickness, 'free_space') box(x + 0.146, y + casesize[1] - 0.016, z + skidthickness, x + 0.148, y + casesize[1] - 0.014, z + skidthickness + casesize[2] - casethickness, 'free_space', rotate90origin=rotate90origin)
box(x + 0.146, y + 0.014, z + skidthickness, x + 0.148, y + 0.016, z + skidthickness + casesize[2] - casethickness, 'free_space') box(x + 0.146, y + 0.014, z + skidthickness, x + 0.148, y + 0.016, z + skidthickness + casesize[2] - casethickness, 'free_space', rotate90origin=rotate90origin)
# PCB # PCB
box(x + 0.020, y + 0.018, z + skidthickness, x + casesize[0] - casethickness, y + casesize[1] - 0.018, z + skidthickness + pcbthickness, 'pcb') box(x + 0.020, y + 0.018, z + skidthickness, x + casesize[0] - casethickness, y + casesize[1] - 0.018, z + skidthickness + pcbthickness, 'pcb', rotate90origin=rotate90origin)
# Shield - Tx & Rx cavities # Shield - Tx & Rx cavities
box(x + 0.032, y + 0.022, z + skidthickness, x + 0.032 + cavitysize[0], y + 0.022 + cavitysize[1], z + skidthickness + cavitysize[2], 'pec') box(x + 0.032, y + 0.022, z + skidthickness, x + 0.032 + cavitysize[0], y + 0.022 + cavitysize[1], z + skidthickness + cavitysize[2], 'pec', rotate90origin=rotate90origin)
box(x + 0.032 + cavitythickness, y + 0.022 + cavitythickness, z + skidthickness, x + 0.032 + cavitysize[0] - cavitythickness, y + 0.022 + cavitysize[1] - cavitythickness, z + skidthickness + cavitysize[2], 'absorber') box(x + 0.032 + cavitythickness, y + 0.022 + cavitythickness, z + skidthickness, x + 0.032 + cavitysize[0] - cavitythickness, y + 0.022 + cavitysize[1] - cavitythickness, z + skidthickness + cavitysize[2], 'absorber', rotate90origin=rotate90origin)
box(x + 0.108, y + 0.022, z + skidthickness, x + 0.108 + cavitysize[0], y + 0.022 + cavitysize[1], z + skidthickness + cavitysize[2], 'pec') box(x + 0.108, y + 0.022, z + skidthickness, x + 0.108 + cavitysize[0], y + 0.022 + cavitysize[1], z + skidthickness + cavitysize[2], 'pec', rotate90origin=rotate90origin)
box(x + 0.108 + cavitythickness, y + 0.022 + cavitythickness, z + skidthickness, x + 0.108 + cavitysize[0] - cavitythickness, y + 0.022 + cavitysize[1] - cavitythickness, z + skidthickness + cavitysize[2], 'free_space') box(x + 0.108 + cavitythickness, y + 0.022 + cavitythickness, z + skidthickness, x + 0.108 + cavitysize[0] - cavitythickness, y + 0.022 + cavitysize[1] - cavitythickness, z + skidthickness + cavitysize[2], 'free_space', rotate90origin=rotate90origin)
# Shield - Tx & Rx cavities - joining strips # Shield - Tx & Rx cavities - joining strips
box(x + 0.032 + cavitysize[0], y + 0.022 + cavitysize[1] - 0.006, z + skidthickness + cavitysize[2] - casethickness, x + 0.108, y + 0.022 + cavitysize[1], z + skidthickness + cavitysize[2], 'pec') box(x + 0.032 + cavitysize[0], y + 0.022 + cavitysize[1] - 0.006, z + skidthickness + cavitysize[2] - casethickness, x + 0.108, y + 0.022 + cavitysize[1], z + skidthickness + cavitysize[2], 'pec', rotate90origin=rotate90origin)
box(x + 0.032 + cavitysize[0], y + 0.022, z + skidthickness + cavitysize[2] - casethickness, x + 0.108, y + 0.022 + 0.006, z + skidthickness + cavitysize[2], 'pec') box(x + 0.032 + cavitysize[0], y + 0.022, z + skidthickness + cavitysize[2] - casethickness, x + 0.108, y + 0.022 + 0.006, z + skidthickness + cavitysize[2], 'pec', rotate90origin=rotate90origin)
# PCB - replace bits chopped by TX & Rx cavities # PCB - replace bits chopped by TX & Rx cavities
box(x + 0.032 + cavitythickness, y + 0.022 + cavitythickness, z + skidthickness, x + 0.032 + cavitysize[0] - cavitythickness, y + 0.022 + cavitysize[1] - cavitythickness, z + skidthickness + pcbthickness, 'pcb') box(x + 0.032 + cavitythickness, y + 0.022 + cavitythickness, z + skidthickness, x + 0.032 + cavitysize[0] - cavitythickness, y + 0.022 + cavitysize[1] - cavitythickness, z + skidthickness + pcbthickness, 'pcb', rotate90origin=rotate90origin)
box(x + 0.108 + cavitythickness, y + 0.022 + cavitythickness, z + skidthickness, x + 0.108 + cavitysize[0] - cavitythickness, y + 0.022 + cavitysize[1] - cavitythickness, z + skidthickness + pcbthickness, 'pcb') box(x + 0.108 + cavitythickness, y + 0.022 + cavitythickness, z + skidthickness, x + 0.108 + cavitysize[0] - cavitythickness, y + 0.022 + cavitysize[1] - cavitythickness, z + skidthickness + pcbthickness, 'pcb', rotate90origin=rotate90origin)
# PCB components # PCB components
# Tx bowtie # Tx bowtie
triangle(tx[0], tx[1] - 0.001, tx[2], tx[0] - 0.026, tx[1] - bowtieheight - 0.001, tx[2], tx[0] + 0.026, tx[1] - bowtieheight - 0.001, tx[2], 0, 'pec') if resolution == 0.001:
edge(tx[0], tx[1] - 0.001, tx[2], tx[0], tx[1], tx[2], 'pec') triangle(tx[0], tx[1] - 0.001, tx[2], tx[0] - 0.026, tx[1] - bowtieheight - 0.001, tx[2], tx[0] + 0.026, tx[1] - bowtieheight - 0.001, tx[2], 0, 'pec', rotate90origin=rotate90origin)
triangle(tx[0], tx[1] + 0.002, tx[2], tx[0] - 0.026, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.026, tx[1] + bowtieheight + 0.002, tx[2], 0, 'pec') edge(tx[0], tx[1] - 0.001, tx[2], tx[0], tx[1], tx[2], 'pec', rotate90origin=rotate90origin)
edge(tx[0], tx[1] + 0.001, tx[2], tx[0], tx[1] + 0.002, tx[2], 'pec') triangle(tx[0], tx[1] + 0.002, tx[2], tx[0] - 0.026, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.026, tx[1] + bowtieheight + 0.002, tx[2], 0, 'pec', rotate90origin=rotate90origin)
edge(tx[0], tx[1] + 0.001, tx[2], tx[0], tx[1] + 0.002, tx[2], 'pec', rotate90origin=rotate90origin)
elif resolution == 0.002:
triangle(tx[0], tx[1], tx[2], tx[0] - 0.026, tx[1] - bowtieheight, tx[2], tx[0] + 0.026, tx[1] - bowtieheight, tx[2], 0, 'pec', rotate90origin=rotate90origin)
triangle(tx[0], tx[1] + 0.002, tx[2], tx[0] - 0.026, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.026, tx[1] + bowtieheight + 0.002, tx[2], 0, 'pec', rotate90origin=rotate90origin)
# Rx bowtie # Rx bowtie
triangle(tx[0] + 0.076, tx[1] - 0.001, tx[2], tx[0] + 0.076 - 0.026, tx[1] - bowtieheight - 0.001, tx[2], tx[0] + 0.076 + 0.026, tx[1] - bowtieheight - 0.001, tx[2], 0, 'pec') if resolution == 0.001:
edge(tx[0] + 0.076, tx[1] - 0.001, tx[2], tx[0] + 0.076, tx[1], tx[2], 'pec') triangle(tx[0] + 0.076, tx[1] - 0.001, tx[2], tx[0] + 0.076 - 0.026, tx[1] - bowtieheight - 0.001, tx[2], tx[0] + 0.076 + 0.026, tx[1] - bowtieheight - 0.001, tx[2], 0, 'pec', rotate90origin=rotate90origin)
triangle(tx[0] + 0.076, tx[1] + 0.002, tx[2], tx[0] + 0.076 - 0.026, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.076 + 0.026, tx[1] + bowtieheight + 0.002, tx[2], 0, 'pec') edge(tx[0] + 0.076, tx[1] - 0.001, tx[2], tx[0] + 0.076, tx[1], tx[2], 'pec', rotate90origin=rotate90origin)
edge(tx[0] + 0.076, tx[1] + 0.001, tx[2], tx[0] + 0.076, tx[1] + 0.002, tx[2], 'pec') triangle(tx[0] + 0.076, tx[1] + 0.002, tx[2], tx[0] + 0.076 - 0.026, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.076 + 0.026, tx[1] + bowtieheight + 0.002, tx[2], 0, 'pec', rotate90origin=rotate90origin)
edge(tx[0] + 0.076, tx[1] + 0.001, tx[2], tx[0] + 0.076, tx[1] + 0.002, tx[2], 'pec', rotate90origin=rotate90origin)
elif resolution == 0.002:
triangle(tx[0] + 0.076, tx[1], tx[2], tx[0] + 0.076 - 0.026, tx[1] - bowtieheight, tx[2], tx[0] + 0.076 + 0.026, tx[1] - bowtieheight, tx[2], 0, 'pec', rotate90origin=rotate90origin)
triangle(tx[0] + 0.076, tx[1] + 0.002, tx[2], tx[0] + 0.076 - 0.026, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.076 + 0.026, tx[1] + bowtieheight + 0.002, tx[2], 0, 'pec', rotate90origin=rotate90origin)
# Tx surface mount resistors (lower y coordinate) # Tx surface mount resistors (lower y coordinate)
if resolution == 0.001: if resolution == 0.001:
edge(tx[0] - 0.023, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023, tx[1] - bowtieheight - dy, tx[2], 'txreslower') edge(tx[0] - 0.023, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023, tx[1] - bowtieheight - dy, tx[2], 'txreslower', rotate90origin=rotate90origin)
edge(tx[0] - 0.023 + dx, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023 + dx, tx[1] - bowtieheight - dy, tx[2], 'txreslower') edge(tx[0] - 0.023 + dx, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023 + dx, tx[1] - bowtieheight - dy, tx[2], 'txreslower', rotate90origin=rotate90origin)
edge(tx[0], tx[1] - bowtieheight - 0.004, tx[2], tx[0], tx[1] - bowtieheight - dy, tx[2], 'txreslower') edge(tx[0], tx[1] - bowtieheight - 0.004, tx[2], tx[0], tx[1] - bowtieheight - dy, tx[2], 'txreslower', rotate90origin=rotate90origin)
edge(tx[0] + dx, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + dx, tx[1] - bowtieheight - dy, tx[2], 'txreslower') edge(tx[0] + dx, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + dx, tx[1] - bowtieheight - dy, tx[2], 'txreslower', rotate90origin=rotate90origin)
edge(tx[0] + 0.022, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.022, tx[1] - bowtieheight - dy, tx[2], 'txreslower') edge(tx[0] + 0.022, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.022, tx[1] - bowtieheight - dy, tx[2], 'txreslower', rotate90origin=rotate90origin)
edge(tx[0] + 0.022 + dx, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.022 + dx, tx[1] - bowtieheight - dy, tx[2], 'txreslower') edge(tx[0] + 0.022 + dx, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.022 + dx, tx[1] - bowtieheight - dy, tx[2], 'txreslower', rotate90origin=rotate90origin)
elif resolution == 0.002: elif resolution == 0.002:
edge(tx[0] - 0.023, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023, tx[1] - bowtieheight, tx[2], 'txreslower') edge(tx[0] - 0.023, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023, tx[1] - bowtieheight, tx[2], 'txreslower', rotate90origin=rotate90origin)
edge(tx[0] - 0.023 + dx, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023 + dx, tx[1] - bowtieheight, tx[2], 'txreslower') edge(tx[0] - 0.023 + dx, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023 + dx, tx[1] - bowtieheight, tx[2], 'txreslower', rotate90origin=rotate90origin)
edge(tx[0], tx[1] - bowtieheight - 0.004, tx[2], tx[0], tx[1] - bowtieheight, tx[2], 'txreslower') edge(tx[0], tx[1] - bowtieheight - 0.004, tx[2], tx[0], tx[1] - bowtieheight, tx[2], 'txreslower', rotate90origin=rotate90origin)
edge(tx[0] + dx, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + dx, tx[1] - bowtieheight, tx[2], 'txreslower') edge(tx[0] + dx, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + dx, tx[1] - bowtieheight, tx[2], 'txreslower', rotate90origin=rotate90origin)
edge(tx[0] + 0.020, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.020, tx[1] - bowtieheight, tx[2], 'txreslower') edge(tx[0] + 0.020, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.020, tx[1] - bowtieheight, tx[2], 'txreslower', rotate90origin=rotate90origin)
edge(tx[0] + 0.020 + dx, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.020 + dx, tx[1] - bowtieheight, tx[2], 'txreslower') edge(tx[0] + 0.020 + dx, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.020 + dx, tx[1] - bowtieheight, tx[2], 'txreslower', rotate90origin=rotate90origin)
# Tx surface mount resistors (upper y coordinate) # Tx surface mount resistors (upper y coordinate)
if resolution == 0.001: if resolution == 0.001:
edge(tx[0] - 0.023, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023, tx[1] + bowtieheight + 0.006, tx[2], 'txresupper') edge(tx[0] - 0.023, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023, tx[1] + bowtieheight + 0.006, tx[2], 'txresupper', rotate90origin=rotate90origin)
edge(tx[0] - 0.023 + dx, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023 + dx, tx[1] + bowtieheight + 0.006, tx[2], 'txresupper') edge(tx[0] - 0.023 + dx, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023 + dx, tx[1] + bowtieheight + 0.006, tx[2], 'txresupper', rotate90origin=rotate90origin)
edge(tx[0], tx[1] + bowtieheight + 0.002, tx[2], tx[0], tx[1] + bowtieheight + 0.006, tx[2], 'txresupper') edge(tx[0], tx[1] + bowtieheight + 0.002, tx[2], tx[0], tx[1] + bowtieheight + 0.006, tx[2], 'txresupper', rotate90origin=rotate90origin)
edge(tx[0] + dx, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + dx, tx[1] + bowtieheight + 0.006, tx[2], 'txresupper') edge(tx[0] + dx, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + dx, tx[1] + bowtieheight + 0.006, tx[2], 'txresupper', rotate90origin=rotate90origin)
edge(tx[0] + 0.022, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.022, tx[1] + bowtieheight + 0.006, tx[2], 'txresupper') edge(tx[0] + 0.022, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.022, tx[1] + bowtieheight + 0.006, tx[2], 'txresupper', rotate90origin=rotate90origin)
edge(tx[0] + 0.022 + dx, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.022 + dx, tx[1] + bowtieheight + 0.006, tx[2], 'txresupper') edge(tx[0] + 0.022 + dx, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.022 + dx, tx[1] + bowtieheight + 0.006, tx[2], 'txresupper', rotate90origin=rotate90origin)
elif resolution == 0.002: elif resolution == 0.002:
edge(tx[0] - 0.023, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023, tx[1] + bowtieheight + 0.006, tx[2], 'txresupper') edge(tx[0] - 0.023, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023, tx[1] + bowtieheight + 0.006, tx[2], 'txresupper', rotate90origin=rotate90origin)
edge(tx[0] - 0.023 + dx, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023 + dx, tx[1] + bowtieheight + 0.006, tx[2], 'txresupper') edge(tx[0] - 0.023 + dx, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023 + dx, tx[1] + bowtieheight + 0.006, tx[2], 'txresupper', rotate90origin=rotate90origin)
edge(tx[0], tx[1] + bowtieheight + 0.002, tx[2], tx[0], tx[1] + bowtieheight + 0.006, tx[2], 'txresupper') edge(tx[0], tx[1] + bowtieheight + 0.002, tx[2], tx[0], tx[1] + bowtieheight + 0.006, tx[2], 'txresupper', rotate90origin=rotate90origin)
edge(tx[0] + dx, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + dx, tx[1] + bowtieheight + 0.006, tx[2], 'txresupper') edge(tx[0] + dx, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + dx, tx[1] + bowtieheight + 0.006, tx[2], 'txresupper', rotate90origin=rotate90origin)
edge(tx[0] + 0.020, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.020, tx[1] + bowtieheight + 0.006, tx[2], 'txresupper') edge(tx[0] + 0.020, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.020, tx[1] + bowtieheight + 0.006, tx[2], 'txresupper', rotate90origin=rotate90origin)
edge(tx[0] + 0.020 + dx, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.020 + dx, tx[1] + bowtieheight + 0.006, tx[2], 'txresupper') edge(tx[0] + 0.020 + dx, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.020 + dx, tx[1] + bowtieheight + 0.006, tx[2], 'txresupper', rotate90origin=rotate90origin)
# Rx surface mount resistors (lower y coordinate) # Rx surface mount resistors (lower y coordinate)
if resolution == 0.001: if resolution == 0.001:
edge(tx[0] - 0.023 + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023 + 0.076, tx[1] - bowtieheight - dy, tx[2], 'rxreslower') edge(tx[0] - 0.023 + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023 + 0.076, tx[1] - bowtieheight - dy, tx[2], 'rxreslower', rotate90origin=rotate90origin)
edge(tx[0] - 0.023 + dx + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023 + dx + 0.076, tx[1] - bowtieheight - dy, tx[2], 'rxreslower') edge(tx[0] - 0.023 + dx + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023 + dx + 0.076, tx[1] - bowtieheight - dy, tx[2], 'rxreslower', rotate90origin=rotate90origin)
edge(tx[0] + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.076, tx[1] - bowtieheight - dy, tx[2], 'rxreslower') edge(tx[0] + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.076, tx[1] - bowtieheight - dy, tx[2], 'rxreslower', rotate90origin=rotate90origin)
edge(tx[0] + dx + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + dx + 0.076, tx[1] - bowtieheight - dy, tx[2], 'rxreslower') edge(tx[0] + dx + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + dx + 0.076, tx[1] - bowtieheight - dy, tx[2], 'rxreslower', rotate90origin=rotate90origin)
edge(tx[0] + 0.022 + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.022 + 0.076, tx[1] - bowtieheight - dy, tx[2], 'rxreslower') edge(tx[0] + 0.022 + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.022 + 0.076, tx[1] - bowtieheight - dy, tx[2], 'rxreslower', rotate90origin=rotate90origin)
edge(tx[0] + 0.022 + dx + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.022 + dx + 0.076, tx[1] - bowtieheight - dy, tx[2], 'rxreslower') edge(tx[0] + 0.022 + dx + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.022 + dx + 0.076, tx[1] - bowtieheight - dy, tx[2], 'rxreslower', rotate90origin=rotate90origin)
elif resolution == 0.002: elif resolution == 0.002:
edge(tx[0] - 0.023 + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023 + 0.076, tx[1] - bowtieheight, tx[2], 'rxreslower') edge(tx[0] - 0.023 + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023 + 0.076, tx[1] - bowtieheight, tx[2], 'rxreslower', rotate90origin=rotate90origin)
edge(tx[0] - 0.023 + dx + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023 + dx + 0.076, tx[1] - bowtieheight, tx[2], 'rxreslower') edge(tx[0] - 0.023 + dx + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023 + dx + 0.076, tx[1] - bowtieheight, tx[2], 'rxreslower', rotate90origin=rotate90origin)
edge(tx[0] + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.076, tx[1] - bowtieheight, tx[2], 'rxreslower') edge(tx[0] + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.076, tx[1] - bowtieheight, tx[2], 'rxreslower', rotate90origin=rotate90origin)
edge(tx[0] + dx + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + dx + 0.076, tx[1] - bowtieheight, tx[2], 'rxreslower') edge(tx[0] + dx + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + dx + 0.076, tx[1] - bowtieheight, tx[2], 'rxreslower', rotate90origin=rotate90origin)
edge(tx[0] + 0.020 + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.020 + 0.076, tx[1] - bowtieheight, tx[2], 'rxreslower') edge(tx[0] + 0.020 + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.020 + 0.076, tx[1] - bowtieheight, tx[2], 'rxreslower', rotate90origin=rotate90origin)
edge(tx[0] + 0.020 + dx + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.020 + dx + 0.076, tx[1] - bowtieheight, tx[2], 'rxreslower') edge(tx[0] + 0.020 + dx + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.020 + dx + 0.076, tx[1] - bowtieheight, tx[2], 'rxreslower', rotate90origin=rotate90origin)
# Rx surface mount resistors (upper y coordinate) # Rx surface mount resistors (upper y coordinate)
if resolution == 0.001: if resolution == 0.001:
edge(tx[0] - 0.023 + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023 + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper') edge(tx[0] - 0.023 + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023 + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper', rotate90origin=rotate90origin)
edge(tx[0] - 0.023 + dx + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023 + dx + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper') edge(tx[0] - 0.023 + dx + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023 + dx + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper', rotate90origin=rotate90origin)
edge(tx[0] + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper') edge(tx[0] + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper', rotate90origin=rotate90origin)
edge(tx[0] + dx + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + dx + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper') edge(tx[0] + dx + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + dx + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper', rotate90origin=rotate90origin)
edge(tx[0] + 0.022 + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.022 + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper') edge(tx[0] + 0.022 + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.022 + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper', rotate90origin=rotate90origin)
edge(tx[0] + 0.022 + dx + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.022 + dx + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper') edge(tx[0] + 0.022 + dx + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.022 + dx + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper', rotate90origin=rotate90origin)
elif resolution == 0.002: elif resolution == 0.002:
edge(tx[0] - 0.023 + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023 + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper') edge(tx[0] - 0.023 + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023 + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper', rotate90origin=rotate90origin)
edge(tx[0] - 0.023 + dx + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023 + dx + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper') edge(tx[0] - 0.023 + dx + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023 + dx + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper', rotate90origin=rotate90origin)
edge(tx[0] + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper') edge(tx[0] + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper', rotate90origin=rotate90origin)
edge(tx[0] + dx + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + dx + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper') edge(tx[0] + dx + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + dx + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper', rotate90origin=rotate90origin)
edge(tx[0] + 0.020 + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.020 + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper') edge(tx[0] + 0.020 + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.020 + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper', rotate90origin=rotate90origin)
edge(tx[0] + 0.020 + dx + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.020 + dx + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper') edge(tx[0] + 0.020 + dx + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.020 + dx + 0.076, tx[1] + bowtieheight + 0.006, tx[2], 'rxresupper', rotate90origin=rotate90origin)
# Skid # Skid
box(x, y, z, x + casesize[0], y + casesize[1], z + polypropylenethickness, 'polypropylene') box(x, y, z, x + casesize[0], y + casesize[1], z + polypropylenethickness, 'polypropylene', rotate90origin=rotate90origin)
box(x, y, z + polypropylenethickness, x + casesize[0], y + casesize[1], z + polypropylenethickness + hdpethickness, 'hdpe') box(x, y, z + polypropylenethickness, x + casesize[0], y + casesize[1], z + polypropylenethickness + hdpethickness, 'hdpe', rotate90origin=rotate90origin)
# Geometry views # Geometry views
#geometry_view(x - dx, y - dy, z - dz, x + casesize[0] + dx, y + casesize[1] + dy, z + casesize[2] + skidthickness + dz, dx, dy, dz, 'antenna_like_MALA_1200') #geometry_view(x - dx, y - dy, z - dz, x + casesize[0] + dx, y + casesize[1] + dy, z + casesize[2] + skidthickness + dz, dx, dy, dz, 'antenna_like_MALA_1200')
@@ -373,8 +399,8 @@ def antenna_like_MALA_1200(x, y, z, resolution=0.001, **kwargs):
# Excitation # Excitation
print('#waveform: gaussian 1.0 {} myGaussian'.format(excitationfreq)) print('#waveform: gaussian 1.0 {} myGaussian'.format(excitationfreq))
print('#voltage_source: y {} {} {} {} myGaussian'.format(tx[0], tx[1], tx[2], sourceresistance)) voltage_source('y', tx[0], tx[1], tx[2], sourceresistance, 'myGaussian', dxdy=(resolution, resolution), rotate90origin=rotate90origin)
# Output point - receiver bowtie # Output point - receiver bowtie
print('#rx: {} {} {} rxbowtie Ey'.format(tx[0] + 0.076, tx[1], tx[2])) rx(tx[0] + 0.076, tx[1], tx[2], identifier='rxbowtie', to_save=[output], polarisation='y', dxdy=(resolution, resolution), rotate90origin=rotate90origin)