On January 6, 2004 06:19 pm, Allen H. Nugent wrote:
> Dear Fred,
Hi Allen,
> I have been struggling with this kind of problem for 2 months. DX does not
> seem to care much for closed surfaces (eg. {Connect} will fail because it
> expects an open surface with a single, all-purpose normal).
Here's my current solution for plotting a spherical function, that is
r=r(theta,phi). I'm sure it's not the best way, but it works and doesn't
require creating volumetric data and then finding the isosurface.
My spherical data lives on a regular theta phi grid. I.e. theta goes
from 0 to Pi, and phi from 0 to 2Pi, with spacing of dtheta and dphi,
respectively. The radial coordinate is a function of theta and phi,
so r=r(theta, phi). I wrote a quick (external) program that takes
a file of these points these points and creates a dx file.
The "algorithm" is essentially as
follows:
- read in all (r,theta,phi)
- for each point, list x,y,z
- now write out the triangle corner points. This requires some
book-keeping, and a wayto count the points. It is not a difficult
mapping.
- write out the values of the function atthose points (i just chose
a constant of zero).
Before each chunk of output though you need to add the write lines
for the dx parser.
That's it.
Cheers,
Fred
> I have been experimenting on a somewhat more complex geometry than your
> sounds, and I have just verified a new approach. I write a file that
> contains 3 sets of coords: 1 representing the surface, 1 representing an
> inner layer, and 1 representing an outer layer. The data component is then
> a flag: "0" for the actual surface, "1" for the inner layer, and "-1" for
> the outer layer. I then use {AutoGrid} to form a cubic grid and
> {Isosurface} (with <value> set to "0") to render the surface.
>
> It sort of works, but is a bit patchy and glitchy, and wastes time and
> memory, so I'm trying to figure out where to go next.
>
> I think you can forget about an elegant, generic solution to this problem
> until some one writes such a module.
>
> I would be interested in the technique you used to form the connections,
> because I think native DX format will turn out to be the only way I can get
> satisfaction.