GithubHelp home page GithubHelp logo

Comments (7)

mhogg avatar mhogg commented on August 23, 2024

Hi,
I usually open the VTU file with python vtk or Paraview. In am not sure for certain, but I suspect the six values per line just means you have two 3D points per line, not a single 3D point on each line.
I can look into this a bit further - it would help it you attached your VTU file for me to look at.
Cheers,
Michael

from pyoctree.

oliverstefanov avatar oliverstefanov commented on August 23, 2024

Here is a zip of the octree.vtu file, which is just the result of running your introductory example on the knot.stl geometry. It works fine in paraview actually, but i'd like to extract such data points and thus need to be sure of what i'm looking at.
Also there is a data array at the end with 6 integers per line (value of 12 here)...I wonder what is the use for it?

Thanks a lot!

octree.zip

from pyoctree.

mhogg avatar mhogg commented on August 23, 2024

As I thought, the 6 points are just two 3D points per line (you can tell from the total number of points, which is 19976, spread over half as many lines in the file).
The next integers are the cells (i.e. each line here is the list of points that form each cell. Note there are 8 points forming each cell)
The next integers (value of 12) correspond to the element types. Element type 12 is the 8 noded vtk_hexahedron.

from pyoctree.

oliverstefanov avatar oliverstefanov commented on August 23, 2024

Ok thanks a lot for your feedback. For cells connectivity it's the same deal I suppose, 6 integers per line but it really is 8 consecutive ints that form a cell. I'm surprised it doesn't disturb paraview.

Also I just realized there is also an "offsets" data array with about 6 integers per line, for a total of 2497 elements, just like the number of cells. Is it used to designate the reference point for the vtk elements (just guessing)?

from pyoctree.

mhogg avatar mhogg commented on August 23, 2024

This doesn't worry Paraview because it knows what each cell type is and therefore how many points it should read to form each cell. This is also where the offset is used. That is, if you look at the offset values they are 8, 16, 24, 32, 40, 48, 56 etc. This tells paraview that the starting point for the first cell is 0, for the second cell is 8, for the third cell is 16 etc.

The best document on vtk file formats that I have found (although several years old) is:
https://vtk.org/wp-content/uploads/2015/04/file-formats.pdf

from pyoctree.

oliverstefanov avatar oliverstefanov commented on August 23, 2024

Alright makes sense, thank you very much for this information

from pyoctree.

mhogg avatar mhogg commented on August 23, 2024

No problem

from pyoctree.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.