CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ParaView (https://www.cfd-online.com/Forums/paraview/)
-   -   Paraview nice animation (https://www.cfd-online.com/Forums/paraview/79611-paraview-nice-animation.html)

PyGloo August 28, 2010 13:25

Paraview nice animation
 
Hi all!

I'm not sure this is the good section to post in but the nearest from paraview was the paraFOAM section... or this one.


Background
I'm currently working on some kind of fluid motion problem. The whole preprocessing and solving parts went very well. And now it's time for postprocessing: the results are just great. Paraview calculated everything I needed and the pictures are nice to share with other people working on computer simulation.

But, soon I've got a meeting with my management team and sometime, a good picture is worth a thousand word. And a good animation is also worth a thousand picture (and even more if I want something smooth ;)). The thing is I don't find paraview's animation very appealing and I wanted to enhance a bit the quality. This is not something I need but that might be a real plus as a conclusion of the study to show very nice pictures.

Idea
The first idea was to generate .pov files for each of my timestep (I work in transient). Of course, I wouldn't do it manually so I wrote a very simple script: open the case, extract interesting parts and export as .pov.
Code:

#!/bin/bash
from paraview.simple import *
Solver_trace_case = EnSightReader( CaseFileName='somewhere' )

RenderView = GetRenderView()

RenderView.CameraPosition = [0.045000001788139343, 0.0, 0.30116827205415048]
RenderView.CameraClippingRange = [0.26830266634811484, 0.34327460236181229]
RenderView.CameraFocalPoint = [0.045000001788139343, 0.0, -3.92179936170578e-06]
RenderView.CenterOfRotation = [0.045000001788139343, 0.0, -3.92179936170578e-06]

ExtractBlock = ExtractBlock()

ExtractBlock.BlockIndices = [3, 6]

DataRepresentation = GetDisplayProperties(ExtractBlock)
DataRepresentation.Representation = 'Surface'
DataRepresentation.DiffuseColor = [0.51372549019607838, 0.51372549019607838, 0.51372549019607838]

RenderView.CameraParallelScale = 0.036363830255578364
RenderView.Background = [0.33333333333333331, 0.66666666666666663, 1.0]
RenderView.Background2 = [0.0, 0.0, 0.17254901960784313]
DataRepresentation.Representation = 'Surface'
DataRepresentation.EdgeColor = [0.0, 0.0, 0.50000762951094835]
RenderView.CameraParallelScale = 0.036363830255578364
exporters = servermanager.createModule("exporters")

for n in range(0,30):
    n=float(n)/2
    RenderView.ViewTime = n
    view=Render()
    exporters.VRMLExporter(View=view, FileName="somewhereelse/foo-%s.vrml" % str(int(n*10))).Write()
    exporters.POVExporter(View=view, FileName="somewhereelse/foo-%s.pov" % str(int(n*10))).Write()

I'm not an expert at all with paraview python API. (Please no comment on the evil ugly trick to set non integer view times :), this was just to build a quick thing without losing time searching the doc for it).


The problem is that the exported file is not nice at all (when generated using povray foo0.pov +Q3 +A0.01 +AM2 +FN16 +H802 +W1053, which should be very nice). And if I try to generate the .pov file directly in paraview, I got something much nicer.

Just to explain a bit more what I mean for the .pov's files generated by the script: straight lines are not necessary straight anymore once generated. The geometry is completely broken. As for the pov's files generated in pv GUI, everything is OK (except that I won't open each single file manually to export them).

As you can see in the script, I also tried to export as vrml to be used in blender. The output is also really nice, but I don't know a single thing about blender scripting: once again, I won't process each file manually.

My last idea is to use animation capabilities of paraview but with manta renderer. But it's still compiling, so I won't have results very soon.

Questions
Did one of you already tried to get nicer pictures/animations from paraview?
Does anyone know why the povray exporter is apparently not working as it should?
Did someone already tried paraview with manta ?

Many thanks in advance for you answer!

PyGloo November 4, 2010 11:31

Hi,
Just a little bump after some months. The issue is still not solved and your opinion about it might be really helpful.


And I have also another question: the povray exporter from vtk does not support the export of colors interpolated in paraview. I think I understood why, but do you know if there is a way to ask for such an interpolation with povray except by rewriting the file properly?

Thanks in advance.

Regards,
PyGloo

praveen November 5, 2010 00:47

Are you using the paraview binaries from paraview.org ? If yes then try to compile it yourself. For example, I find that pdf files created with paraview from paraview.org are of poor quality. Mayavi does a much better job. You can also try mayavi for your animations as it also supports vtk files. Another option is Visit. Both of these are free softwares and support vtk. Please write here about your success so we can also learn from that.

PyGloo November 5, 2010 11:27

Thanks for your answer.

I tried Debian binary from its repositories, openfoam's modified paraview and I also tried to compile it myself.

I tried my little script with all of them and the result is still poor.


As for mayavi and Visit, I will give them a try and tell you.

cfdnewbie June 7, 2012 12:34

Quote:

Originally Posted by PyGloo (Post 273192)
Hi all!


Did one of you already tried to get nicer pictures/animations from paraview?

Don't know if this thread is still active or not, but why not try blender instead of povray? export as x3d, and then render it in blender. Gives very nice results!


All times are GMT -4. The time now is 16:04.