@@ -254,10 +254,10 @@ an approximate isosurface by the method of marching tetrahedra.
254
254
function marchingTetrahedra (lsf:: AbstractArray{T,3} , iso:: Real , eps:: Real , indextype:: Type{IT} ) where {T<: Real , IT <: Integer }
255
255
vertex_eltype = promote_type (T, typeof (iso), typeof (eps))
256
256
vts = Dict {indextype, Point{3,vertex_eltype}} ()
257
- fcs = Array {Face{3,indextype}} (0 )
257
+ fcs = Array {Face{3,indextype}} (undef, 0 )
258
258
sizehint! (vts, div (length (lsf),8 ))
259
259
sizehint! (fcs, div (length (lsf),4 ))
260
- const vxidx = VoxelIndices {indextype} ()
260
+ vxidx = VoxelIndices {indextype} ()
261
261
# process each voxel
262
262
(nx:: indextype ,ny:: indextype ,nz:: indextype ) = size (lsf)
263
263
vals = zeros (T, 8 )
@@ -307,36 +307,20 @@ function _correct_vertices!(vts, sdf::SignedDistanceField)
307
307
end
308
308
end
309
309
310
-
311
- function (:: Type{MT} )(volume:: Array{T, 3} , iso_val:: Real , eps_val= 0.001 ) where {MT <: AbstractMesh , T}
312
- Base. depwarn (" (mesh type)(volume::Array, iso_val, eps_val) is deprecated. Please use: (mesh type)(volume, MarchingTetrahedra(iso_val, eps_val))" , :Meshing_MT_array_eps )
313
- iso_val = convert (T, iso_val)
314
- eps_val = convert (T, eps_val)
315
- vts, fcs = isosurface (volume, iso_val, eps_val)
316
- MT (vts, fcs)
317
- end
318
-
319
- function (:: Type{MT} )(df:: SignedDistanceField , eps_val= 0.001 ) where MT <: AbstractMesh
320
- Base. depwarn (" (mesh type)(sdf::SignedDistanceField, eps_val) is deprecated. Please use: (mesh type)(sdf, MarchingTetrahedra(0, eps))" , :Meshing_MT_sdf_eps )
321
- vts, fcs = isosurface (df. data, 0.0 , eps_val)
322
- _correct_vertices! (vts, df)
323
- MT (vts, fcs)
324
- end
325
-
326
310
struct MarchingTetrahedra{T} <: AbstractMeshingAlgorithm
327
311
iso:: T
328
312
eps:: T
329
313
end
330
314
331
315
MarchingTetrahedra (iso:: T1 = 0.0 , eps:: T2 = 1e-3 ) where {T1, T2} = MarchingTetrahedra {promote_type(T1, T2)} (iso, eps)
332
316
333
- function (:: Type{MT} )(sdf:: SignedDistanceField , method:: MarchingTetrahedra ):: MT where {MT <: AbstractMesh }
317
+ function (:: Type{MT} )(sdf:: SignedDistanceField , method:: MarchingTetrahedra ) where {MT <: AbstractMesh }
334
318
vts, fcs = isosurface (sdf. data, method. iso, method. eps)
335
319
_correct_vertices! (vts, sdf)
336
- MT (vts, fcs)
320
+ MT (vts, fcs):: MT
337
321
end
338
322
339
- function (:: Type{MT} ){MT <: AbstractMesh , T} (volume:: Array{T, 3} , method:: MarchingTetrahedra ):: MT
323
+ function (:: Type{MT} )(volume:: Array{T, 3} , method:: MarchingTetrahedra ) where {MT <: AbstractMesh , T}
340
324
vts, fcs = isosurface (volume, convert (T, method. iso), convert (T, method. eps))
341
- MT (vts, fcs)
325
+ MT (vts, fcs):: MT
342
326
end
0 commit comments