coords.Coords.to_string#

Coords.to_string(fmt='%10.3e %10.3e %10.3e')#

Return a string with the formatted points of a Coords object.

Parameters#

fmtstr, default=”%10.3e %10.3e %10.3e”

Format string to print a single point. It should contain exactly 3 formatting sequences, one for each coordinate.

Returns#

str

A formatted string representing all points.

Examples#

>>> x = Coords([[[0.,0.],[1.,0.]],[[0.,1.],[0.,2.]]])
>>> print(x.to_string())
0.000e+00  0.000e+00  0.000e+00
1.000e+00  0.000e+00  0.000e+00
0.000e+00  1.000e+00  0.000e+00
0.000e+00  2.000e+00  0.000e+00
>>> print(x.to_string("%5.2f "*3))
0.00 0.00 0.00
1.00 0.00 0.00
0.00 1.00 0.00
0.00 2.00 0.00