Axes for 3D volumes [message #52478] |
Wed, 07 February 2007 12:32  |
Richard Edgar
Messages: 8 Registered: February 2006
|
Junior Member |
|
|
Greetings,
I am attempting to produce 3D isosurfaces in IDL, and I'd like to add
proper axes to the output. I've been following the example on
http://www.dfanning.com/tips/volume_axes.html
and with that, I can get axes which are labeled by cell number:
Surface, Dist(30), /NoData, $
xtitle="Radius",ytitle="Azimuth",ztitle="Z",$
XRange=s1, YRange=s2, ZRange=s3,$
/NoErase, /Save
SHADE_VOLUME,dens,densSurface,vertices,polys,/LOW
image = POLYSHADE(vertices,polys,/T3D,XSIZE=600,YSIZE=600)
where dens[i,j,k] is the 3D array I want to construct the isosurface
from, and s1=[0,imax] etc.
I'd like the axes labeled by the physical dimensions of dens. I have
these available, in rRange, phiRange and zRange (they're actually polar
co-ordinates, but I'm happy to treat them as cartesian). If I try
Surface, Dist(30), /NoData, $
xtitle="Radius",ytitle="Azimuth",ztitle="Z",$
XRange=rRange, YRange=phiRange, ZRange=zRange,$
/NoErase, /Save
I get
% POLYSHADE: Polygon 0 is degenerate, more may exist.
and an empty set of axes.
I have the impression that something, somehwere, is not communicating
the axis scaling correctly, but I'm at a loss as to what. The {xyz}range
keywords to SHADE_VOLUME don't seem to be the answer.
What extra incantation(s) do I need to get the axes labeled properly?
Thanks in advance,
Richard Edgar
|
|
|
Re: Axes for 3D volumes [message #52630 is a reply to message #52478] |
Mon, 19 February 2007 07:52  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Richard Edgar writes:
> I am attempting to produce 3D isosurfaces in IDL, and I'd like to add
> proper axes to the output. I've been following the example on
> http://www.dfanning.com/tips/volume_axes.html
> and with that, I can get axes which are labeled by cell number:
>
> Surface, Dist(30), /NoData, $
> xtitle="Radius",ytitle="Azimuth",ztitle="Z",$
> XRange=s1, YRange=s2, ZRange=s3,$
> /NoErase, /Save
>
> SHADE_VOLUME,dens,densSurface,vertices,polys,/LOW
>
> image = POLYSHADE(vertices,polys,/T3D,XSIZE=600,YSIZE=600)
>
> where dens[i,j,k] is the 3D array I want to construct the isosurface
> from, and s1=[0,imax] etc.
>
> I'd like the axes labeled by the physical dimensions of dens. I have
> these available, in rRange, phiRange and zRange (they're actually polar
> co-ordinates, but I'm happy to treat them as cartesian). If I try
>
> Surface, Dist(30), /NoData, $
> xtitle="Radius",ytitle="Azimuth",ztitle="Z",$
> XRange=rRange, YRange=phiRange, ZRange=zRange,$
> /NoErase, /Save
>
> I get
> % POLYSHADE: Polygon 0 is degenerate, more may exist.
> and an empty set of axes.
>
> I have the impression that something, somehwere, is not communicating
> the axis scaling correctly, but I'm at a loss as to what. The {xyz}range
> keywords to SHADE_VOLUME don't seem to be the answer.
>
> What extra incantation(s) do I need to get the axes labeled properly?
I would try saving the data coordinate system from the first
surface plot (!X, !Y, !Z and !P) and restoring it *after* the
second surface plot command and *before* you call Shade_Volume.
That way, you should be able to get your POLYSHADE on the right
set of axes.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|