Page 1 of 1

How to fill data into IsoSurface

Posted: Tue Feb 19, 2008 6:09 am
by 9640493
Hi

I am trying to populate an isosurface in a trial version of TeeChart .Net V3. I would like to be able to reproduce a 2D isosurface as shown in http://www.teechart.net/support/viewtopic.php?t=4930. So far I am just testing the functionlity off with the simplest example possible. I have added a chart to a form and an isosurface to the chart. In the code I am trying to populate data into it by the following:

int height = 300;
int width = 300;

Random random = new Random();
for (int i = 0; i < width; i++)
for (int j = 0; j < height; j++)
isoSurface1.Add(i, j, random.NextDouble());

What I have is essentially a x and y coordinate and a corresponding value to this point which I in the above example is faking. I want to plot it as in the thread I referred to. I stumble onto two problems. First of all how do I get to see the data from the right angle and what is the limit of data that can be plottet. The above example gives me a "Index was outside the bounds of the array." I have model results calculate on grids being 1000*1000. Will that be a problem? Can you redirect me to an example of where this kind of plot is generated using own data and not the sample values.

Best Regards
Franz Thomsen

Posted: Tue Feb 19, 2008 8:48 am
by narcis
Hi Franz,

You need to populate your IsoSurface series like the code snippet below. Please notice that I swapped y and z values. For more information on how those series styles work please read this thread.

Code: Select all

			tChart1.Aspect.View3D = false;			
			
			int height = 300;
			int width = 300;

			Random random = new Random();
			for (int i = 0; i < width; i++)
				for (int j = 0; j < height; j++)
					isoSurface1.Add(i, random.NextDouble(), j); 
Also notice that I switched the chart view to 2D. I've also tried the same chart but using 1000x1000 series and worked fine, even it took a lot of time to draw. Currently maximum grid size allowed is 20000x20000.