Hello. I am trying to draw a sphere. I have managed to animate a surface using DATASET STRUCTURED_GRID and multiple vtk files which shows a diffusion process over time. So far, so good. Now I want to draw a sphere and deform it. I can produce points for a radius = 1 sphere with theta from 0 to 2 pi and phi from 0 to pi. There are 5000 points. Of course, r is constant and equal to 1, but that is going to vary. So I have 5000 points on a sphere in float format. I was trying to use the following:
I keep getting the error that the number of points don’t match the matadata.
After this, I’ll be putting data to represent stresses and strains at each point. I’ve tried looking at examples but nothing works and I would like to use C if that is possible. I am way too old school for Python.
Any assistance regarding how to set out the data would be very appreciated. I really don’t understand the difference between structured and unstructured. I believe the lookup table can be used to enter stress and strain data???
Warning: In /builds/gitlab-kitware-sciviz-ci/build/superbuild/paraview/src/VTK/IO/Legacy/vtkStructuredPointsReader.cxx, line 282
vtkStructuredPointsReader (0x184eef00): Not all meta data was read from the file.
Warning: In /builds/gitlab-kitware-sciviz-ci/build/superbuild/paraview/src/VTK/IO/Legacy/vtkStructuredPointsReader.cxx, line 282
vtkStructuredPointsReader (0x17a1c730): Not all meta data was read from the file.
Warning: In /builds/gitlab-kitware-sciviz-ci/build/superbuild/paraview/src/VTK/IO/Legacy/vtkStructuredPointsReader.cxx, line 282
vtkStructuredPointsReader (0x17a1c730): Not all meta data was read from the file.
ERROR: In /builds/gitlab-kitware-sciviz-ci/build/superbuild/paraview/src/VTK/IO/Legacy/vtkStructuredPointsReader.cxx, line 455
vtkStructuredPointsReader (0x17a1c730): Number of points don’t match data values!
Warning: In /builds/gitlab-kitware-sciviz-ci/build/superbuild/paraview/src/VTK/IO/Legacy/vtkStructuredPointsReader.cxx, line 282
vtkStructuredPointsReader (0x1a554840): Not all meta data was read from the file.
Warning: In /builds/gitlab-kitware-sciviz-ci/build/superbuild/paraview/src/VTK/IO/Legacy/vtkStructuredPointsReader.cxx, line 282
vtkStructuredPointsReader (0x1a543d30): Not all meta data was read from the file.
Warning: In /builds/gitlab-kitware-sciviz-ci/build/superbuild/paraview/src/VTK/IO/Legacy/vtkStructuredPointsReader.cxx, line 282
vtkStructuredPointsReader (0x1a543d30): Not all meta data was read from the file.
ERROR: In /builds/gitlab-kitware-sciviz-ci/build/superbuild/paraview/src/VTK/IO/Legacy/vtkStructuredPointsReader.cxx, line 455
vtkStructuredPointsReader (0x1a543d30): Number of points don’t match data values!
Also, what is meant by spacing? That is not in the documentation. Is it the distance between coordinate points?
Yes
Also what do you mean by the point that will implicitly define the points?
I meant that origin, spacing and dimension will define implicitly the points.
For example the file below defines a structured grid of 3*4*6 = 72 points, the first point is located at (0,0,0) the distance between the points at each direction is (1,1,1) so the points are :
(0,0,0), (1,0,0),(2,0,0),
(0,1,0), (1,1,0),(2,1,0), …
Finally, the list of values at the end defines the value at each point.
You may want to view the file in the Spreadsheet View in ParaView to explore the structure of the file better.
There is an example of a STRUCTURED_POINTS dataset (and other structured datasets) in the ParaView’s included Examples. They are found with File/ Open/ Examples. Structured points is VTK/ legacy/ structuredVolume.vtk.
This email didn’t go through from my email account. So I’m repeating it here.
Ohhhh, the origin is the location of the first point!!! It’s not the location of the origin of the coordinate system. That’s huge. Thank you!
Walter, the problem is not with the examples, it’s getting them to work. I’ll keep trying different approaches to see if I can get anything. I have found that structured just means a curvilinear coordinate system. Non-structured is non-curvilinear. It may be I should not be using structured points, so I will try others after trying suggestions from Christos. Thank you so much for your help.
You use a structured grid.
r is constant =1.0
theta is in 20 steps from 0 to 2*pi
phi is in 10 steps from 0 to pi
therefore:
DIMENSIONS 1 20 10
POINTS 200 float
put in the points here…
and voila!! BTW, make dtheta = 2 pi/(ntheta-1) and dphi = pi/(phi-1) and all will be well. It is all in the DIMENSIONS tab. I am going to change r to having varying values to create a stretched or convoluted spheroid, but I am on my way. There may be many values of r but I will keep the first DIMENSION to 1 and go from there. So, in reality, it is kind of already in spherical coordinates only DIMENSION is not what is nx ny nz but nr ntheta and nphi. Kewl.
Thanks a lot for your help. Now to put in stresses, etc.
Huge shout out to Libby for her help. It’s in the DIMENSIONS section. Basically, it’s kinda already in spherical coordinates. r is a constant so number of r measurements is 1, theta is 20 in this case and nphi is 10. So there are 200 points.
I now need to toss in a lookup table to colour various points on the spherical surface. In the near future, r will have varying values as the sphere becomes convoluted. So I may be back with all these silly questions, or it may all work just fine. Thank you all for your help and for hanging in there with me.
For reference: theta goes from 0 to 2pi and phi goes from 0 to pi. dtheta = 2pi/(ntheta-1) and dphi = (nphi-1).
Once again, thanks for your patience with me and your guidance.
Hi, I’m just staring out and have had some success. I have a nice picture of a sphere that rotates. I would like to throw a brick at it. Do I need a separate .vtk datafile for the brick, or is there a way to put both brick and sphere into the same .vtk legacy file? I am using STRUCTURED_GRID for the sphere. I’d probably use the same for the brick. Unfortunately, I cannot find an answer in the documentation or user guide.