How to fill data into IsoSurface

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Franz Thomsen
Newbie
Newbie
Posts: 6
Joined: Wed Mar 01, 2006 12:00 am

How to fill data into IsoSurface

Post by Franz Thomsen » Tue Feb 19, 2008 6:09 am

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Feb 19, 2008 8:48 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply