how to judge two 2D-meshes have the same topology structure?

yaoyansi

New member
Joined
May 13, 2010
Messages
2
hi, all
I'm sorry but I'm not sure whether it is right to post this topic here.

My question is , given two 2D-meshes, how to find that they have the same topplogy structure?

And I need to write a c++ function to solve this problem. so, is there any library and tool available to solve this problem?

Thank you.
 
I think I can convert my question to a matrix equation, but I don't know how to solve this matrix equation.

For example, here are two meshs:
mesh A:
3
/|\
/ | \
/ | \
1--2 |
| /| /
|/ | /
0--4/

and mesh B:
1
/|\
/ | \
/ | \
0--3 |
| /| /
|/ | /
4--2/

(number denotes the point index, and '\/|-' denote the edge)

I think I can use matrix to express the topology structure.
For example, mesh A can be expressed by a matrix MA,
if point i and point j are connected, then MA[j] = 1, else MA[j] = 0; define MA=0.
then the MA is:
\
\ 0 1 2 3 4
+-----------
0 | 0 1 1 0 1
1 | 1 0 1 1 0
2 | 1 1 0 1 1
3 | 0 1 1 0 1
4 | 1 0 1 1 0

And mesh B can be expressed by matrix MB:
\
\ 0 1 2 3 4
+-----------
0 | 0 1 0 1 1
1 | 1 0 1 1 0
2 | 0 1 0 1 1
3 | 1 1 1 0 1
4 | 1 0 1 1 0


So, If 2d-mesh A has the same topology structure with 2d-mesh B, there should exist a matrix T which can tranform MA to MB:
MA * T = MB;

Now the original question is converted to find whether there exists T to make the equation MA*T=MB come true.
But the difficulty is the MA maybe a singular matrix, and the inverse of MA doesn't exist at all.
So, how to solve this matrix equation?
 
Top