in reply to Re: Contour mapping?
in thread Contour mapping?
I'd be curious whether the triangles evince some relevant property, like (maybe): no XY coordinate is contained within any such triangle, or the XY plane is fully covered without overlap by the set of triangles
The triangles are a non-overlapping mesh (Delaunay or complient Delaunay Trangulation); the data is from a Finite Element Modeling program.
And yes; I'm also pretty sure the triangles are the key. Having played a little with my stratification idea; it is clear that it is going no where -- producing a tangled web of string rather than nice flowing contours.
This is what I now think I need to do:
Starting with a simple triangular mesh of points, with the heights at the nodes:
/4\ / | \ / | \ / | \ / | \ / | \ / | \ / | \ / | \ / | \ / | \ 3--------------------6.5--------------------5 /|\ | /| +\ / | \ | / | + \ / | \ | / | + \ / | \ | / | + \ / | \ | / | + \ / | \ | / | + \ / | \ | / | + \ / | \ | . / | + \ / | \ | / | + \ / | \ | / . | + \ / | \|/ | + \ 2--------------------5.5--------------------9--------------------7.5 +---------------------6 \ | /|\ | + / \ | / | \ | + / \ | / | \ | + / \ | / | . \ | + / \ | / | \ | + / \ | / | \ | + / \ | / | \ | + / \ | / | \ | + / \ | / | \ | + / \ | / | \ | + / \|/ | \| +/ 3--------------------6.5--------------------6 \ | / \ | / \ | / \ | / \ | / \ | / \ | / \ | / \ | / \ | / \4/
I pick my contour values -- integers 3 to 8 are convenient for this examples -- and process the edges of the triangles linearly (being careful not to process edges twice where they are part of two triangles), and interpolate the positions on those edges where any of my chosen contour values will cross.
Eg. On the edge between value 2 and 5.5, I find the positions are which 3, 4, 5 cross that edge; and store those coordinates in separate arrays for each value. I end up with something as below:
/4\ / | \ / | \ / | \ / | \ / 5 \ / | \ / | \ / | \ / 6 \ / | \ 3-----4------5-----6-6.5-----6--------------5 /|\ | /| +\ / | 4 | / | + \ / | \ 7 6 | + \ / | 5 | / | + \ / 4 \ | / 6 + \ / | 6 | 7 | + \ / | \ 8 / | + \ / | 7 | . / | + \ / 5 \ | 8 | + \ / | 8 | / . 7 + \ / | \|/ | + \ 2-----3------4----5 -5.5--6-----7-----8-----9-------------8------7.5 +------7--------------6 \ | /|\ | + / \ | 8 | \ | + / \ 5 / | \ | + / \ | 7 | . \ 7 + / \ | / 8 8 | + / \ | 6 | \ | + / \ 4 / | \ | + / \ | 5 | \ | + / \ | / 7 7 | + / \ | 4 | \ | + / \|/ | \| +/ 3-----4------5-----6-6.5--------------------6 \ | / \ | / \ 6 / \ | / \ | / \ | 5 \ 5 / \ | / \ | / \ | / \4/
Then it just a case of ordering those arrays of points to produce the polylines that make up the contours something like this:
/4\ / *| \ / * | \ / * | \ / * | \ / * 5 \ / * * | * \ / * * | * \ / * * | * \ / * * 6* * \ / * * * | * * \ 3-----4------5-----6-6.5-----6--------------5 /|\ * * * | * /|\ / *| 4 * * | * / | + \ / * | * \ * * *7 * * 6 | + \ / * |* 5 * * | * / ** | + \ / * 4 * \ * * | * / 6 + \ / * *| * 6 * | 7* | + * \ / * * | * * \ * 8 / * | + * \ / * * |* * 7 *| * . / * | + * \ / * * 5 * * \ * | 8 * | + * \ / * * * | * * 8 | / * . 7 +* * \ / * * * | * * * \|/ * | + * * \ 2-----3------4----5 -5.5--6-----7-----8-----9-------------8------7.5 +------7--------------6 \ * * * | * * * /|\ * | + * * \ * * * | * * 8 | \ * | + * * \ * * 5 * * / * | \ * | +* * \ * * |* * 7 *| . \ * 7 + * \ * * | * * / * 8********8 *| + * \ * *| * *6 * | \ * | + * \ * 4 * / * * | \ * | + * \ * |* 5 * * | \ * | + * \ * | * / * * 7****************7 | + * \ *| 4 * * | \ | + * \|/ * * * | \|* + 3-----4------5-----6-6.5--------6.25--------6 \ * * * | *** / \ * * *| *** / \ * * 6 *** / \ * * | / \ * * | / \ * *| * *5 \ * 5 * * / \ * | / \ * | / \ *| / \4/
I don't have a full handle on the ordering process; but I've a few ideas to try. (Actually, I don't need to order them to do the intersections with the boundaries; though it might be nice to draw the contours to see that they are correct before going on.)
Then all I have to do :) is work out which of those contours intersect the polylines that form the boundaries and work out where and at what angle they intersect.
And then I can start on trying to collate the results in a way that is meaningful...the driving force behind the whole problem.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Contour mapping?
by graff (Chancellor) on Apr 28, 2016 at 07:02 UTC | |
by pryrt (Abbot) on Apr 28, 2016 at 13:24 UTC |