你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 15:10:13 +08:00
updated the pre-commit-config.yaml file by updating the versions of black and pre-commit-hooks.
这个提交包含在:
@@ -7,12 +7,12 @@ from . import slice
|
||||
def convert_meshes(meshes, discretization, parallel=True):
|
||||
scale, shift, shape = slice.calculate_scale_shift(meshes, discretization)
|
||||
vol = np.zeros(shape[::-1], dtype=np.int8)
|
||||
vol.fill(-1) # Fill array with -1 to indicate background in gprMax
|
||||
vol.fill(-1) # Fill array with -1 to indicate background in gprMax
|
||||
|
||||
for mesh_ind, org_mesh in enumerate(meshes):
|
||||
slice.scale_and_shift_mesh(org_mesh, scale, shift)
|
||||
cur_vol = slice.mesh_to_plane(org_mesh, shape, parallel)
|
||||
vol[cur_vol] = mesh_ind # Removed plus 1 to work with gprMax material indexing
|
||||
vol[cur_vol] = mesh_ind # Removed plus 1 to work with gprMax material indexing
|
||||
|
||||
return vol, scale, shift
|
||||
|
||||
|
@@ -16,10 +16,10 @@ if __name__ == "__main__":
|
||||
description="Allows the user to convert a STL files to voxelized mesh.",
|
||||
usage="cd gprMax; python -m toolboxes.STLtoVoxel.stltovoxel stlfilename -matindex -dxdydz",
|
||||
)
|
||||
parser.add_argument("stlfiles", help="can be the filename of a single STL file, or the path to folder containing multiple STL files")
|
||||
parser.add_argument(
|
||||
"-dxdydz", type=float, required=True, help="discretisation to use in voxelisation process"
|
||||
"stlfiles", help="can be the filename of a single STL file, or the path to folder containing multiple STL files"
|
||||
)
|
||||
parser.add_argument("-dxdydz", type=float, required=True, help="discretisation to use in voxelisation process")
|
||||
args = parser.parse_args()
|
||||
|
||||
if os.path.isdir(args.stlfiles):
|
||||
@@ -52,4 +52,4 @@ if __name__ == "__main__":
|
||||
# for i, file in enumerate(files):
|
||||
# name = os.path.splitext(os.path.basename(file))[0]
|
||||
# f.write(f"#material: {i + 1} 0 1 0 {name}" + "\n")
|
||||
# logger.info(f"Written materials file: {filename_mats}")
|
||||
# logger.info(f"Written materials file: {filename_mats}")
|
||||
|
在新工单中引用
屏蔽一个用户