Windows Develop Bookmark and Share   
 index > Windows Forms General > Isolines in VB.net app
 

Isolines in VB.net app

Hey !

Well, im developing an ingeneering app in some windows forms using VB.net. In one part I have to get the temperature distribution in a mesh, and it works, i can know where the points are, their temperature and draw them. After that, i need to find the isolines, which means ill interpolate between the points of the mesh to get to the coordinates where the integer values of temperature are. That works as well, the app finds the points. What doesnt work is when I try to unite them, like draw lines between points of the same temperature to have the isoline. My idea was to do like a search to find the nearest point of the same temperature, collect the coordinates and draw a line, but it doesnt work as good as it sounds. Got some trouble with this. Moreover, i need to save the coordinates of each two points that are connected so that in a next phase ill draw the flux lines, perpendicular to the isolines..! Anyone has nice ideas on how to do this connect-the-right-dots thing ? Smile

Thanks in advance,

Nuno
Nuno_Correia  Wednesday, July 23, 2008 8:12 PM

Hi Nuno,

Based on my understanding, you are collecting some ideas about how to draw isolines and flux lines in VB.net app.

Assume that all the temperatures are in the coordinate system. The following is what I can think to draw the isolines.

1. We collect the lowest temperature in the coordinate system and put them into a collection.(the temperature in the collection is the same)

2. Sort the temperature objects in the collection by X-coordinate.

3. Define a StartPoint variable which stores the start point objects we will use to draw the line.

4. Search the temperate object whose X-coordinate is the smallest and assign it to the StartPoint.

5. Keep searching the temperature object whose X-coordinate is the second smallest and assign it to the EndPoint.

6. Draw the line which uses StartPoint and EndPoint. The line will be the first part of the isoline with this temperature.

7. Assign the EndPoint to the StartPoint, and search in the collection for the third smallest X-coordinate temperature object as the EndPoint.

8. Keep doing this until the last object is reached.

As for flux lines, it’s hard for me to give you any suggestions, because I don’t know which two points you will choose to draw the flux line.

Best Regards,

Bruce Zhou

Windows Forms General FAQs
Windows Forms Data Controls and Databinding FAQs

Bruce.Zhou  Tuesday, July 29, 2008 7:08 AM

Hi Nuno,

Based on my understanding, you are collecting some ideas about how to draw isolines and flux lines in VB.net app.

Assume that all the temperatures are in the coordinate system. The following is what I can think to draw the isolines.

1. We collect the lowest temperature in the coordinate system and put them into a collection.(the temperature in the collection is the same)

2. Sort the temperature objects in the collection by X-coordinate.

3. Define a StartPoint variable which stores the start point objects we will use to draw the line.

4. Search the temperate object whose X-coordinate is the smallest and assign it to the StartPoint.

5. Keep searching the temperature object whose X-coordinate is the second smallest and assign it to the EndPoint.

6. Draw the line which uses StartPoint and EndPoint. The line will be the first part of the isoline with this temperature.

7. Assign the EndPoint to the StartPoint, and search in the collection for the third smallest X-coordinate temperature object as the EndPoint.

8. Keep doing this until the last object is reached.

As for flux lines, it’s hard for me to give you any suggestions, because I don’t know which two points you will choose to draw the flux line.

Best Regards,

Bruce Zhou

Windows Forms General FAQs
Windows Forms Data Controls and Databinding FAQs

Bruce.Zhou  Tuesday, July 29, 2008 7:08 AM
Hi Bruce !

Well, ive got the coordinates of all the temperature points grouped in 'isothermal line' objects, which contain a list of points(value, x.y coordinates) and a value (temperature) property. Based on this u say i should sort the points of each isoline by the lowest x.coord and start connecting them by that order ? What if the logical connection of points doesnt respect that x.coord criteria ? Im thinking about some examples where the lines can be kinda round of circle shaped.. and in that case im not sure if a x.coord or y.coord ordering will do..

About the flux lines ive got one principle that ive got to follow.. i start drawing them in the 'interior side' of the element, till the 'exterior side', cos thats how the heat flow goes. The criteria is one flux line per interior mesh element, so when it gets to the exterior ones it stops. Then I need to collect the lenghts of each segment in each mesh element to do some calculations and stuff..! My idea is to sort that interior points and start drawing perpendicular till the nearest isolines. The endpoints of that initial elements become the new group of start points and so on till the exterior..! Doesnt look bad does it ? Just dont know how to do this in detail..

Best regards, and thanks,

Nuno
Nuno_Correia  Tuesday, July 29, 2008 8:10 PM

Hi Nuno,

I think you have got my idea, however, I don’t know whether lines of circle shaped are essential in your requirement. If we take this point into consideration, of course the problem will be much more complex. It is hard for us to find an easy way to determine the sequence of drawing the lines among the each two points.

Best Regards,

Bruce Zhou

Windows Forms General FAQs
Windows Forms Data Controls and Databinding FAQs

Bruce.Zhou  Wednesday, July 30, 2008 3:49 AM

You can use google to search for other answers

Custom Search

More Threads

• Reloading parent form after child form close
• BeginInvoke not wokring
• Hide Border around the TrackBar
• Threads - when I navigate all of the browsers at once the following happens:
• Asynchronous Web service call real-time patterns
• Assigning an object to a DataGridView column
• Serial Port
• Updating datagridview from database?
• window service
• List of users on the domain