Interesting Implicit Surface

../../_images/bc_surf.png

Just another variation of a theme. The formula was found in an answer at math stackexchange .

import numpy as np
import matplotlib.pyplot as plt
import s3dlib.surface as s3d

def bc_surf(xyz) :
    x,y,z = xyz
    V,A = (0.80)**2, 0.03
    f1 = ((x**2+y**2-V)**2+(z**2-1)**2)
    f2 = ((y**2+z**2-V)**2+(x**2-1)**2)
    f3 = ((z**2+x**2-V)**2+(y**2-1)**2)
    return f1*f2*f3 - A

surface = s3d.Surface3DCollection.implsurf( bc_surf, 10, 1.1)

# ...................................................................
fig = plt.figure(figsize=plt.figaspect(1), facecolor='k')
fig.text(0.025,0.01,str(surface), ha='left', va='bottom',
    fontsize='smaller', color='navajowhite')
ax = plt.axes(projection='3d', facecolor='k', aspect='equal')
ax.set_axis_off()
ax.view_init(35,-70)
s3d.auto_scale(ax,surface,uscale=.8)
surface.map_cmap_from_normals('copper',ax)
ax.add_collection3d(surface.shade(ax=ax).hilite(focus=2) )

fig.tight_layout(pad=1)
plt.show()