Skip to content

Commit 9540a30

Browse files
committed
fix compatibility with geometrytypes and julia v0.6
1 parent 4bcaefe commit 9540a30

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

REQUIRE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
julia 0.4
2-
GeometryTypes 0.1.6
1+
julia 0.6-
2+
GeometryTypes 0.2.2
33
Compat 0.8.6

src/marching_cubes.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ const tri_table = ((-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1),
278278
(-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1))
279279

280280
"""
281-
`marching_cubes(sdf::SignedDistanceField, [iso = 0.0,] [MT = HomogenousMesh{Point{3,Float64},Face{3,Int,0}}])`
281+
`marching_cubes(sdf::SignedDistanceField, [iso = 0.0,] [MT = HomogenousMesh{Point{3,Float64},Face{3,Int}}])`
282282
283283
Construct a `HomogenousMesh` from a `SignedDistanceField` using the
284284
marching cubes algorithm. This method is faster than Marching Tetrahedra
@@ -288,15 +288,15 @@ Tetrahedra guarentees a manifold mesh.
288288
"""
289289
function marching_cubes{ST,FT,M<:AbstractMesh}(sdf::SignedDistanceField{3,ST,FT},
290290
iso=0.0,
291-
MT::Type{M}=SimpleMesh{Point{3,Float64},Face{3,Int,0}})
291+
MT::Type{M}=SimpleMesh{Point{3,Float64},Face{3,Int}})
292292
nx, ny, nz = size(sdf)
293293
h = HyperRectangle(sdf)
294294
w = widths(h)
295295
s = Point{3,Float64}(w[1]/nx, w[2]/ny, w[3]/nz)
296296

297297
# arrays for vertices and faces
298298
vts = Point{3,Float64}[]
299-
fcs = Face{3,Int,0}[]
299+
fcs = Face{3,Int}[]
300300
vertlist = Vector{Point{3,Float64}}(12)
301301
@inbounds for xi = 1:nx-1, yi = 1:ny-1, zi = 1:nz-1
302302

@@ -381,7 +381,7 @@ function marching_cubes{ST,FT,M<:AbstractMesh}(sdf::SignedDistanceField{3,ST,FT}
381381
push!(vts, vertlist[tri_table[cubeindex][i+1]])
382382
push!(vts, vertlist[tri_table[cubeindex][i+2]])
383383
fct = length(vts)
384-
push!(fcs, Face{3,Int,0}(fct, fct-1, fct-2))
384+
push!(fcs, Face{3,Int}(fct, fct-1, fct-2))
385385
end
386386
end
387387
MT(vts,fcs)

src/marching_tetrahedra.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ immutable VoxelIndices{T <: Integer}
3030
tetEdgeCrnrs::NTuple{6,NTuple{2,T}}
3131
tetTri::NTuple{16,NTuple{6,T}}
3232

33-
function VoxelIndices()
33+
function VoxelIndices{T}() where {T <: Integer}
3434
voxCrnrPos = ((0, 0, 0),
3535
(0, 1, 0),
3636
(1, 1, 0),
@@ -109,7 +109,7 @@ immutable VoxelIndices{T <: Integer}
109109
(1,4,3,0,0,0),
110110
(0,0,0,0,0,0))
111111

112-
new(voxCrnrPos,
112+
new{T}(voxCrnrPos,
113113
voxEdgeCrnrs,
114114
voxEdgeDir,
115115
voxEdgeIx,
@@ -225,7 +225,7 @@ containers as necessary.
225225
function procVox{T<:Real, IType <: Integer}(vals::Vector{T}, iso::T,
226226
x::IType, y::IType, z::IType,
227227
nx::IType, ny::IType,
228-
vts::Dict{IType, Point{3,T}}, fcs::Vector{Face{3,IType,0}},
228+
vts::Dict{IType, Point{3,T}}, fcs::Vector{Face{3,IType}},
229229
eps::T, vxidx::VoxelIndices{IType})
230230

231231
# check each sub-tetrahedron in the voxel
@@ -239,7 +239,7 @@ function procVox{T<:Real, IType <: Integer}(vals::Vector{T}, iso::T,
239239
@inbounds e3 = vxidx.tetTri[tIx][j+2]
240240

241241
# add the face to the list
242-
push!(fcs, Face{3,IType,0}(
242+
push!(fcs, Face{3,IType}(
243243
getVertId(voxEdgeId(i, e1, vxidx), x, y, z, nx, ny, vals, iso, vts, eps, vxidx),
244244
getVertId(voxEdgeId(i, e2, vxidx), x, y, z, nx, ny, vals, iso, vts, eps, vxidx),
245245
getVertId(voxEdgeId(i, e3, vxidx), x, y, z, nx, ny, vals, iso, vts, eps, vxidx)))
@@ -254,7 +254,7 @@ an approximate isosurface by the method of marching tetrahedra.
254254
"""
255255
function marchingTetrahedra{T<:Real, IT <: Integer}(lsf::AbstractArray{T,3}, iso::T, eps::T, indextype::Type{IT})
256256
vts = Dict{indextype, Point{3,T}}()
257-
fcs = Array(Face{3,indextype,0}, 0)
257+
fcs = Array{Face{3,indextype}}(0)
258258
sizehint!(vts, div(length(lsf),8))
259259
sizehint!(fcs, div(length(lsf),4))
260260
const vxidx = VoxelIndices{indextype}()
@@ -284,7 +284,7 @@ function isosurface(lsf, isoval, eps, indextype=Int, index_start=one(Int))
284284
vtD[x] = k
285285
k += one(indextype)
286286
end
287-
fcAry = Face{3,indextype, index_start-1}[Face{3,indextype, index_start-1}(vtD[f[1]], vtD[f[2]], vtD[f[3]]) for f in fcs]
287+
fcAry = Face{3,indextype}[Face{3,indextype}(vtD[f[1]], vtD[f[2]], vtD[f[3]]) for f in fcs]
288288
vtAry = collect(values(vts))
289289

290290
(vtAry, fcAry)

0 commit comments

Comments
 (0)