你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 23:14:03 +08:00
report position of geometry object relative to main grid
这个提交包含在:
@@ -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}.")
|
||||
|
@@ -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.')
|
||||
|
@@ -103,6 +103,9 @@ class FractalBox(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)
|
||||
|
||||
if frac_dim < 0:
|
||||
logger.exception(self.__str__() + ' requires a positive value for the fractal dimension')
|
||||
raise ValueError
|
||||
@@ -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)
|
||||
|
@@ -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.")
|
||||
|
@@ -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}.")
|
||||
|
@@ -106,6 +106,10 @@ class Triangle(UserObjectGeometry):
|
||||
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')
|
||||
raise ValueError
|
||||
@@ -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.")
|
||||
|
在新工单中引用
屏蔽一个用户