Skip to content

Commit 70e7368

Browse files
authored
Merge pull request #16 from JuliaGeometry/rd/julia-0.7
update to julia v0.7
2 parents bf110f3 + 3360e5b commit 70e7368

File tree

7 files changed

+46
-63
lines changed

7 files changed

+46
-63
lines changed

.travis.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ language: julia
33
os:
44
- linux
55
julia:
6-
- 0.6
6+
- 0.7
7+
- 1.0
78
- nightly
89
notifications:
910
email: false
@@ -13,9 +14,6 @@ branches:
1314
matrix:
1415
allow_failures:
1516
- julia: nightly
16-
# uncomment the following lines to override the default test script
17-
script:
18-
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
19-
- julia -e 'Pkg.clone(pwd()); Pkg.build("Meshing"); Pkg.test("Meshing"; coverage=true)'
2017
after_success:
21-
- julia -e 'cd(Pkg.dir("Meshing")); Pkg.add("Coverage"); using Coverage; Codecov.submit(process_folder())'
18+
- julia -e 'using Pkg; import Meshing; Pkg.add("Coverage"); using Coverage; Codecov.submit(process_folder())'
19+

REQUIRE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
julia 0.6
1+
julia 0.7
22
GeometryTypes 0.4

appveyor.yml

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
environment:
22
matrix:
3-
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.3/julia-0.3-latest-win32.exe"
4-
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.3/julia-0.3-latest-win64.exe"
5-
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
6-
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
3+
- julia_version: 0.7
4+
- julia_version: 1
5+
- julia_version: nightly
6+
7+
platform:
8+
- x86 # 32-bit
9+
- x64 # 64-bit
10+
11+
# # Uncomment the following lines to allow failures on nightly julia
12+
# # (tests will run but not make your overall status red)
13+
# matrix:
14+
# allow_failures:
15+
# - julia_version: nightly
716

817
branches:
918
only:
@@ -17,19 +26,18 @@ notifications:
1726
on_build_status_changed: false
1827

1928
install:
20-
- ps: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12"
21-
# Download most recent Julia Windows binary
22-
- ps: (new-object net.webclient).DownloadFile(
23-
$env:JULIA_URL,
24-
"C:\projects\julia-binary.exe")
25-
# Run installer silently, output to C:\projects\julia
26-
- C:\projects\julia-binary.exe /S /D=C:\projects\julia
29+
- ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1"))
2730

2831
build_script:
29-
# Need to convert from shallow to complete for Pkg.clone to work
30-
- IF EXIST .git\shallow (git fetch --unshallow)
31-
- C:\projects\julia\bin\julia -e "versioninfo();
32-
Pkg.clone(pwd(), \"Meshing\"); Pkg.build(\"Meshing\")"
32+
- echo "%JL_BUILD_SCRIPT%"
33+
- C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%"
3334

3435
test_script:
35-
- C:\projects\julia\bin\julia --check-bounds=yes -e "Pkg.test(\"Meshing\")"
36+
- echo "%JL_TEST_SCRIPT%"
37+
- C:\julia\bin\julia -e "%JL_TEST_SCRIPT%"
38+
39+
# # Uncomment to support code coverage upload. Should only be enabled for packages
40+
# # which would have coverage gaps without running on Windows
41+
# on_success:
42+
# - echo "%JL_CODECOV_SCRIPT%"
43+
# - C:\julia\bin\julia -e "%JL_CODECOV_SCRIPT%"

src/Meshing.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
VERSION >= v"0.4.0-dev+6521" && __precompile__()
2-
31
module Meshing
42

53
using GeometryTypes

src/marching_cubes.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ function marching_cubes(sdf::SignedDistanceField{3,ST,FT},
302302
# arrays for vertices and faces
303303
vts = Point{3,Float64}[]
304304
fcs = Face{3,Int}[]
305-
vertlist = Vector{Point{3,Float64}}(12)
305+
vertlist = Vector{Point{3,Float64}}(undef, 12)
306306
@inbounds for xi = 1:nx-1, yi = 1:ny-1, zi = 1:nz-1
307307

308308
#Determine the index into the edge table which

src/marching_tetrahedra.jl

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,10 @@ an approximate isosurface by the method of marching tetrahedra.
254254
function 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
308308
end
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-
326310
struct MarchingTetrahedra{T} <: AbstractMeshingAlgorithm
327311
iso::T
328312
eps::T
329313
end
330314

331315
MarchingTetrahedra(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
337321
end
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
342326
end

test/runtests.jl

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
using Meshing
2-
using Base.Test
2+
using Test
33
using GeometryTypes
44
using ForwardDiff
5+
using Profile
6+
using Statistics: mean
7+
using LinearAlgebra: dot, norm
58

69

710
@testset "meshing" begin
@@ -83,23 +86,15 @@ using ForwardDiff
8386
sdf = SignedDistanceField(f, bounds, resolution)
8487

8588
@testset "marching cubes" begin
86-
m1 = @test_nowarn marching_cubes(sdf, 0.0, GLNormalMesh)
87-
m2 = @test_nowarn GLNormalMesh(sdf, MarchingCubes())
88-
@test vertices(m1) == vertices(m2)
89-
@test faces(m1) == faces(m2)
89+
@test_nowarn GLNormalMesh(sdf, MarchingCubes())
90+
@inferred GLNormalMesh(sdf, MarchingCubes())
9091
end
9192

9293
@testset "marching tetrahedra" begin
93-
m1 = @test_warn "is deprecated" GLNormalMesh(sdf)
94-
m2 = @test_warn "is deprecated" GLNormalMesh(sdf, 1e-3)
95-
m3 = @test_nowarn GLNormalMesh(sdf, MarchingTetrahedra())
96-
@test vertices(m1) == vertices(m2) == vertices(m3)
97-
@test faces(m1) == faces(m2) == faces(m3)
98-
99-
m4 = @test_warn "is deprecated" GLNormalMesh(sdf.data, 0.5)
100-
m5 = @test_nowarn GLNormalMesh(sdf.data, MarchingTetrahedra(0.5))
101-
@test vertices(m4) == vertices(m5)
102-
@test faces(m4) == faces(m5)
94+
@test_nowarn GLNormalMesh(sdf, MarchingTetrahedra())
95+
@inferred GLNormalMesh(sdf, MarchingTetrahedra())
96+
@test_nowarn GLNormalMesh(sdf.data, MarchingTetrahedra(0.5))
97+
@inferred GLNormalMesh(sdf.data, MarchingTetrahedra(0.5))
10398
end
10499
end
105100

0 commit comments

Comments
 (0)