[Paraview] Programmable filter - script for mean of two input PointSources

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Tue May 24 09:16:42 EDT 2016


Here's a simple trick:

1. Select both point sources in pipeline browser and then create the
"Python Calculator".
2. Use the expression "(inputs[0].Points + inputs[1].Points)/2.0", and
hit "Apply"
3. Next, create the "Calculator" filter connect to the "Python
Calculator" with expression "result" and also check the "Coordinate
Results" checkbox. Hit "Apply".

That should do it.

Example state file attached.



On Mon, May 23, 2016 at 10:19 PM, Thomas Faribault-Ménard
<thomas.faribault-menard at mail.mcgill.ca> wrote:
> Hi,
>
> I’m a beginner in ParaView. I have two Point Source as my inputs. My output
> is a third point source that has to be located at the mean of the
> coordinates of my inputs.
>
> I would prefer the solution to be in the form of a programmable python
> filter but I need a little help.
>
> Could you point me in the right direction please ?
>
>
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: meanpoints.pvsm
Type: application/octet-stream
Size: 185653 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/paraview/attachments/20160524/91ea2eed/attachment-0001.obj>


More information about the ParaView mailing list