[Paraview] Python paraview.simple: Zoom To Data?

Nico Schlömer nico.schloemer at gmail.com
Thu Mar 15 12:59:44 EDT 2012


I see.
Well, ResetCamera() seems to deliver okay results only after Show()
has been called -- OpenDataFile() doesn't suffice.
Another misconception of mine was that CameraPosition and
CameraFocalPoint could be set to anything. My data files contain flat
surfaces in the x-y-plane, and ResetCamera() won't show anything if
CameraPosition==[0,0,0] and CameraFocalPoint=[0,0,1]. This, again,
makes sense. Setting CameraPosition to [0,0,1], for example, fixes
this.

ResetCamera() still leaves a wide border around the object. Is it
possible to rid of those, too?

Cheers,
Nico




On Thu, Mar 15, 2012 at 3:40 PM, Pat Marion <pat.marion at kitware.com> wrote:
> ResetCamera() will position the camera so that all visible objects fit in
> the view.  You can control the view direction by setting the
> view.CameraPosition and view.CameraFocalPoint properties.  You don't have to
> set the properties to any useful values, I usually set position to 0,0,0 and
> CameraFocalPoint to the view direction, say [1,0,0] to look along the X
> axis, then ResetCamera() will figure out where to put the camera while
> keeping the view direction intact.
>
> Pat
>
>
> On Thu, Mar 15, 2012 at 6:52 AM, Nico Schlömer <nico.schloemer at gmail.com>
> wrote:
>>
>> Hi,
>>
>> the ParaView GUI has this nifty little button action "Zoom To Data"
>> which displays the current object such that it somehow fits its
>> window.
>>
>> Is there a similar thing for the Python paraview.simple module? I'm
>> trying to get a hang on it with certain view options such as
>>
>>  view = pv.GetRenderView()
>>  view.CameraFocalPoint = [0, 0, 0]
>>  view.CameraViewAngle = 90
>>  view.CameraPosition = [0, 0, 10]
>>  view.ViewSize = [600, 600]
>>
>> but what I would really like to have is to set the camera at a
>> distance such that the object(s) just fit into the window they're
>> displayed in.
>>
>> Any hints?
>>
>> Cheers,
>> Nico
>> _______________________________________________
>> 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 ParaView Wiki at:
>> http://paraview.org/Wiki/ParaView
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.paraview.org/mailman/listinfo/paraview
>
>


More information about the ParaView mailing list