str2d.Str2D.circle

Str2D.circle(radius: float, char: str = '*') Str3D[source]

Create a circle over object. This is a wrapper around the circle function and returns a new Str3D object with the circle over the data.

Parameters:
  • radius (float) – The radius of the circle. The minimum of the height and width of the data is used as a reference for the radius equal to 1.

  • char (str, optional) – The character to use for the circle, by default ‘*’.

Returns:

A new Str3D object with the circle over the data.

Return type:

Str3D

See also

hole

Create a hole over the data.

Examples

Let’s create an instance of Str2D and assign it to the variable a and then

from str2d import Str2D

a = 3 * Str2D('abcdef\nghijkl\nmnopqr\nstuvwx') * 4
a
abcdefabcdefabcdefabcdef
ghijklghijklghijklghijkl
mnopqrmnopqrmnopqrmnopqr
stuvwxstuvwxstuvwxstuvwx
abcdefabcdefabcdefabcdef
ghijklghijklghijklghijkl
mnopqrmnopqrmnopqrmnopqr
stuvwxstuvwxstuvwxstuvwx
abcdefabcdefabcdefabcdef
ghijklghijklghijklghijkl
mnopqrmnopqrmnopqrmnopqr
stuvwxstuvwxstuvwxstuvwx

We can create a circle over the data.

a.circle(1, char=' ')
abcde              bcdef
ghi   ghijklghijkl   jkl
m   qrmnopqrmnopqrmn   r
  uvwxstuvwxstuvwxstuv
 bcdefabcdefabcdefabcde
 hijklghijklghijklghijk
 nopqrmnopqrmnopqrmnopq
 tuvwxstuvwxstuvwxstuvw
  cdefabcdefabcdefabcd
g   klghijklghijklgh   l
mno   mnopqrmnopqr   pqr
stuvw              tuvwx