diff --git a/gprMax/cmds_geometry/cylinder.py b/gprMax/cmds_geometry/cylinder.py index bfdf8e31..da3612fc 100644 --- a/gprMax/cmds_geometry/cylinder.py +++ b/gprMax/cmds_geometry/cylinder.py @@ -77,6 +77,9 @@ class Cylinder(UserObjectGeometry): logger.exception(self.__str__() + ' no materials have been specified') raise + p3 = uip.round_to_grid_static_point(p1) + p4 = uip.round_to_grid_static_point(p2) + x1, y1, z1 = uip.round_to_grid(p1) x2, y2, z2 = uip.round_to_grid(p2) @@ -123,4 +126,4 @@ class Cylinder(UserObjectGeometry): build_cylinder(x1, y1, z1, x2, y2, z2, r, grid.dx, grid.dy, grid.dz, numID, numIDx, numIDy, numIDz, averaging, grid.solid, grid.rigidE, grid.rigidH, grid.ID) dielectricsmoothing = 'on' if averaging else 'off' - logger.info(self.grid_name(grid) + f"Cylinder with face centres {x1:g}m, {y1:g}m, {z1:g}m and {x2:g}m, {y2:g}m, {z2:g}m, with radius {r:g}m, of material(s) {', '.join(materialsrequested)} created, dielectric smoothing is {dielectricsmoothing}.") + logger.info(self.grid_name(grid) + f"Cylinder with face centres {p3[0]:g}m, {p3[1]:g}m, {p3[2]:g}m and {p4[0]:g}m, {p4[1]:g}m, {p4[2]:g}m, with radius {r:g}m, of material(s) {', '.join(materialsrequested)} created, dielectric smoothing is {dielectricsmoothing}.") diff --git a/gprMax/cmds_geometry/edge.py b/gprMax/cmds_geometry/edge.py index 77e1e89c..52c3b19b 100644 --- a/gprMax/cmds_geometry/edge.py +++ b/gprMax/cmds_geometry/edge.py @@ -73,6 +73,9 @@ class Edge(UserObjectGeometry): xs, ys, zs = p1 xf, yf, zf = p2 + p3 = uip.round_to_grid_static_point(p1) + p4 = uip.round_to_grid_static_point(p2) + material = next((x for x in grid.materials if x.ID == material_id), None) if not material: @@ -107,4 +110,4 @@ class Edge(UserObjectGeometry): for k in range(zs, zf): build_edge_z(xs, ys, k, material.numID, grid.rigidE, grid.rigidH, grid.ID) - logger.info(self.grid_name(grid) + f'Edge from {xs * grid.dx:g}m, {ys * grid.dy:g}m, {zs * grid.dz:g}m, to {xf * grid.dx:g}m, {yf * grid.dy:g}m, {zf * grid.dz:g}m of material {material_id} created.') + logger.info(self.grid_name(grid) + f'Edge from {p3[0]:g}m, {p3[1]:g}m, {p3[2]:g}m, to {p4[0]:g}m, {p4[1]:g}m, {p4[2]:g}m of material {material_id} created.') diff --git a/gprMax/cmds_geometry/fractal_box.py b/gprMax/cmds_geometry/fractal_box.py index 947e4d33..e08b0656 100644 --- a/gprMax/cmds_geometry/fractal_box.py +++ b/gprMax/cmds_geometry/fractal_box.py @@ -102,6 +102,9 @@ class FractalBox(UserObjectGeometry): p1, p2 = uip.check_box_points(p1, p2, self.__str__()) xs, ys, zs = p1 xf, yf, zf = p2 + + p3 = uip.round_to_grid_static_point(p1) + p4 = uip.round_to_grid_static_point(p2) if frac_dim < 0: logger.exception(self.__str__() + ' requires a positive value for the fractal dimension') @@ -143,6 +146,6 @@ class FractalBox(UserObjectGeometry): volume.mixingmodel = mixingmodel dielectricsmoothing = 'on' if volume.averaging else 'off' - logger.info(self.grid_name(grid) + f'Fractal box {volume.ID} from {xs * grid.dx:g}m, {ys * grid.dy:g}m, {zs * grid.dz:g}m, to {xf * grid.dx:g}m, {yf * grid.dy:g}m, {zf * grid.dz:g}m with {volume.operatingonID}, fractal dimension {volume.dimension:g}, fractal weightings {volume.weighting[0]:g}, {volume.weighting[1]:g}, {volume.weighting[2]:g}, fractal seeding {volume.seed}, with {volume.nbins} material(s) created, dielectric smoothing is {dielectricsmoothing}.') + logger.info(self.grid_name(grid) + f'Fractal box {volume.ID} from {p3[0]:g}m, {p3[1]:g}m, {p3[2]:g}m, to {p4[0]:g}m, {p4[1]:g}m, {p4[2]:g}m with {volume.operatingonID}, fractal dimension {volume.dimension:g}, fractal weightings {volume.weighting[0]:g}, {volume.weighting[1]:g}, {volume.weighting[2]:g}, fractal seeding {volume.seed}, with {volume.nbins} material(s) created, dielectric smoothing is {dielectricsmoothing}.') grid.fractalvolumes.append(volume) diff --git a/gprMax/cmds_geometry/plate.py b/gprMax/cmds_geometry/plate.py index 4d896962..513ec44e 100644 --- a/gprMax/cmds_geometry/plate.py +++ b/gprMax/cmds_geometry/plate.py @@ -83,6 +83,8 @@ class Plate(UserObjectGeometry): p1, p2 = uip.check_box_points(p1, p2, self.__str__()) xs, ys, zs = p1 xf, yf, zf = p2 + p3 = uip.round_to_grid_static_point(p1) + p4 = uip.round_to_grid_static_point(p2) # Check for valid orientations if xs == xf: @@ -157,4 +159,4 @@ class Plate(UserObjectGeometry): for j in range(ys, yf): build_face_xy(i, j, zs, numIDx, numIDy, grid.rigidE, grid.rigidH, grid.ID) - logger.info(self.grid_name(grid) + f"Plate from {xs * grid.dx:g}m, {ys * grid.dy:g}m, {zs * grid.dz:g}m, to {xf * grid.dx:g}m, {yf * grid.dy:g}m, {zf * grid.dz:g}m of material(s) {', '.join(materialsrequested)} created.") + logger.info(self.grid_name(grid) + f"Plate from {p3[0]:g}m, {p3[1]:g}m, {p3[2]:g}m, to {p4[0]:g}m, {p4[1]:g}m, {p4[2]:g}m of material(s) {', '.join(materialsrequested)} created.") diff --git a/gprMax/cmds_geometry/sphere.py b/gprMax/cmds_geometry/sphere.py index f6ba2142..7056845e 100644 --- a/gprMax/cmds_geometry/sphere.py +++ b/gprMax/cmds_geometry/sphere.py @@ -76,6 +76,7 @@ class Sphere(UserObjectGeometry): # Centre of sphere xc, yc, zc = uip.round_to_grid(p1) + p2 = uip.round_to_grid_static_point(p1) # Look up requested materials in existing list of material instances materials = [y for x in materialsrequested for y in grid.materials if y.ID == x] @@ -116,4 +117,4 @@ class Sphere(UserObjectGeometry): build_sphere(xc, yc, zc, r, grid.dx, grid.dy, grid.dz, numID, numIDx, numIDy, numIDz, averaging, grid.solid, grid.rigidE, grid.rigidH, grid.ID) dielectricsmoothing = 'on' if averaging else 'off' - logger.info(self.grid_name(grid) + f"Sphere with centre {xc * grid.dx:g}m, {yc * grid.dy:g}m, {zc * grid.dz:g}m, radius {r:g}m, of material(s) {', '.join(materialsrequested)} created, dielectric smoothing is {dielectricsmoothing}.") + logger.info(self.grid_name(grid) + f"Sphere with centre {p2[0]:g}m, {p2[1]:g}m, {p2[2]:g}m, radius {r:g}m, of material(s) {', '.join(materialsrequested)} created, dielectric smoothing is {dielectricsmoothing}.") diff --git a/gprMax/cmds_geometry/triangle.py b/gprMax/cmds_geometry/triangle.py index 5a38ff3b..b15e4514 100644 --- a/gprMax/cmds_geometry/triangle.py +++ b/gprMax/cmds_geometry/triangle.py @@ -105,6 +105,10 @@ class Triangle(UserObjectGeometry): x1, y1, z1 = uip.round_to_grid(up1) x2, y2, z2 = uip.round_to_grid(up2) x3, y3, z3 = uip.round_to_grid(up3) + + p4 = uip.round_to_grid_static_point(up1) + p5 = uip.round_to_grid_static_point(up2) + p6 = uip.round_to_grid_static_point(up3) if thickness < 0: logger.exception(self.__str__() + ' requires a positive value for thickness') @@ -178,6 +182,6 @@ class Triangle(UserObjectGeometry): if thickness > 0: dielectricsmoothing = 'on' if averaging else 'off' - logger.info(self.grid_name(grid) + f"Triangle with coordinates {x1:g}m {y1:g}m {z1:g}m, {x2:g}m {y2:g}m {z2:g}m, {x3:g}m {y3:g}m {z3:g}m and thickness {thickness:g}m of material(s) {', '.join(materialsrequested)} created, dielectric smoothing is {dielectricsmoothing}.") + logger.info(self.grid_name(grid) + f"Triangle with coordinates {p3[0]:g}m {p3[1]:g}m {p3[2]:g}m, {p4[0]:g}m {p4[1]:g}m {p4[2]:g}m, {p5[0]:g}m {p5[1]:g}m {p5[2]:g}m and thickness {thickness:g}m of material(s) {', '.join(materialsrequested)} created, dielectric smoothing is {dielectricsmoothing}.") else: - logger.info(self.grid_name(grid) + f"Triangle with coordinates {x1:g}m {y1:g}m {z1:g}m, {x2:g}m {y2:g}m {z2:g}m, {x3:g}m {y3:g}m {z3:g}m of material(s) {', '.join(materialsrequested)} created.") + logger.info(self.grid_name(grid) + f"Triangle with coordinates {p3[0]:g}m {p3[1]:g}m {p3[2]:g}m, {p4[0]:g}m {p4[1]:g}m {p4[2]:g}m, {p5[0]:g}m {p5[1]:g}m {p5[2]:g}m of material(s) {', '.join(materialsrequested)} created.")