Quantcast

read VTK format

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

read VTK format

JuanPi
Hi all,

I saw that we have in fpl a function to write VTK formats aslo PVD/VTU
formats. Do we have a function to read these format into Octave?

Thanks

--
JuanPi Carbajal
https://goo.gl/ayiJzi
Public GnuPG key: 9C5B72BF
-----
"Why is thought, being a secretion of the brain, more wonderful than
gravity, a property of matter?"
- C. Darwin

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: read VTK format

c.-2

> On 17 May 2017, at 10:40, JuanPi <[hidden email]> wrote:
>
> Hi all,
>
> I saw that we have in fpl a function to write VTK formats aslo PVD/VTU
> formats. Do we have a function to read these format into Octave?
>
> Thanks

No, we currently don't but it shouldn't be too hard to write if you need it.
It would be even easier if you know an xml parser for Octave.

c.



_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: read VTK format

JuanPi
On Wed, May 17, 2017 at 11:07 AM, Carlo de Falco
<[hidden email]> wrote:

>
>> On 17 May 2017, at 10:40, JuanPi <[hidden email]> wrote:
>>
>> Hi all,
>>
>> I saw that we have in fpl a function to write VTK formats aslo PVD/VTU
>> formats. Do we have a function to read these format into Octave?
>>
>> Thanks
>
> No, we currently don't but it shouldn't be too hard to write if you need it.
> It would be even easier if you know an xml parser for Octave.
>
> c.
>
>
What about https://octave.sourceforge.io/io/function/xmlread.html ?

The alternatives I was considering are:
1. Use fenics to lead the data and pass it to octave (fem-fenics not working :()
2. Use pytave to load using fenics in python and then save with numpy
in matlab format (haven't tried it yet)
3. Do 2. directly in python as a pre-step.



--
JuanPi Carbajal
https://goo.gl/ayiJzi
Public GnuPG key: 9C5B72BF
-----
"Why is thought, being a secretion of the brain, more wonderful than
gravity, a property of matter?"
- C. Darwin

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: read VTK format

c.-2

> On 17 May 2017, at 11:44, JuanPi <[hidden email]> wrote:
>
> What about https://octave.sourceforge.io/io/function/xmlread.html ?
>
> The alternatives I was considering are:
> 1. Use fenics to lead the data and pass it to octave (fem-fenics not working :()
> 2. Use pytave to load using fenics in python and then save with numpy
> in matlab format (haven't tried it yet)
> 3. Do 2. directly in python as a pre-step.

you could also consider using vtk directly from python/pytave, without fenics:

http://www.vtk.org/Wiki/VTK/Examples/Python

c.




_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: read VTK format

c.-2

> On 17 May 2017, at 12:15, Carlo de Falco <[hidden email]> wrote:
>
>
>> On 17 May 2017, at 11:44, JuanPi <[hidden email]> wrote:
>>
>> What about https://octave.sourceforge.io/io/function/xmlread.html ?
>>
>> The alternatives I was considering are:
>> 1. Use fenics to lead the data and pass it to octave (fem-fenics not working :()
>> 2. Use pytave to load using fenics in python and then save with numpy
>> in matlab format (haven't tried it yet)
>> 3. Do 2. directly in python as a pre-step.
>
> you could also consider using vtk directly from python/pytave, without fenics:
>
> http://www.vtk.org/Wiki/VTK/Examples/Python
>
> c.

Or write an oct-file linking to the vtk c++ library:
http://www.vtk.org/Wiki/VTK/Examples/Cxx#VTK_Formats

c.



_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: read VTK format

Sebastian Schöps
In reply to this post by c.-2
c.-2 wrote
> On 17 May 2017, at 10:40, JuanPi <[hidden email]> wrote:
>
> Hi all,
>
> I saw that we have in fpl a function to write VTK formats aslo PVD/VTU
> formats. Do we have a function to read these format into Octave?
>
> Thanks

No, we currently don't but it shouldn't be too hard to write if you need it.
It would be even easier if you know an xml parser for Octave.
I did something similar once by myself using xerces, see
http://wiki.octave.org/Cookbook#Load_XML_files

Seb.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: read VTK format

Pantxo
Sebastian Schöps wrote
c.-2 wrote
> On 17 May 2017, at 10:40, JuanPi <[hidden email]> wrote:
>
> Hi all,
>
> I saw that we have in fpl a function to write VTK formats aslo PVD/VTU
> formats. Do we have a function to read these format into Octave?
>
> Thanks

No, we currently don't but it shouldn't be too hard to write if you need it.
It would be even easier if you know an xml parser for Octave.
I did something similar once by myself using xerces, see
http://wiki.octave.org/Cookbook#Load_XML_files

Seb.
Hi,

Thanks to this post on the wiki, xmlread and xmlwrite have been implemented and are now available in the io package:

https://octave.sourceforge.io/io/function/xmlread.html
https://octave.sourceforge.io/io/function/xmlwrite.html

Pantxo
Loading...