First input T is a triangulation (triplet list of indices -positive integers-, each index refering to a vertex number in a corresponding vertices list).
Given a second input t (a certain triangle row index), one would like to query the list L of all its triangle neighbor indices. A triangle is neighbor to another triangle if they share exactly one edge.
For instance if
T = [1 2 4;... 2 3 4;... 5 6 8;... 6 7 8;... 1 2 5;... 2 5 6;... 2 3 6;... 3 6 7;... 3 4 7;... 4 7 8;... 4 1 8;... 1 8 5]
and t = 3, then the function should return
L = [4, 6, 12]'
since rows / (triangles of T) 4, 6, and 12 contain an edge in common with triangle / row 3.edge [6 8] for the first, edge [5 6] for the second, and edge [8 5] for the third.
Hypothesis :
- Since a triangle is not considered neighbor of itself, t should not be part of L.
- Order doesn't matter, but T must be a column vector containing all the neighbor triangle -row- indices (except itself then) once only. No duplicata is admitted.
- Edges are symmetric : [e1, e2] is the same edge as [e2, e1]
- Every indices are positive, distinct integers.
1964 Solvers
Calculate the Levenshtein distance between two strings
318 Solvers
Find the largest value in the 3D matrix
913 Solvers
All Humans are Created Equal - Pareto Equality
13 Solvers
17 Solvers
Problem Tags