@@ -30,29 +30,6 @@ function Makie.plot!(ds::DrawShape{<:Tuple{Shape2}})
30
30
return ds
31
31
end
32
32
33
- # Implement drawshape!() for 3D shapes.
34
- function Makie. plot! (ds:: DrawShape{<:Tuple{Shape3,Tuple{Symbol,Real}}} )
35
- res₀ = ds. res. val # fields found by examining typeof(ds) and fieldnames(typeof(ds)), etc
36
- hres = ds. hres. val
37
- vres = ds. vres. val
38
-
39
- # If hres and vres are set to valid values, use them; otherwise use res₀.
40
- hres≤ 1 && (hres = res₀)
41
- vres≥ 1 && (vres = res₀)
42
-
43
- hres> 1 || @error " hres = $hres should at least 2."
44
- vres> 1 || @error " vres = $vres should at least 2."
45
-
46
- shp = ds[1 ]
47
- cs = ds[2 ]
48
- res = (hres, vres)
49
-
50
- # Makie.convert_arguments() defined below handles this new signature.
51
- contour! (ds, shp, cs, res, levels= SVec (0.0 ); ds. attributes... )
52
-
53
- return ds
54
- end
55
-
56
33
# Define the new signature of contour!() used in drawshape!() for 2D shapes.
57
34
function Makie. convert_arguments (P:: SurfaceLike , shp:: Shape2 , res:: Tuple2{Integer} )
58
35
lower, upper = bounds (shp)
@@ -66,30 +43,3 @@ function Makie.convert_arguments(P::SurfaceLike, shp::Shape2, res::Tuple2{Intege
66
43
67
44
return convert_arguments (P, xs, ys, lvs)
68
45
end
69
-
70
- # Define the new signature of contour!() used in drawshape!() for 3D shapes.
71
- function Makie. convert_arguments (P:: SurfaceLike , shp:: Shape3 ,
72
- cs:: Tuple{Symbol,Real} , # (:x or :y or :z, intercept): cross section spec
73
- res:: Tuple2{Integer} )
74
- ax, cept = cs # axis normal to cross section, intercept
75
-
76
- ax== :x || ax== :y || ax== :z || @error " cs[1] = $(cs[1 ]) should be :x or :y or :z."
77
- nw = (ax== :x ) + 2 (ax== :y ) + 3 (ax== :z ) # nw = 1, 2, 3 for ax = :x, :y, :z
78
- nu, nv = mod1 (nw+ 1 ,3 ), mod1 (nw+ 2 ,3 )
79
-
80
- # Set the unit vectors along the u-, v-, w-axes.
81
- û = SVec (ntuple (identity,Val (3 ))) .== nu
82
- v̂ = SVec (ntuple (identity,Val (3 ))) .== nv
83
- ŵ = SVec (ntuple (identity,Val (3 ))) .== nw
84
-
85
- lower, upper = bounds (shp)
86
- ∆ = upper - lower
87
-
88
- ϵrel = EPS_REL
89
- us = range (lower[nu] - ϵrel* ∆[nu], upper[nu] + ϵrel* ∆[nu], length= res[1 ])
90
- vs = range (lower[nv] - ϵrel* ∆[nv], upper[nv] + ϵrel* ∆[nv], length= res[2 ])
91
-
92
- lvs = [level (u* û + v* v̂ + cept* ŵ, shp) for u = us, v = vs]
93
-
94
- return convert_arguments (P, us, vs, lvs)
95
- end
0 commit comments