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

Home » Public Forums » archive » Re: Coordinates and SHADE_VOLUME
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
Re: Coordinates and SHADE_VOLUME [message #12079] Mon, 29 June 1998 00:00
Terje Fredvik is currently offline  Terje Fredvik
Messages: 5
Registered: June 1998
Junior Member
David Fanning wrote:
>
> Terje Fredvik (tfredvik@astro.uio.no) writes:
>

>> The error occurs when I try to create the 3D image by using
>> polyshade(v,p,/t3d). Why? When I'm in x-mode the resulting
>> array is 450 by 650, so why does IDL want to make an array
>> too big to handle when writing to file?
>
> The PolyShade command actually creates an image. While
> this image is 450 by 650 on your display it can be at
> least a factor of 25 or so bigger than that in the PostScript
> device, since the pixel size is a least 25 times smaller.

Ok, now I see why IDL is grumpy.


> Simply execute the PolyShade command before you Set_Plot
> to PostScript and scale the image with the usual XSize
> and YSize keywords to the TV command.

I'm not sure how to do that, and still keep the coordinate
system. The way I'm doing it now is like this:


-----<IDL code>---------
; Produce a list of vertices and
; polygons describing the contour
; surface.
shade_volume,a,fac,v,p,/low


; Set up transformation and scaling
; parameters for 3D viewing
s=size(a)
scale3,xr=[0,s(1)],yr=[0,s(2)],zr=[0,s(3)], ax=ax, az=az


; Plot a coordinate system, save the 3D
; transformation
dum = fltarr(60,71)
surface,dum,xr=[0,59],yr=[0,70],zr=[0,3],/xst,/yst,/zst,/nod ata,$
/noerase, ax=ax,az=az,charsize=cs,/save,zticks=1, $
xticks=5, yticks=5,ztickname=[' ', ' ', ' '


; Create a shaded volume, use the 3D
; transformation obtained when SURFACEing.
im3D = polyshade(v,p,/t3d)


; Display the image on the screen. (This
; erases the coordinate
system)
tvscl, im3D,/t3d,ysize=15, xsize=15


; Overplot the coordinate system, using the
; 3D transformation obtained when SURFACEing
; the first time.
surface,dum,xr=[0,59],yr=[0,70],zr=[0,3],zticks=1,$
ztickname=[' ', ' ', ' '],/xst, /yst,/zst,/nodata,$
/noerase, ax=ax, az=az, charsize=cs,/t3d,xtitle='Arcsec',$
ytitle='Arcsec'


-----</IDL code>---------


I put this in after im = polyshade(v,p,/t3d) but before tvscl,
im3D,/t3d,ysize=15, xsize=15:

IF KEYWORD_SET(ps) THEN BEGIN
set_plot,'ps'
device, bits=8,/color,ysize=15, xsize=15
ENDIF


This is not very useful: the only thing that pops up on the ps file
is the coordinate system, no 3D image.

If I remove ",ysize=15, xsize=15" from the tvscl command the
result is different, but still not good at all. The ps file shows
the 3D figure on black background, with the coordinate system totally
out of scale.

I have also tried to do another SCALE3 right after I set_plot,'ps',
but that doesn't help either.


What am I doing wrong?

--

Terje Fredvik
{ http://www.uio.no/~tfredvik/ }
Re: Coordinates and SHADE_VOLUME [message #12090 is a reply to message #12079] Sat, 27 June 1998 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Terje Fredvik (tfredvik@astro.uio.no) writes:

> Another problem came up though, I can't write the image to
> file. Everything works fine when I'm plotting the images
> on the screen, but when I try to send the images to a ps-
> file, the computer responds "% Unable to allocate memory:
> to make array. Not enough space".
>
> The error occurs when I try to create the 3D image by using
> polyshade(v,p,/t3d). Why? When I'm in x-mode the resulting
> array is 450 by 650, so why does IDL want to make an array
> too big to handle when writing to file?

The PolyShade command actually creates an image. While
this image is 450 by 650 on your display it can be at
least a factor of 25 or so bigger than that in the PostScript
device, since the pixel size is a least 25 times smaller.

Simply execute the PolyShade command before you Set_Plot
to PostScript and scale the image with the usual XSize
and YSize keywords to the TV command.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Coordinates and SHADE_VOLUME [message #12092 is a reply to message #12090] Fri, 26 June 1998 00:00 Go to previous message
Terje Fredvik is currently offline  Terje Fredvik
Messages: 5
Registered: June 1998
Junior Member
Boris V. Khattatov wrote:
>
> Terje Fredvik wrote:
>
>> I'm using the SHADE_VOLUME procedure to create a set of
>> polygons that describes a surface.
>>
>> Displaying the surface is trivial, I use e.g. POLYSHADE
>> and TVSCL, but how do I display the surface together with
>> a coordinate system or inside a 3D box?
>
> You can use
>
> SURFACE, Dummy, /NODATA, XRANGE=[-10,10], .....

Yes, I could, thanks!

Another problem came up though, I can't write the image to
file. Everything works fine when I'm plotting the images
on the screen, but when I try to send the images to a ps-
file, the computer responds "% Unable to allocate memory:
to make array. Not enough space".

The error occurs when I try to create the 3D image by using
polyshade(v,p,/t3d). Why? When I'm in x-mode the resulting
array is 450 by 650, so why does IDL want to make an array
too big to handle when writing to file?


--

Terje Fredvik
{ http://www.uio.no/~tfredvik/ }
Re: Coordinates and SHADE_VOLUME [message #12103 is a reply to message #12092] Wed, 24 June 1998 00:00 Go to previous message
Boris V. Khattatov is currently offline  Boris V. Khattatov
Messages: 3
Registered: June 1998
Junior Member
You can use

SURFACE, Dummy, /NODATA, XRANGE=[-10,10], .....


Terje Fredvik wrote:

> I'm using the SHADE_VOLUME procedure to create a set of
> polygons that describes a surface.
>
> Displaying the surface is trivial, I use e.g. POLYSHADE
> and TVSCL, but how do I display the surface together with
> a coordinate system or inside a 3D box?
>
> --
>
> Terje Fredvik
> { http://www.uio.no/~tfredvik/ }
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: middle mouse button???
Next Topic: Help on Krig2d

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

Current Time: Wed Oct 08 13:41:49 PDT 2025

Total time taken to generate the page: 0.00750 seconds