0

I would like to display data from .txt file (thousands of points [x,y,z] no exact length) in 3D by ILNumerics.

1) How to use StreamReader to choose only some data (e.g. all where y = <200,300>) and save them to Array

2) Then I would like to use Array from 1) and display it with code like this

private void ilPanel1_Load(object sender, EventArgs e)
    {
        double[,] a = new double[2, 3] { { 1.0f, 2.0f, 3.0f }, { 1.0f, 2.0f, 3.0f } };

        ILArray<float> A = a; // this should make ILNumerics Array from my Array a - didnt worked when I used List

        var scene = new ILScene {
        new ILPlotCube(twoDMode: false) {
            new ILPoints {
                Positions = A,
                Size = 4,
            }
        }
    };

        ilPanel1.Scene = scene;
    }

I would be grateful even for ideas how to solve this.

emesday
  • 6,078
  • 3
  • 29
  • 46
Jurid
  • 1
  • 1

1 Answers1

0

There is a function for reading structured data from csv files: ILMath.csvread(...). You can use it in order to read the whole file or specify rows/columns to skip. Once you have a matrix out of these data, you can go ahead and use a plotting function like the one you listed.

In a first attempt it would only plot the points in 3D. In order to make surfaces out of it, it gets more challenging. You would fit a model to the points, make an interpolation to a surface grid and plot that instead / in addition to the true points.

Haymo Kutschbach
  • 3,322
  • 1
  • 17
  • 25
  • Thank You, after all I am using modification of idea given here:[link](http://stackoverflow.com/questions/22506286/how-to-load-big-csv-file-in-ilarray-for-3d-plotting?answertab=votes#tab-top) – Jurid Apr 23 '14 at 20:22