@@ -254,10 +254,10 @@ an approximate isosurface by the method of marching tetrahedra.
254254function marchingTetrahedra (lsf:: AbstractArray{T,3} , iso:: Real , eps:: Real , indextype:: Type{IT} ) where {T<: Real , IT <: Integer }
255255 vertex_eltype = promote_type (T, typeof (iso), typeof (eps))
256256 vts = Dict {indextype, Point{3,vertex_eltype}} ()
257- fcs = Array {Face{3,indextype}} (0 )
257+ fcs = Array {Face{3,indextype}} (undef, 0 )
258258 sizehint! (vts, div (length (lsf),8 ))
259259 sizehint! (fcs, div (length (lsf),4 ))
260- const vxidx = VoxelIndices {indextype} ()
260+ vxidx = VoxelIndices {indextype} ()
261261 # process each voxel
262262 (nx:: indextype ,ny:: indextype ,nz:: indextype ) = size (lsf)
263263 vals = zeros (T, 8 )
@@ -307,36 +307,20 @@ function _correct_vertices!(vts, sdf::SignedDistanceField)
307307 end
308308end
309309
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-
326310struct MarchingTetrahedra{T} <: AbstractMeshingAlgorithm
327311 iso:: T
328312 eps:: T
329313end
330314
331315MarchingTetrahedra (iso:: T1 = 0.0 , eps:: T2 = 1e-3 ) where {T1, T2} = MarchingTetrahedra {promote_type(T1, T2)} (iso, eps)
332316
333- function (:: Type{MT} )(sdf:: SignedDistanceField , method:: MarchingTetrahedra ):: MT where {MT <: AbstractMesh }
317+ function (:: Type{MT} )(sdf:: SignedDistanceField , method:: MarchingTetrahedra ) where {MT <: AbstractMesh }
334318 vts, fcs = isosurface (sdf. data, method. iso, method. eps)
335319 _correct_vertices! (vts, sdf)
336- MT (vts, fcs)
320+ MT (vts, fcs):: MT
337321end
338322
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}
340324 vts, fcs = isosurface (volume, convert (T, method. iso), convert (T, method. eps))
341- MT (vts, fcs)
325+ MT (vts, fcs):: MT
342326end
0 commit comments