How to find opposing triangle pairs in triangulated objects?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi,
I want to find opposing triangle pairs in triangulated objects like shown in the example picture. The example data is attached with variables F and V for faces and vertices.
The interesting areas are marked in the pictures.
The requirements for a match of my choice would be:
- distance of triangles lower than threshold, e.g. 3mm
- triangles should be close to parallel. This could be set by a threshold of the "degree of parallelism". However a good measurement could be defined.
- "correct" spatial orientation would be great, but is a bonus.
How I started:
- calculate center of gravity of all triagles
- calculate each of the distances (pdist2)
- remove triangle pairs with too high distances
- calculate normal vectors of remaining triangles
- check "parallelism" of triangles by dot product of normal vectors (dot product >0.9)
- remove adjacent triangle pairs that are "parallel" according to above definition
This is not very robust and leads to following issue:
- second neighbors are still found (neighbors of the adjacent triangles)
Is there a smart way to remove 2nd or 3rd neighbors or neighbors in general (neighborhood matrix/tree?!?)
Is there in general a smarter and more robust way to do that? It seems I ran into a direction where I have to exclude a lot of undesired cases....
Any help is welcome :-)
댓글 수: 2
답변 (1개)
darova
2021년 7월 26일
Here is an idea or finding neigbour points;
% some data
x0 = rand(40,1);
y0 = rand(40,1);
s1 = max(max(x0)-min(x0),max(y0)-min(y0)); % scale factor (max value)
% scale the data
x1 = round((x0-min(x0))/s1*39)+5;
y1 = round((y0-min(y0))/s1*39)+5;
A = zeros(50);
ind = sub2ind(size(A),y1,x1); % indices
A(ind) = 1:40; % write into matrix numbers of points
A1 = A*0;
A1(y1(5)-4:y1(5)+4,x1(5)-4:x1(5)+4) = 1; % region around 5th point
A1 = A.*A1; % select points in region
imshow([A A(:,1)+1 A1])
- Is there a smart way to remove 2nd or 3rd neighbors or neighbors in general (neighborhood matrix/tree?!?)
I don't understand. Why can't you just select max value of dot product?
참고 항목
카테고리
Help Center 및 File Exchange에서 Delaunay Triangulation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!