>Hi there,
>
>Sorry if this is a newbie question, but...
>
>I'm trying to visualize a 3D grid (of charge density)
>which is not rectangular, but does have regularly spaced data
>points.  (It's actually a hexagonal grid.)  In particular,
>I'm having problems getting the data prompter to accept my
>deltas (which need to be vectors rather than scalars) in
>its input fields.
>
>For example, I'd like to set-up a grid having the
>following characteristics:
>
>origin         = 0,0,0
>delta_1        = 1, -1, 0
>delta_2        = 0, 1, 0
>delta_3        = 0, 0, 1
>
>
>Is such a thing possible?
>


The idea is interesting but unfortunately doomed by lack of a "hexagon"
connections element in DX (currently: anyone want to write one?). Also
unfortunately, there is no compact representation of such a mesh of
positions. The origin/delta/counts scheme can construct regular orthogonal
or skewed position meshes only. After that, you must write out the list
explicitly even though we perceive a regular structure in a hex tiling. The
best you can do with what DX has is
delta_1 1,0
delta_2 0.7,0.7
For 2D, this will create vertices that could be thought of as the border
and center of a hex pattern, but of course, it only covers a domain in
about half of the positive X, positive Y region.  (by the way, if you are
describing a hexagon, I assume you mean 2D, therefore you should not
designate a 3rd delta which tells DX the object is 3D; if you are
describing 3D, I think we need to talk about hexahedral objects (also not
currently supported)).

The only connection elements available natively are:
(no connections) for scattered data
lines for 1D
triangles and quads for 2D
cubes and tetrahedra for 3D
theoretically, cubesNd for >3D (never saw one myself, though if myself
yesterday got together with myself today and tomorrow, maybe we ARE seeing
one!)

also, the less useful Faces,Loops,Edges (better for GIS type applications)

So, you will need to create triangular subdivisions of your hexagons, which
of course means writing out a long series of integer 3-vectors indicating
the position indices (0-based) of the vertices of each triangle. You only
need list each position in the position list once, but on average, you will
use the same position index about 6 times (depending on how you
triangulate) (kind of hard to draw an example, but if you draw a hexagon,
pick a vertex and connect it to all currently non-connected vertices, you
subdivide it into 4 triangles. After tiling the surface, some vertices are
shared by 8, some by 4, and of course edges are 1,2,4, or 6). If your data
is position-dependent, you don't need to do anything else to visualize it.
If connection (hex) dependent in your data set, you'll also need to assign
the same data value to the 4 internal triangle elements, thus expanding the
size of your data array by 4x. This is all done by a custom filter program
that you write that outputs a DX native file format containing positions,
triangular connection elements, and data that maps either to position or
triangle. You can't do this degree of restructuring within DX (if you can,
I don't want to think about how difficult it would be).

The above scheme has the advantage of reducing the number of elements but
introduces a visual bias since each triangle only knows about the color
(data) of its 3 vertices. So if the data values vary around a hexagon,
you'll see discontinuities along the edges of its internal triangles when
colormapped. You might prefer to create a center point for each hexagon,
connecting 6 triangles from center to rim vertices. Then, you would see
less colormap artifacting around the center point (I think) at the expense
of having to create 50% more elements but only 25% as many new data values
(an average of the hex points assigned to the center point) than in my
previous scheme.

I know it sounds painful, but if you want to use the many visualization
capabilities that depend on interpolation (like colormapping and
isosurface), you must provide a mesh in a native DX format.

Finally, though I'm not well versed in it, there is a native "neighbors"
component that might be useful to help you traverse the adjacent hexagons,
but again, I believe you will have to construct this component yourself and
probably custom modules to do anything useful with it once you have it.
Maybe others can suggest uses for it using native modules.

Chris Pelkie
Vice President/Scientific Visualization Producer
Conceptual Reality Presentations, Inc.
30 West Meadow Drive
Ithaca, NY 14850
[EMAIL PROTECTED]
(607) 257-8335 or (607) 254-8794

Reply via email to