POV-Ray : Newsgroups : povray.newusers : Nonuniform data to povray mesh-type object Server Time
25 Nov 2024 13:40:56 EST (-0500)
  Nonuniform data to povray mesh-type object (Message 1 to 6 of 6)  
From: TJ Giese
Subject: Nonuniform data to povray mesh-type object
Date: 19 Oct 2005 14:04:49
Message: <43568ac1$1@news.povray.org>
I have a bunch of data living on a nonuniform mesh.
Meaning, more specifically, I have an electron density that lives on a Gauss-Laguerre
radial and Lebdeev angular quadrature grid points.
I would like to choose some isodensity surface and render an image of it in povray.
Having looked over the documentation for a povray mesh object, I don't immediately see
a simple algorithm that I can use that would
transform my data into something that povray can use.  If all I wanted was to view the
density, perhaps there's something better
than a mesh object that I could use, however, I eventually want to create a
well-defined surface and color map it with the electrostatic
potential... so I'm pretty sure I want to use a mesh.

My question(s)
1. Does pov-ray include any sort of ability for transforming nonuniform data into a
mesh object?
2. If not, does there already exist some open-source utility for performing this task?
3. If not, do you have any ideas of how one should go about performing this task?

Thanks in advance


Post a reply to this message

From: Alain
Subject: Re: Nonuniform data to povray mesh-type object
Date: 19 Oct 2005 16:50:39
Message: <4356b19f$1@news.povray.org>
TJ Giese nous apporta ses lumieres en ce 2005-10-19 14:04:
> I have a bunch of data living on a nonuniform mesh.
> Meaning, more specifically, I have an electron density that lives on a 
> Gauss-Laguerre radial and Lebdeev angular quadrature grid points.
> I would like to choose some isodensity surface and render an image of it 
> in povray.
> Having looked over the documentation for a povray mesh object, I don't 
> immediately see a simple algorithm that I can use that would
> transform my data into something that povray can use.  If all I wanted 
> was to view the density, perhaps there's something better
> than a mesh object that I could use, however, I eventually want to 
> create a well-defined surface and color map it with the electrostatic
> potential... so I'm pretty sure I want to use a mesh.
> 
> My question(s)
> 1. Does pov-ray include any sort of ability for transforming nonuniform 
> data into a mesh object?
> 2. If not, does there already exist some open-source utility for 
> performing this task?
> 3. If not, do you have any ideas of how one should go about performing 
> this task?
> 
> Thanks in advance
A mesh don't need to corespond to a gird of any sort. If your data are already
organised as a mesh, 
it should be relatively easy to import them into a POV Ray scene.
If you place your mesh in front of a ortogonal camera and use an apropriate gradient
pattern, you 
can get adequate isopotential lines.
You may try processing your data in Poseray to make them into an easier to manipulate
mesh or mesh2 
object.


-- 
Alain
-------------------------------------------------
BACHELOR: A man who never makes the same mistake once.


Post a reply to this message

From: TJ Giese
Subject: Re: Nonuniform data to povray mesh-type object
Date: 19 Oct 2005 21:41:43
Message: <4356f5d7$1@news.povray.org>
Alain wrote:
> TJ Giese nous apporta ses lumieres en ce 2005-10-19 14:04:
>> I have a bunch of data living on a nonuniform mesh.
>> Meaning, more specifically, I have an electron density that lives on a 
>> Gauss-Laguerre radial and Lebdeev angular quadrature grid points.
>> I would like to choose some isodensity surface and render an image of 
>> it in povray.

> A mesh don't need to corespond to a gird of any sort. If your data are 
> already organised as a mesh, it should be relatively easy to import them 
> into a POV Ray scene.

Thank you for your reply.  I appreciate it.
I thought it might be useful for me to clarify my terminology, because I
might have incorrectly used the word "mesh" in my first sentence.

My data is in the format
X1, Y1, Z1, Density1
X2, Y2, Z2, Density2
...
Xn, Yn, Zn, Densityn

where the cartesian coordinates Xi, Yi, Zi, do NOT represent verticies
of a triangle and are not equally spaced.
This format is significantly different than how I understand the mesh
object format to be, i.e.,
triangle { <X1a,Y1a,Z1a> <X1b,Y1b,Z1b> <X1c,Y1c,Z1c> }
triangle { <X2a,Y2a,Z2a> <X2b,Y2b,Z2b> <X2c,Y2c,Z2c> }
...
triangle { <Xna,Yna,Zna> <Xnb,Ynb,Znb> <Xnc,Ync,Znc> }

where <Xnm,Ynm,Znm> are the cartesian coordinates of the m'th vertex of
the n'th triangle defining a surface.

In other words, my data is a continuous function of space with varying
values of the density, whereas (from my understanding of the docs) a
mesh is an isosurface of the continuous function with the same value
of the density.

Suppose my list of data could be filtered such that I now had
Nf data points instead of n data points, where Nf<n.  The Nf data
points correspond to values to those values of the density where
|Density - isoval| < tol
where isoval is the particular isovalue defining the contour surface
and tol is some tolerance (because the densities are floating point
numbers).

To me, it seems, there now needs to be a mechanism which can form
triangles from 3 of these filtered data points at a time and yield
closed surfaces.  I think an even larger constraint is avoiding
and Nf*Nf operation, because Nf can be a very large number (it would
be nice to do this in ~10 seconds as opposed to ~10 hours).
I'll have to think about it a bit, but I'm getting the impression
that a recursive bisection routine would be needed.


Post a reply to this message

From: Mike Williams
Subject: Re: Nonuniform data to povray mesh-type object
Date: 19 Oct 2005 22:40:03
Message: <HXPSqGAWHwVDFw$T@econym.demon.co.uk>
Wasn't it TJ Giese who wrote:
>Alain wrote:
>> TJ Giese nous apporta ses lumieres en ce 2005-10-19 14:04:
>>> I have a bunch of data living on a nonuniform mesh.
>>> Meaning, more specifically, I have an electron density that lives on a 
>>> Gauss-Laguerre radial and Lebdeev angular quadrature grid points.
>>> I would like to choose some isodensity surface and render an image of 
>>> it in povray.
>
>> A mesh don't need to corespond to a gird of any sort. If your data are 
>> already organised as a mesh, it should be relatively easy to import them 
>> into a POV Ray scene.
>
>Thank you for your reply.  I appreciate it.
>I thought it might be useful for me to clarify my terminology, because I
>might have incorrectly used the word "mesh" in my first sentence.
>
>My data is in the format
>X1, Y1, Z1, Density1
>X2, Y2, Z2, Density2
>...
>Xn, Yn, Zn, Densityn
>
>where the cartesian coordinates Xi, Yi, Zi, do NOT represent verticies
>of a triangle and are not equally spaced.

My guess is that you'd be better off performing the interpolation
required to generate data for an evenly spaced grid in an external
program and outputting it as a df3 file. 

I think it would be possible to perform the interpolation inside the POV
SDL, but it would be ridiculously slow unless the number of points in
your data is quite small.

Alternatively, it might just be possible to order your points so that
you could find a way to use the warp command to warp a uniform
rectangular grid into a Gauss-Laguerre radial and Lebdev angular
quadrature grid. I don't know enough about such particular grids to be
able to determine if that's possible.

There are probably several other possible approaches. It all depends on
how many grid points you've got, how the data should be interpolated to
determine the density value at an arbitrary non-grid point, and what you
wan the output to look like.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: TJ Giese
Subject: Re: Nonuniform data to povray mesh-type object
Date: 20 Oct 2005 00:43:04
Message: <43572058$1@news.povray.org>
Mike Williams wrote:
> My guess is that you'd be better off performing the interpolation
> required to generate data for an evenly spaced grid in an external
> program and outputting it as a df3 file. 

Ah. Nice.  Based on your comment, I googled "df3" and have found
some results that are very encouraging and I include links here
so if anyone searches the news group for this topic, they will
hopefully run across these as possibilities to consider.

http://www.linuxjournal.com/article/7486

Leigh Orf describes creating a df3 file, declaring it as a povray
function, and then creating an isosurface object that acts on that
declared function, i.e.,

#declare DENSFUNC=function
{ pattern {
   density_file df3 "cloud.df3" interpolate 1
} }
isosurface {function { 0.1 - DENSFUNC(x,y,z) }


http://news.povray.org/povray.binaries.utilities/thread/%3C41605076@news.povray.org%3E/

Andrew Le Couteur Bisson describes are program he has written
that transforms a df3 file to a mesh2 object.


Post a reply to this message

From: Mike Williams
Subject: Re: Nonuniform data to povray mesh-type object
Date: 20 Oct 2005 03:24:23
Message: <ODdQPCAfP0VDFw$H@econym.demon.co.uk>
Wasn't it TJ Giese who wrote:
>Mike Williams wrote:
>> My guess is that you'd be better off performing the interpolation
>> required to generate data for an evenly spaced grid in an external
>> program and outputting it as a df3 file. 
>
>Ah. Nice.  Based on your comment, I googled "df3" and have found
>some results that are very encouraging and I include links here
>so if anyone searches the news group for this topic, they will
>hopefully run across these as possibilities to consider.
>
>http://www.linuxjournal.com/article/7486
>
>Leigh Orf describes creating a df3 file, declaring it as a povray
>function, and then creating an isosurface object that acts on that
>declared function, i.e.,
>
>#declare DENSFUNC=function
>{ pattern {
>   density_file df3 "cloud.df3" interpolate 1
>} }
>isosurface {function { 0.1 - DENSFUNC(x,y,z) }
>
>
>http://news.povray.org/povray.binaries.utilities/thread/%3C41605076@news.povray.
>org%3E/
>
>Andrew Le Couteur Bisson describes are program he has written
>that transforms a df3 file to a mesh2 object.

Or my own
http://www.econym.demon.co.uk/isotut/patterns.htm#density

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.