mymesh.implicit.torus#

mymesh.implicit.torus(center, R, r)[source]#

Implicit function of a torus oriented about the z-axis.

Parameters:
  • center (array_like) – 3D coordinates ([x, y, z]) of the center of the torus.

  • R (float) – The major axis of the torus. This is the distance from the center of the torus to the center of the circular tube.

  • r (float) – The minor axis of the torus. This is the radius of the circular tube.

Returns:

func – Implicit function of three parameters (x, y, z).

Return type:

function

Examples

surface = implicit.SurfaceMesh(implicit.torus([0,0,0], 1, .25), [-1.25,1.25,-1.25,1.25,-.3,.3], 0.1)
surface.plot(bgcolor='w')
../../_images/mymesh-implicit-torus-1.png