Re: XYZ plot + Normal to surface output [message #57911] |
Mon, 07 January 2008 15:19 |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
David Fanning wrote:
> a.lucas writes:
>
>> 1/ I have some xyz ASCII files and I want to plot them in a 3D view.
>> But my X and Y are not regular. Is there any way to plot them firstly
>> without any interpolation and secondly using kriging interpolation so
>> as to get regular plot.
>
> Irregular data is not a problem. But I would use object
> graphics (not necessarily a subject for beginners) to do the plotting.
> You could try iSurface, or (if you wanted something you could actually
> learn from) you could try FSC_SURFACE:
>
> http://www.dfanning.com/programs/fsc_surface.zip
Yes, object graphics is definitely the way to go.
>> 2/ I have two files (also in XYZ ASCI format), corresponding to Vx
>> and Vy of a velocity field. How can I plot the complet velocity field
>> with vectors in 2D and draped on a 3D surface ?
>
> Well, this is an ADVANCED topic, for sure. I'm not sure how I would
> do this. Maybe later I'll have a chance to think about it more.
> STREAMLINE comes to mind, and it is easy enough to draw lines
> in 3D, but something that looks good... I don't know. Maybe
> the more advanced users in the group will have some ideas. :-)
You could do this one of two ways.
The easy way would be to generate a texture map of your vectors and
apply that to your IDLgrSurface object. You'll want to look at the
TEXTURE_HIRES keyword and consider your hardware capabilities when going
this route. It may work, or it may look terrible. But it is easy.
The other way would be to create a vector field object that is a
subclass of IDLgrModel that accepts your vector data, as well as the
IDLgrSurface object as inputs and for each vector it extracts the Z data
for the head and tail of the vector and draws a vector at each grid
point. You would of course have to extract the surface Z value at the
vector tail and all of the neighboring points, determine the two
neighboring points the head falls between, calculate the normal of the
polygon bound by the tail point and these points, calculate the Z value
of the head based on the magnitude of the vector, draw the vector with
the head orthogonal to your normal, then shift the vector up in Z just a
smidgen so it floats just above your surface. This would give you the
best looking results but takes more effort up front. It would be *much*
easier if you were working with data on the same grids but I don't think
it is required.
-Rick
|
|
|
Re: XYZ plot + Normal to surface output [message #57928 is a reply to message #57911] |
Mon, 07 January 2008 07:12  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
a.lucas@geolnet.net writes:
> I am a beginner in IDL programing and I am looking for a few
> things :
Of course, you are. All of the impossible questions come
from beginners. Experience brings resignation and the
proper level of expectation. :-(
> 1/ I have some xyz ASCII files and I want to plot them in a 3D view.
> But my X and Y are not regular. Is there any way to plot them firstly
> without any interpolation and secondly using kriging interpolation so
> as to get regular plot.
Irregular data is not a problem. But I would use object
graphics (not necessarily a subject for beginners) to do the plotting.
You could try iSurface, or (if you wanted something you could actually
learn from) you could try FSC_SURFACE:
http://www.dfanning.com/programs/fsc_surface.zip
You could try kriging your data first with KRIG2D, but I've never
used it, and it looks hard to me. (I'm always leery of IDL routines
you have to Google to learn anything about.)
> 2/ I have two files (also in XYZ ASCI format), corresponding to Vx
> and Vy of a velocity field. How can I plot the complet velocity field
> with vectors in 2D and draped on a 3D surface ?
Well, this is an ADVANCED topic, for sure. I'm not sure how I would
do this. Maybe later I'll have a chance to think about it more.
STREAMLINE comes to mind, and it is easy enough to draw lines
in 3D, but something that looks good... I don't know. Maybe
the more advanced users in the group will have some ideas. :-)
> 3/ Using two XYZ files (ASCII format), If I plot them in the same
> frame I thus get two surfaces S1 and S2. I want to output the
> difference between S1 and S2 but in the normal frame of S1 (in this
> case S1 is below S2). Imagine 2 topographies where S1 is below S2.
I think I would just do something like this:
IDL> FSC_Surface, S2-S1
You might have to grid your XYZ data to get these surfaces.
If it is an easy job, something involving TRIANGULATE and TRIGRID
will probably work. If it is more complicated, I would look at
GRIDDATA.
Take it slowly. In 15-20 years you might have enough experience
to solve this problem. ;-)
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.")
|
|
|