How to get perfect common shape

Hello now i try to get perfect common shape of picture1(purple shape and green shape) by using BRepAlgoAPI_Section or BRepAlgoAPI_Common Class.

but i can get only partial intersection shape(black line point by red arrow of picture 2).

i want to get perfect common shape (black line + blue line).

so what can i do ??