Vector field decomposed in tangential and normal component along edge (dot product)

Hi all

I would like to split the 2D vector field along the edge of two materials in its tangential and normal parts.

The normal and tangential vectors on the lower material I did get with following filters: 1) Threshold, 2) Extract Surface, 3) Feature Edges and lastly with a 4) Programmable Filter. You can see the vectors in yellow.

Now, I need to apply the dot product between the vector field (red electric field) and the tangential vector. But only along the line, which separates the the two materials.

case_t0002.vtu (3.5 MB)
dot_product_with_edge_tangential.pvsm (1.1 MB)

I’m struggling with the last step, any suggestion?
Thx in advance