你已经派生过 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.
这个提交包含在:
@@ -1,14 +1,14 @@
|
||||
# See https://pre-commit.com for more information
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v2.0.0
|
||||
rev: v3.3.0
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
- id: end-of-file-fixer
|
||||
- id: check-yaml
|
||||
- id: check-added-large-files
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 23.3.0
|
||||
rev: 23.7.0
|
||||
hooks:
|
||||
- id: black
|
||||
args: ["--line-length", "120"] # Adjust the max line length value as needed.
|
||||
|
@@ -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):
|
||||
|
在新工单中引用
屏蔽一个用户