A method and an apparatus for automatically shaping traces by using
computation comprises: setting means that sets an equiangular octagon
circumscribing a clearance circle indicating a position where clearance
can be secured from vias so that one side of such equiangular octagon is
in parallel with a reference line; setting means that sets, with respect
to the existing trace having a segment passing between the vias, an
equiangular octagon circumscribing a circle that is centered on a center
position of the via in the closest vicinity of such segment and that is
tangent to such segment so that one side of such equiangular octagon is
in parallel with the reference line; correction means that corrects the
existing trace in the vicinity of the via so that the trace overlaps any
side of the equiangular octagon set with respect to such via; and
correction means that connects two segments obtained by the correction
means by a segment in a direction of "45.times.n" degrees with respect to
the reference line.