Re: [Paraview] Simple 2D plots

2018-04-30 Thread David Ortley
Also consider using the Delaunay2D filter on the TableToPoints filter
instead of messing around with changing the point size.

-David Ortley

On Mon, Apr 30, 2018 at 4:44 PM, David Ortley  wrote:

> I think the TableToPoints filter is what you want.  There's a checkbox
> where you can tell the data to be 2D that is below where you assign columns
> to X, Y and Z coordinates.
> What happens is that the x, y and z columns get removed from the table and
> a new point type is generated (yes, Z will get removed even if you select
> only 2D points), so either redundantly assign the Z column to one of your
> first two columns (so, X Column and Z Column are both set to the 'x' or
> first column, which will be harmless in this case), or select 'Keep All
> Data Arrays' which will keep the columns values around for coloring.
>
> Note that with 2D points, the Render View SHOULD go to '2D', but it
> sometimes doesn't.  There's a '3D' in small text at the top of the render
> view that will go to '2D' if you click it.  Then hit the 'Set View
> Direction -Z' glyph in the top bar.
>
> Play with the Point Size var to fill in the gaps.  And the mouse works
> slightly differently in 2D, so you'll have to develop new muscle memory. :)
>
> -David Ortley
>
> On Sat, Apr 28, 2018 at 1:21 PM, eric greenwade 
> wrote:
>
>> OK, a little embarrassing to ask, but the answer is needed. I'm trying to
>> do old fashioned, 2D plots. Data is (x,y,z) and even though its in an ascii
>> csv file, the (x,y) are structured rectilinear (uniform actually). I've
>> added a dummy third coord (all 0s) and then plotted as 3D, but this seems
>> like a kludge.
>>
>> I'd like to do the some of the basic 2D plots with this data: heatmaps
>> were z is used for color table value, contouring on z and elevation plots
>> were z is height. Not all three at once.
>>
>> I'm sure this is an RTFM, but I've looked. If someone could provide
>> pointers, references, suggestions, it would be greatly appreciated.
>>
>> thanks,
>>
>> -eric
>>
>> ___
>> 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:
>> https://public.kitware.com/mailman/listinfo/paraview
>>
>>
>
___
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:
https://public.kitware.com/mailman/listinfo/paraview


Re: [Paraview] Simple 2D plots

2018-04-30 Thread eric greenwade
Thanks Utkarsh, Just a quick question to validate my understanding. It
sounds like you're confirming what I had determined so far, you can't plot
simple 2D data, you have to pretend its 3D, i.e. the additional of a z axis
where the values are all zero? I had figured that one out, and it works for
this example, a simple heat map. However, this doesn't work for the
creation of a contour plots or elevation plots, where the third variable is
interpreted as height? Ideally, the result would be an elevation plot with
the height values also used to color the surface. Can these other types of
plots also be created in paraview?

thanks,

-eric

On Mon, Apr 30, 2018 at 12:57 PM, Utkarsh Ayachit <
utkarsh.ayac...@kitware.com> wrote:

> Eric,
>
> You can potentially use the "Table To Structrued Grid" filter. Attached is
> an example state file with a csv file used.
>
> Utkarsh
>
> On Sat, Apr 28, 2018 at 3:21 PM, eric greenwade 
> wrote:
>
>> OK, a little embarrassing to ask, but the answer is needed. I'm trying to
>> do old fashioned, 2D plots. Data is (x,y,z) and even though its in an ascii
>> csv file, the (x,y) are structured rectilinear (uniform actually). I've
>> added a dummy third coord (all 0s) and then plotted as 3D, but this seems
>> like a kludge.
>>
>> I'd like to do the some of the basic 2D plots with this data: heatmaps
>> were z is used for color table value, contouring on z and elevation plots
>> were z is height. Not all three at once.
>>
>> I'm sure this is an RTFM, but I've looked. If someone could provide
>> pointers, references, suggestions, it would be greatly appreciated.
>>
>> thanks,
>>
>> -eric
>>
>> ___
>> 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:
>> https://public.kitware.com/mailman/listinfo/paraview
>>
>>
>
___
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:
https://public.kitware.com/mailman/listinfo/paraview


Re: [Paraview] [EXT] Re: vtkPointDataToCellData but only for selected PointData

2018-04-30 Thread David E DeMarle
This does what you are looking for:

import vtk


# copy entire structure across

self.GetOutputDataObject(0).ShallowCopy(self.GetInputDataObject(0,0))


# use pass arrays to extract a copy with one array of interest

myArrays=vtk.vtkPassArrays()

myArrays.SetInputDataObject(self.GetInputDataObject(0,0))

myArrays.ClearArrays()

myArrays.AddPointDataArray('DISPL')

myArrays.AddCellDataArray('')

myArrays.AddFieldDataArray('')


# use point2cell to operate on the one array we care about

p2c = vtk.vtkPointDataToCellData()

p2c.SetInputConnection(myArrays.GetOutputPort())

p2c.Update()


# iterate over blocks and copy in the result

iter=dsa.MultiCompositeDataIterator([p2c.GetOutputDataObject(0), output])

for  in_block,  output_block in iter:

 
output_block.GetCellData().AddArray(in_block.VTKObject.GetCellData().GetArray('DISPL'))




David E DeMarle
Kitware, Inc.
Principal Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909

On Mon, Apr 30, 2018 at 8:52 AM, Dennis Conklin  wrote:

> David,
>
>
>
> I have not called filters within the Programmable Filter before and I am
> not getting things hooked up correctly. My attempt is attached.
> Clearly, I do not understand how to hook the output of 1 filter to the
> input of the next because I’m getting to the end and getting something with
> no blocks and no cells.
>
>
>
> Any hints?
>
>
>
> Dennis
>
>
>
>
>
>
>
>
>
>
>
> *From:* David E DeMarle [mailto:dave.dema...@kitware.com]
> *Sent:* Tuesday, April 10, 2018 10:14 AM
> *To:* Dennis Conklin 
> *Cc:* Paraview (parav...@paraview.org) 
> *Subject:* [EXT] Re: [Paraview] vtkPointDataToCellData but only for
> selected PointData
>
>
>
>  *WARNING - External email; exercise caution.*
>
>
>
> The pass arrays filter comes to mind.
>
>
>
> If creating withing your python programmable filter it will be called
> vtk.vtkPassArrays then follow that with a vtk.vtkPointDataToCellData.
>
>
>
>
>
>
> David E DeMarle
> Kitware, Inc.
> Principal Engineer
> 21 Corporate Drive
> Clifton Park, NY 12065-8662
> Phone: 518-881-4909
>
>
>
> On Tue, Apr 10, 2018 at 10:07 AM, Dennis Conklin <
> dennis_conk...@goodyear.com> wrote:
>
> All,
>
>
>
> Well, this list solved my problem so easily (and made me feel slightly
> less than the sharpest pencil in the box) yesterday, so I thought I’d try
> again.
>
>
>
> I am doing some Python calcs inside a programmable filter and some of the
> results I want to average from the Points onto the Cells.   But,  I don’t
> want all my PointData moved over to CellData – I want to transfer some of
> them over within my Filter.
>
>
>
> Right now I’m looping thru all the elements and finding all their nodes,
> then averaging them and assigning to the cells.  It is dog slow and is
> choking off the usefulness of this filter.
>
>
>
> Is there anything like vtkPointDataToCellData that lets me specify which
> quantities to convert – could I do something tricky like store original
> list of PointData, make up a new list, then run PointDataToCellData, then
> restore the list of PointData ??
>
>
>
> I realize this may have all sorts of unexpected side effects, so I’m just
> asking!
>
>
>
> Thanks again, this group is great!
>
>
>
> Dennis
>
>
> ___
> 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:
> https://public.kitware.com/mailman/listinfo/paraview
> 

Re: [Paraview] PROBLEM WITH CUSTOM FILTER

2018-04-30 Thread Mathieu Westphal
Hello Miguel,

Programmable source are supported and your example seems to work.
Here is exactly how i tested it, with ParaView 5.4.0, 5.4.1 and 5.5, on
linux.

- Open ParaView
- Load State -> ERROR_pv_5_4_0.pvsm
- Select the source and the filter in the pipeline browser
- Tools->Create Custom Filter
- Write a SourceName
- Next, Next, Finish
- Edit->Reset Session
- *Sources*-> SourceName
- Apply

no bug, all seems to be working well.

Custom Filter are already automatically saved and loaded, they should be
available at the next paraview execution (considering ParaView exited
normally).

Best,

Mathieu Westphal

On Fri, Apr 27, 2018 at 2:58 PM, Miguel Aguirre 
wrote:

> Hello,
>
> It is on Paraview 5.4.0 and it happens also on 5.5.0
>
> I have attached a very simple pvsm file with a programmable source
> followed by a filter. When I try to create a single Custom Filter
> containing this 2 operations (the source+the filter), it crashes. Sometimes
> it does not crashes but the new custom filter is not available on the
> filter alphabetical list. Does the Custom Filter accepts a programmable
> source as input ?
>
> Thanks in advance
>
> PS : i have created several other custom filters but i have to load them
> every time I open a session. is it possible to make an autoload ?
> (something like the autoload of the plugins)
>
> Miguel
>
> On Fri, Apr 27, 2018 at 1:32 PM, Mathieu Westphal <
> mathieu.westp...@kitware.com> wrote:
>
>> Hi Miguel,
>>
>> I fail to reproduce with a single source in a custom filter.
>> Could you please precise which version of ParaView you are using and
>> which filter you are putting in a custom filter ?
>>
>> Thanks,
>>
>> Best regards,
>>
>> Mathieu Westphal
>>
>> On Fri, Apr 27, 2018 at 12:54 PM, Miguel Aguirre 
>> wrote:
>>
>>> Hi all,
>>>
>>> I would like to know if its possible to create a custom filter without
>>> an input.
>>>
>>> In fact, I would like to use a data source followed by some filters and
>>> then to group all these actions (including the data source) in a single
>>> Custom Filter. However Paraview crashes when I click on the "finish" button
>>> during the set-up procedure.
>>>
>>> Thanks in advance !
>>>
>>> Miguel
>>>
>>> ___
>>> 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:
>>> https://public.kitware.com/mailman/listinfo/paraview
>>>
>>>
>>
>
>
> --
> *Ing.  Miguel Angel AGUIRRE*
>
>
___
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:
https://public.kitware.com/mailman/listinfo/paraview


[Paraview] XML PLUGIN RELATIVE PATH

2018-04-30 Thread Miguel Aguirre
Hi all,

I am working with Plugins for programmable filters that executes external
Python scripts. So far, so good.

However, I want to avoid to write the entire path of the Python file on the
XML file, as you can see highlighted in bold on the XML code down below.

Both, the XML and the Python file are in the same folder. Moreover, the XML
file and the Python file have the same name. So, I wonder if there is a way
to set up a relative path...do you have any ideas to solve that ?

Thanks in advance !

Miguel Angel AGUIRRE


















___
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:
https://public.kitware.com/mailman/listinfo/paraview