Info
この質問は閉じられています。 編集または回答するには再度開いてください。
Filling in a sequence that might be circulated or have holes
1 回表示 (過去 30 日間)
古いコメントを表示
I am trying to match two sets of vertices to each other. The values should essentially the same (within tolerance), but there order is out of alignment.
For most vertices this isn't a problem. I do a quick test on their relative distances and if they are within tolerance (and no other points occupy that region) then that point is assigned. However since I am dealing with closed polygons each shape has two identical points at the start and end. The second sequence is always in order, but doesn't necessarily start at the same point. For Example:
Vector 1 5 6 7 8 9 10
Vector 2: 12 13 14 15 16 11 <--the last two in this sequence have the same value.
So my vector 2 looks like this:
12 13 14 15 0 0
with the knowledge that point 11 and 16 are the missing ones. But vector two could also look like this:
0 0 12 13 14 15
or: 14 15 0 0 12 13
and there is the possibility that the order could be completely reversed:
15 14 13 12 0 0
I am sure there is a simple way to work out the order that these indices should go. Does anyone have any ideas?
As an aside there are also possibility of the majority of vertices in a sequence to occupy the same location. So a generalized version would be great. Thanks Ben
1 件のコメント
j dr
2011 年 2 月 8 日
Can you give an example that does what it's supposed to ?
I don't understand where this is going (what you want to achieve)
回答 (0 件)
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!