>Hi all,
>
>I have what I hope is a trivial problem. I would like to
>visualize some data on a regular grid. Unfortunately, the
>coordinates of the grid notes are stored as follows:
>
>x0 x1 x2 x3 ... xn
>y0 y1 y2 y3 ... yn
>z0 z1 z2 z3 ... zn
>
>and I could not find in the documentation a way
>to refer to this data from a dx file.
>
>Could anybody point me the right direction?
>
>Thanks in advance
>Fabio Bettio


There is no trivial way to do it since you are (I think) calling for the
full expansion of a 3D mesh of size (xn * yn * zn). DX is more literal and
assumes normally that you are either providing the grid dimensions of a
fully regular mesh or that you are providing all the explicit 3-vector
position values you require.

So for example if you declare the mesh as:
origin 0 0 0
delta 1 0 0
delta 0 2 0
delta 0 0 1.5
counts 10 40 20

you'd have a nice 3D regular mesh (positions connected by cubic volumetric
elements), starting at the origin, proceeding by 1 for each X item, 2 for
each Y, and 1.5 for each Z. The mesh would have 10 * 40 * 20 positions (9 *
39 * 19 voxels).

If you had the (X,Y,Z) values for all 8000 positions, that would be OK
also. But what's not so easy is to create the object from a 10-vector of X
values times a 40-vector of Ys times a 20-vector of Zs unless you do the
following:

Create a .dx file (a header file) that describes your data as follows.
Let's assume for simplicity that you've separated the X values into their
own file, Y into their own and Z into their own. You can certainly do this
with them all together, but if the data is ASCII, you have to calculate the
byte offset to the start of the Y and Z arrays in advance (a big pain). If
the data file is binary, obviously this problem is a lot simpler. (left to
the reader)

object 1 class array type float rank 0 items 10 data file X.dat,0
object 2 class array type float rank 0 items 40 data file Y.dat,0
object 3 class array type float rank 0 items 20 data file Z.dat,0

object 4 class productarray
term 1   # the 1 refers to object 1 previously defined
term 2
term 3

object 5 class gridconnections
counts 10 40 20

object 6 class field
component "positions" value 4    # the productarray
component "connections" value 5  # the gridconnections, topologically regular


Chris Pelkie
Vice President/Scientific Visualization Producer
Conceptual Reality Presentations, Inc.
30 West Meadow Drive
Ithaca, NY 14850
[EMAIL PROTECTED]

Reply via email to