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

Home » Public Forums » archive » Re: isurface madness?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: isurface madness? [message #70592] Thu, 22 April 2010 08:30
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Apr 22, 12:02 pm, pp <pp.pente...@gmail.com> wrote:
> I was doing something very simple, a cube in 3D, from its 6 surfaces,
> where I wanted to map a different texture on each side. For the
> coordinates of each surface, I made a 2D array, to provide isurface
> with 2D x, y and z coordinates. All went well for the two constant z
> surfaces.
>
> But for the other surfaces, either isurface is mad, or I am, as it
> seems to ignore the x coordinates I provide. I checked that the
> coordinates were generated correctly, plotting their locations, and
> they were fine, and iplot puts them on the right place.
>
> This shows the problem:
>
> ;make a square in the x=0 plane
> np=10
> x=bytarr(np,np)
> y=rebin(bindgen(np),np,np)*2
> z=rebin(reform(bindgen(np),1,np),np,np)*3
> ;see where the points fall
> iplot,reform(x,np*np),reform(y,np*np),reform(z,np*np),xtitle ='x',ytitle='y' ,ztitle='z' ;OK
> isurface,z,x,y,/over ;???
>
> The plot lines and the surface were supposed to fall on the same
> location.
>
> Note that iplot takes arguments in the order x,y,z, and isurface takes
> them as z,x,y. As you can see from the values in the x axis, it is
> ignoring the provided x (all zero), and is taking the index as the
> coordinate.
>
> Does anybody know what is going on here, and how to get this to work?

Further examination showed that the problem only happens when x is
exactly constant. If I add a little noise to it, all looks well:

;make a nearly flat square in the x=0 plane
np=10
x=bytarr(np,np)
xn=double(x)
xn[0,*]+=0.001
y=rebin(bindgen(np),np,np)*2
z=rebin(reform(bindgen(np),1,np),np,np)*3
;see where the points fall
iplot,reform(x,np*np),reform(y,np*np),reform(z,np*np),xtitle ='x',ytitle='y',ztitle='z' ;OK
isurface,z,xn,y,/over ;OK now
isurface,z,xn+1,y,/over ;OK now
[Message index]
 
Read Message
Previous Topic: isurface madness?
Next Topic: Re: Rounding off

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

Current Time: Sun Oct 12 09:16:23 PDT 2025

Total time taken to generate the page: 0.72201 seconds