@@ -21,7 +21,7 @@ Y = collect(0:Δ:3) .+ φ
2121Z = [(x^ 2 + y^ 2 ):: Float64 for x in X, y in Y]
2222h = rand () * (maximum (Z) - minimum (Z)) + minimum (Z)
2323
24- contourlevels = Contour. contour (X, Y, Z, h)
24+ contourlevels = Contour. contour (X, Y, Z, h; VT = SVector{ 2 ,Float64} )
2525for line in contourlevels. lines
2626 # Contour vertices lie on a circle around the origin
2727 for v in line. vertices
4242x0, y0 = (.5 , - 1.5 )
4343Z = Float64[(x - x0)^ 2 + (y - y0)^ 2 for x in X, y in Y]
4444
45- contourlevels = Contour. contour (X, Y, Z, h)
45+ contourlevels = Contour. contour (X, Y, Z, h, VT = SVector{ 2 ,Float64} )
4646for line in contourlevels. lines
4747 for v in line. vertices
4848 @test isapprox ((v[1 ] - x0)^ 2 + (v[2 ] - y0)^ 2 , h, atol= 0.01 Δ)
@@ -65,7 +65,7 @@ lines = Contour.contour(X, Y, Z, h).lines
6565
6666for line in lines
6767 @test length (line. vertices) == 2
68- d = line. vertices[2 ] - line. vertices[1 ]
68+ d = line. vertices[2 ] . - line. vertices[1 ]
6969 @test d[2 ] / d[1 ] ≈ - 1.0
7070end
7171
@@ -80,7 +80,7 @@ lines = Contour.contour(X, Y, Z, h).lines
8080
8181for line in lines
8282 @test length (line. vertices) == 2
83- d = line. vertices[2 ] - line. vertices[1 ]
83+ d = line. vertices[2 ] . - line. vertices[1 ]
8484 @test d[2 ] / d[1 ] ≈ 1.0
8585end
8686
@@ -94,7 +94,7 @@ lines = Contour.contour(X, Y, Z, h).lines
9494
9595for line in lines
9696 @test length (line. vertices) == 2
97- d = line. vertices[2 ] - line. vertices[1 ]
97+ d = line. vertices[2 ] . - line. vertices[1 ]
9898 @test d[2 ] / d[1 ] ≈ 1.0
9999end
100100
@@ -104,12 +104,12 @@ Z = float([0 1;
104104 1 0 ])
105105h = 0.9
106106
107- lines = Contour. contour (X, Y, Z, h). lines
107+ lines = Contour. contour (X, Y, Z, h, VT = SVector{ 2 , Float64} ). lines
108108@test length (lines) == 2
109109
110110for line in lines
111111 @test length (line. vertices) == 2
112- d = line. vertices[2 ] - line. vertices[1 ]
112+ d = line. vertices[2 ] . - line. vertices[1 ]
113113 @test d[2 ] / d[1 ] ≈ - 1.0
114114end
115115
@@ -120,7 +120,7 @@ R = range(1.0, stop=2.0, length=100)
120120x, y, z = real .(ζ), imag .(ζ), abs .(ζ)
121121
122122h = 1 + rand ()
123- xs, ys = coordinates (contour (x, y, z, h). lines[1 ])
123+ xs, ys = coordinates (contour (x, y, z, h, VT = SVector{ 2 , Float64} ). lines[1 ])
124124@test all (xs.^ 2 + ys.^ 2 .≈ h^ 2 )
125125
126126
@@ -131,8 +131,8 @@ zoff = OffsetArray(z, offset_x, offset_y)
131131
132132x, y = axes (z)
133133xoff, yoff = axes (zoff)
134- curves = Contour. contour (x,y,z,0.5 )
135- curves_off = Contour. contour (xoff, yoff, zoff, 0.5 )
134+ curves = Contour. contour (x,y,z,0.5 , VT = SVector{ 2 , Float64} )
135+ curves_off = Contour. contour (xoff, yoff, zoff, 0.5 ,VT = SVector{ 2 , Float64} )
136136
137137# sort offset and non-offset curves to the same order
138138offset = SVector (offset_x, offset_y)
@@ -172,7 +172,7 @@ Y = collect(-3:Δ:3)
172172Z = [(x^ 2 - y^ 2 ):: Float64 for x in X, y in Y]
173173h = rand () * (maximum (Z) - minimum (Z)) + minimum (Z)
174174
175- contourlevels = Contour. contour (X, Y, Z, h)
175+ contourlevels = Contour. contour (X, Y, Z, h) # , VT=SVector{2, Float64})
176176for line in contourlevels. lines
177177 # Contour vertices lie on a circle around the origin
178178 for v in line. vertices
0 commit comments