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

Home » Public Forums » archive » Re: isosurface tetrahedra question....
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: isosurface tetrahedra question.... [message #67917 is a reply to message #67896] Sat, 05 September 2009 13:54 Go to previous messageGo to previous message
ghgm2008 is currently offline  ghgm2008
Messages: 17
Registered: December 2008
Junior Member
On Sep 4, 4:43 pm, Karl <karl.w.schu...@gmail.com> wrote:
> On Sep 4, 12:21 pm, ghgm <ghgm2...@gmail.com> wrote:
>
>
>
>> Hi there,
>
>> I'm trying to create an isosurface of some 3D data and then render it
>> using IDLgrPolygon.
>
>> OK, so I have my 3D dataset of scalar values.  At each point I have
>> the X,Y, and Z coordinates which I've combined to make
>> my GEOM_XYZ array....
>
>> so here I go:
>
>> isosurface,Data_3d,
>> 0.5e-18,Outverts,Outconn,geom_xyz=GEOM_XYZ.......... err, tetrahedra
>> = ?
>
>> I don't understand what else is needed - but apparently tetrahedra
>> needs to be defined as well (another array).
>
>> Can anyone please tell me what the tetrahedra array is ?
>
>> Cheers
>
>> George.
>
> If you are happy with your 3d dataset (in a 3D array) implying a
> uniform 3D grid in space, you do not need to specify GEOM_XYZ or
> TETRAHEDRA.
>
> But if your samples are from a non-uniform distribution in space, you
> would specify the location of each sample with a coordinate in
> GEOM_XYZ.  Since these spatial vertices represent a possibly irregular
> volume and not a cube-like shape, you would describe the volume with a
> set of tetrahedra.  Each tet would be defined by a list of 4 indices
> which index into your GEOM_XYZ vertex list.
>
> The simplest possible example is:
>
> 4 samples in the data array - 1D is ok.  e.g., [4,4,4,5]
> 4 verts that are not in the same plane into GEOM_XYZ e.g., [[0,0,0],
> [1,0,0],[0,1,0],[0,0,1]]
> Set TETRAHEDRA to [0,1,2,3].
>
> If you set the isovalue to 4.5, you should get a triangle back out
> where all the Z coords are 0.5.
>
> If all you are starting with is a 3d dataset of samples, then the
> uniform grid approach will probably suffice.  It is redundant and
> unnecessary to generate vertices (and tet lists) if the data is on a
> uniform grid.  Note that you can scale the returned vertices to map
> them from sample space to your viewing space.

Karl,

Thanks for your help. Yes, I understand (finally) the idea that the
tetrahedra defines the connections
for when the data is not on a uniform grid.

Actually, my data is on a regular grid - but it is in (r, theta , phi)
coordinates.

So what I have is data_3d(256 R,30 lats,90 longs)
My X, Y and Z coords are then just (R Sin theta cos phi) etc. etc.

My question now: is r,theta,phi ok as a regular grid ? It is regular
in the sense that the tetrahedra
structure is clear - but it's not uniform in the way that a standard
'cuboid' x,y,z would be.
So I'm still wondering whether ISOSURFACE will be ok with r,theta,phi
as a grid or whether I have
to specify the x,y,and z for each point (and therefore the tetrahedra
array as well).

I'm thinking that ISOSURFACE is probably fine with r,theta,phi - and
that then your final sentence is what applies - ie,
"...you scale the returned vertices to map them from sample space to
your viewing space"

so my returned vertices are in r,theta,phi space and I then just
convert to x,y,z to
pass them to IDLgrPolygon - or something ?
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: idl routines callable from c-programs
Next Topic: IDL & HDF-5 files: Reading attributes at (unknown) list elements

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

Current Time: Fri Oct 10 08:59:53 PDT 2025

Total time taken to generate the page: 0.80220 seconds