Ability to read lines to render on top of a 2d plot. #12386
-
A user called asking if he could read a file with descriptions of lines to render on top of a 2d plot. We're trying to combine |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
I called him back and described to him the curve format, which I could render on top of 2d plots in my tests. . It turns out his data isn't monotonically increasing in X, which is required for curve plots. I said I would send him an e-mail with a format that worked that was more complex than I could describe over the phone. |
Beta Was this translation helpful? Give feedback.
-
I knew the vtk format would work, but figured I would look for another format and saw the Lines format. It isn't described anywhere, but I looked at the code and found that the lines start with a name, followed by one 3d comma separated point per line. I created an example with all the z coordinates zero and plotted it and found it rendered it in 2d. I saw 3 was hard coded for the spatial dimension in the reader. It would be good if it looked at the data and set it appropriately. I also found a bug where the reader had logic to eliminate duplicate points, unfortunately it also did that across lines, so if the first point of a line was the same as the last point of the previous line, it eliminated the first point. Apparently, my test case was lucky to discover this bug. I decided this was not viable at the moment and would send him a vtk example. |
Beta Was this translation helpful? Give feedback.
-
I sent the user the following e-mail: Hi, You can use the vtk format. Below is an example. The “POINTS” section consists of your points. The “5” is the number of points. The points are x, y, z for each point and if all the z coordinates are zero, then it’s considered 2d data. The “Lines” section is 0 origin indexes into the points. The “4” is the number of lines, the “12” is the total number of numbers in the lines section. You could in theory create longer lines, so you could say you have 1 line of 5 points in this case (I believe, I didn’t test it) with the indexes being (0, 1, 2, 3, 4). Eric vtk DataFile Version 4.2vtk output |
Beta Was this translation helpful? Give feedback.
-
I should submit some bugs regarding the "Lines" format. |
Beta Was this translation helpful? Give feedback.
-
The user was able to do what he needed with the "Lines" format. I submitted a bug ticket with the 2 bugs mentioned and a documentation ticket to add documentation for the "Lines" format. |
Beta Was this translation helpful? Give feedback.
I sent the user the following e-mail:
Hi,
You can use the vtk format. Below is an example.
The “POINTS” section consists of your points. The “5” is the number of points. The points are x, y, z for each point and if all the z coordinates are zero, then it’s considered 2d data.
The “Lines” section is 0 origin indexes into the points. The “4” is the number of lines, the “12” is the total number of numbers in the lines section.
For each line, the first number is the number of points in the line, so in this case each line as 2 points. The next 2 numbers are the indexes into the points for the first line. So the 0th and 1st points in the list.
You could in theory create longer lines, so you cou…