Suggestion about Choosing the Right Sensor For Shape Sensor?

Hi,

I want to make a device that use sensor to define what kind of shape the item is being scanned. I don't need to have the shape in 3D, just 2D is enough.

I was thinking about giving few IR proximity sensor, to make something like this:

o o o o o
o o o o o
o o o o o
o o o o o
o o o o o

Legends: o represents the IR sensor.

How do I make it work (in plan):
Put the object, that will interfere the sensor distance. If the object does exist, the sensor will return distances that is less than "empty". So it means that the object was there.
By collecting the sensor return state, I will be able to make the "rough" shape of the object, in 2D form.

Is it possible to make something like this? Or any senior here have better ideas about how to scan / find shape of the objects.

Any ideas will be very much appreciated,

Thank you so much,

Dennis.
PS: I'm new to Arduino here, please be patient with me :). Thank you,

I suppose if you had 5-6 of these in parallel you could do as you envision.

Or 1 on an arm that moved up & down for finer detail vs discrete steps.