A shape data specifies the shape of an elongated product within an overall coordinate
system. Local coordinate systems are defined on respective cross-sections of the
elongated product in the overall coordinate system. The local coordinate system
is designed to represent a stable die of a bending apparatus. The images of the
elongated product protruding forward from the stable die within the respective
local coordinate systems serve to specify the position of a movable die of the
bending apparatus. The specified position reflects the deformation induced in the
elongated product between the stable and movable dies. An ideal movement amount
of the movable die can be determined based on the determined positions within the
local coordinate systems. The determined movement amount can be utilized to prepare
the control data for the bending apparatus. When the prepared control data is supplied
to the bending apparatus, an ideal movement of the movable die can be achieved
so as to effect bending on the elongated workpiece at a higher accuracy in accordance
with the shape data.