comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » problem with hidden lines in SURFACE in IDL version 5.5 and 5.6
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
problem with hidden lines in SURFACE in IDL version 5.5 and 5.6 [message #35023] Mon, 12 May 2003 01:03
Kristian.Kjaer is currently offline  Kristian.Kjaer
Messages: 1
Registered: May 2003
Junior Member
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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: OPLOT, yaxis scale problem
Next Topic: Internationalization

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 06:58:17 PDT 2025

Total time taken to generate the page: 1.60202 seconds