(3-D) medical imaging devices, such as CT and MRI, typically produce images as a set of slices. From these slices of images we can reconstruct the surface of the object. People have done much research on this field, and a classical method to simplify the problem is to just consider the surface reconstruction problem between two adjacent slices.
We describe the problem as: given two simple polygons (a simple polygon is a polygon from which we cannot find two boundaries which are intersectant and not adjacent) in two parallel plane, then we can connect segments between the points from different polygons, and form some triangles; these triangles may construct a close side surface of two polygons (as show in the figure above). We can easily find that the triangles must obey the following properties: a boundary of the polygons must belong to one and just one triangle; a triangle must include one and just one boundary of the polygons.
For two simple polygons that are given in two parallel planes, there are a lot of ways to connect the segments, and different ways may look different. There is also much research in this problem, but to make it simple, your job is just to calculate a way of connecting such that the area of the side surface is minimum.