Is there a way to visualize wall/mesh in the povray snapshot?

Asked by Feng Chen

Hi, All:

Is there a way to visualize wall/mesh using the povray runnable? so the snapshot (*.png) can contain both the particle and wall information? Or, need to use the VTK way? I saw the previous post in:
https://answers.launchpad.net/esys-particle/+question/53118
Is there already anything like Scene.add(povWall)

Thanks for any suggestions!

Feng

Question information

Language:
English Edit question
Status:
Answered
For:
ESyS-Particle Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was reopened

Revision history for this message
Dion Weatherley (d-weatherley) said :
#1

HI Feng,

Yes, there is a way to visualise a mesh wall using povray although I have never done it. There is a class called esys.lsm.vis.povray.TriangulatedSurface for the purpose. The documentation is here:
http://esys.esscc.uq.edu.au/esys-particle_python_doc/snapshot/pythonapi/html/esys.lsm.vis.povray.TriangulatedSurface%27.TriangulatedSurface-class.html

My best guess on how to use it would be something like this:

nodelist = [
   Vec3 (0,0,0),
   Vec3 (0,0,1),
   Vec3 (0,1,1),
   Vec3 (0,1,0),
]

trianglelist = [
   (0,1,2),
   (0,1,3)
]

povWall = TriangulatedSurface(nodelist,trianglelist)
povWall.apply(pkg.Colors.Blue)
Scene.add(povWall)

Let me know if this works and how you did it.

Cheers,

Dion.

Revision history for this message
Feng Chen (fchen3-gmail) said :
#2

Thanks a lot, Dion, the code you suggested worked well:
#----------------------------------------------------------------
from esys.lsm.vis.povray import TriangulatedSurface
...
   nodelist=[
              Vec3(0,0,-0.5),
              Vec3(0,0, 0.5),
              Vec3(0.02,0,0.5),
              Vec3(0.02,0,-0.5)
            ]
   trianglelist = [
                   (0,1,2),
                   (0,2,3)
                  ]
   povWall=TriangulatedSurface(nodelist,trianglelist)
   povWall.apply(pkg.Colors.Gray)
   scene.add(povWall)

The only problem I have nowm is there a way to change the projection method of povray.camera? The snapshot I received seems to be the result of parallel projection:
http://i53.tinypic.com/2md46t0.png

can we change to perspective projection?

Revision history for this message
Feng Chen (fchen3-gmail) said :
#3

Hi, Dr. Dion:

Another question is that
povWall.apply(pkg.Colors.Gray)
in the code segment above does not seem to have an effect,
I am not able to change the color of the wall, it is always like dark gray, even if I change to:
povWall.apply(pkg.RgbColor(0.5,0,0.5))

Thanks!

Revision history for this message
Launchpad Janitor (janitor) said :
#4

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Dion Weatherley (d-weatherley) said :
#5

This question still requires an answer

Revision history for this message
Will (will-hancock) said :
#6

Hi Feng,

I just wanted to post a quick update to this. It will be helpful to you if you are comfortable with using the VTK snapshot files created from the checkpoint function in ESyS-Particle.

I have added a flag into the dump2vtk tool that will create a set of vtk mesh files able to be read in by Paraview. To use, simply call the same dump2vtk command with the "-mesh" option and it will output any meshes within the simulation into vtk files which can be viewed side-by-side in Paraview with your usual snapshot files. I've given an example below of how to use dump2vtk to convert checkpoint data to VTK files for a simulation containing rotational particles.

dump2vtk -i "InputChkPointFileName" -o "OutputFileName" -rot -t StartTimeStep NumSnaps TimeStepsBetweenSnaps -mesh

Regards,
Will

Revision history for this message
Feng Chen (fchen3-gmail) said :
#7

Thanks, Will,

I am going to try not only dump2vtk but also dump2pov to see if there is a good solution of this question, because povray output seems to have better quality than the vtk snapshot, especially when we want to used the snapshots in our papers:-), I will keep everyone updated.

Feng

Can you help with this problem?

Provide an answer of your own, or ask Feng Chen for more information if necessary.

To post a message you must log in.