Newby question

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Newby question

uiemma
I'm newby of vtk and not very familiar with computer graphics. Here's my problem.
My simulation code produces a large amount of scalar data at a set of point in a 3D domain with voids
(a set of virtual microphones surrounding scattering objects). The set of points is a cloud with no particular structure.

How can I produce a vtk formatted file to be read with paraview or similar viewers ?

My code is writtten in C.

Thanks
umberto
Reply | Threaded
Open this post in threaded view
|

Re: Newby question

Sebastien Jourdain-2
Hi umberto,

you might want to look at http://www.vtk.org/VTK/img/file-formats.pdf
and create an unstructured grid that has only vertex as cell.
In fact you can create a single poly-vertex cell that is used to show
all you points.

Seb

On Fri, Aug 5, 2011 at 1:04 PM, uiemma <[hidden email]> wrote:

> I'm newby of vtk and not very familiar with computer graphics. Here's my
> problem.
> My simulation code produces a large amount of scalar data at a set of point
> in a 3D domain with voids
> (a set of virtual microphones surrounding scattering objects). The set of
> points is a cloud with no particular structure.
>
> How can I produce a vtk formatted file to be read with paraview or similar
> viewers ?
>
> My code is writtten in C.
>
> Thanks
> umberto
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/Newby-question-tp4670142p4670142.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Newby question

uiemma
Thank you Seb.
You mean that if I have, let's say, 125000 points scattered within a box domain with one spherical hole in the middle (this is actually the case :-) I can produce ONE SINGLE poly-vertex cell out of all the 125k points?
I can't figure how. Maybe I have to re-read the document more carefully.
Thank you
Reply | Threaded
Open this post in threaded view
|

Re: Newby question

Sebastien Jourdain-2
Yes. Basically to see something you need at least a cell. You can
either create one cell for each of your point that will be a vertex,
or you can create a single cell (poly-vertex) that list all your
points index.

Seb

PS: Here is what it should looks like:

DATASET UNSTRUCTURED_GRID
POINTS 125000 float
p0x p0y p0z
p1x p1y p1z
...
CELLS 1 12500
0 1 2 3 4 5 6 7 8 ... 124999
CELL_TYPES 1
2
POINT_DATA 125000
SCALARS data-name float 1
LOOKUP_TABLE default
v1 v2 v3 v4 ... v125000

On Fri, Aug 5, 2011 at 1:32 PM, uiemma <[hidden email]> wrote:

> Thank you Seb.
> You mean that if I have, let's say, 125000 points scattered within a box
> domain with one spherical hole in the middle (this is actually the case :-)
> I can produce ONE SINGLE poly-vertex cell out of all the 125k points?
> I can't figure how. Maybe I have to re-read the document more carefully.
> Thank you
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/Newby-question-tp4670142p4670201.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Newby question

uiemma
I tried. The file is read without errors in Paraview, but the visualization includes only
the points, colored according to the scalar values. If I apply a Delaunay3D filter, the filed is visualized, but without the voids. Mmmmh ... I can't figure out what is wrong.

U
Reply | Threaded
Open this post in threaded view
|

Re: Newby question

Sebastien Jourdain-2
Hi umberto,

I thought it was what you were looking for. (a set of points colored
by the values)
If you want to get more help, I guess you will have to explain what
you try to do and what you mean by the voids ?

Seb


On Sat, Aug 6, 2011 at 11:26 AM, uiemma <[hidden email]> wrote:

> I tried. The file is read without errors in Paraview, but the visualization
> includes only
> the points, colored according to the scalar values. If I apply a Delaunay3D
> filter, the filed is visualized, but without the voids. Mmmmh ... I can't
> figure out what is wrong.
>
> U
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/Newby-question-tp4670142p4672765.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Newby question

uiemma
Seb, you're right. I'll try to explain better.
My code virtually measures the pressure field at a number of points in space. The points are regularly spaced except than in the region where a scattering object is present. So, the "voids" are region of the domain where the virtual microphones are removed.
Something like this:
................
................
....        ....
....        ....
................
................

What I want is to plot, e.g., the contours of the pressure field from the scattered data.
Hope it is clearer now.
I've seen that vtk offers an exhaustive library of functions to manipulate data and write files, but, as far as I understood, they must be called from C++ and my code is pure C.
Tx
Umb


 
Reply | Threaded
Open this post in threaded view
|

Re: Newby question

Sebastien Jourdain-2
Hi Umberto,

If your points are regularly spaced, why don't you use an ImageData
with some Arbitrary known value for the void location
and just make a threshold so you can create those holes. Once you've
done that, you have the "connectivity" that you were missing for doing
the processing that you tried to achieved. Otherwise, you can create
your own connectivity if you know the topology.

Seb

On Sat, Aug 6, 2011 at 12:17 PM, uiemma <[hidden email]> wrote:

> Seb, you're right. I'll try to explain better.
> My code virtually measures the pressure field at a number of points in
> space. The points are regularly spaced except than in the region where a
> scattering object is present. So, the "voids" are region of the domain where
> the virtual microphones are removed.
> Something like this:
> ................
> ................
> ....        ....
> ....        ....
> ................
> ................
>
> What I want is to plot, e.g., the contours of the pressure field from the
> scattered data.
> Hope it is clearer now.
> I've seen that vtk offers an exhaustive library of functions to manipulate
> data and write files, but, as far as I understood, they must be called from
> C++ and my code is pure C.
> Tx
> Umb
>
>
>
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/Newby-question-tp4670142p4672960.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers