Detection of geometric shapes based on contours

I am trying to implement a basic “greedy” heuristic for dissection puzzles like the tangram: given a geometric shape I would need to extract an area in a silhouette where such figure might fit, with a given degree of similarity, according to how much of its contour matches.

For example in the picture there I’ve highlighted 2 placement for the triangle (I show 2, but there are probably 5) but the blue matches more contour/perimeter. I am aware it is unlikely to be an ideal heuristic, but I am more interested in the problem per se.

I thought about using shape-based matching (something derived from Steger 2002), but I am not sure it is the ideal approach here, and was trying to understand whether there is something more appropriate. Unluckily I am not an expert on computer vision and thus I am writing to ask whether there is a class of similar problems I can look into.
Sorry if the question is a bit general an not code oriented, but after some googling I have realized I don’t know enough terminology to have proper searches.

Thank you in advance

probably related to bin packing, knapsack, “cutting stock”… problems known in computer science