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.
750 Solvers
Given an unsigned integer x, find the largest y by rearranging the bits in x
577 Solvers
26 Solvers
Have you seen any Spindromes recently?
13 Solvers
19 Solvers
Problem Tags