This is now logged with RSInc as a bug.
RSI also give a workaround: Using IDL's REVERSE() function to
reverse() all the arrays in question.
Surprisingly, it even works if you reverse the arrays in earlier IDL
versions, (at least in 5.2) so there is no need for version-dependent
code here.
(Hopefully, when they fix the bug in a future version, code modified
with reverse will still work.)
See code below.
- Kristian
; Document a problem with hidden lines in SURFACE in IDL version 5.5
and 5.6:
; Make up some surface data:
x=-2.447+findgen(204)/203*(16.3659+2.447)
y=14.0+findgen(181)/180*(18.5-14.0)
z=1/(1+(x/8)^4)#(1/(1+(y-16.5)^6))*2500
; It also works to have x and y the same SIZE as z:
xx=x#(1+y-y)
yy=(1+x-x)#y
; Apply the following nonlinear transformation:
kvec=4.81949
degree=!pi/180.
xxx =kvec*sin(xx*degree)
yyy =kvec*sqrt(1+cos(xx*degree)^2-2*cos(xx*degree)*cos(yy*degree ))
; Now xxx and yyy are not on a rectangular grid.
surface,z,x,y,ax=45,az=-30,/hor ; Right in 5.2 and 5.6
surface,z,xx,yy,ax=45,az=-30,/hor ; Right in 5.2 and 5.6
surface,z,xxx,yyy,ax=45,az=-30,/hor ; Right in 5.2. Wrong in 5.6
shade_surf,z,x,y,ax=45,az=-30,/hor ; Right in 5.2 and 5.6
shade_surf,z,xx,yy,ax=45,az=-30,/hor ; Right in 5.2 and 5.6
shade_surf,z,xxx,yyy,ax=45,az=-30,/hor ; Right in 5.2. Wrong in 5.6
; All of the following come out right in both 5.2 and 5.6:
surface,reverse(z),reverse(x),reverse(y),ax=45,az=-30,/hor
surface,reverse(z),reverse(xx),reverse(yy),ax=45,az=-30,/hor
surface,reverse(z),reverse(xxx),reverse(yyy),ax=45,az=-30,/h or
shade_surf,reverse(z),reverse(x),reverse(y),ax=45,az=-30,/ho r
shade_surf,reverse(z),reverse(xx),reverse(yy),ax=45,az=-30,/ hor
shade_surf,reverse(z),reverse(xxx),reverse(yyy),ax=45,az=-30 ,/hor
|