Edge to Edge SurfaceΒΆ

../../_images/surf_edge2edge.png

Also see Spherical Contour Filled Surface and Spherical Edge Filled Surface .

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

# Surface edge to edge

# 2. Setup and map surfaces .........................................
rez,lrez = 0,4

surface = s3d.SphericalSurface.platonic(rez,'octa')
line = surface.edges
innerLine = copy.copy(line).transform(scale=0.5)
fsurf = line.get_surface_to_line(innerLine,lrez=lrez)

fsurf.map_cmap_from_op( lambda c : s3d.SphericalSurface.coor_convert(c)[0],'inferno')

# 3. Construct figure, add surface, plot ............................

fig = plt.figure(figsize=plt.figaspect(1))
fig.text(0.975,0.975, str(surface)+'\n'+str(line)+'\n'+str(fsurf),
    ha='right', va='top', fontsize='smaller', multialignment='right')
ax = plt.axes(projection='3d', aspect='equal')
s3d.auto_scale(ax,fsurf,uscale=0.65)
ax.set_axis_off()

ax.add_collection(fsurf.shade(0.5,isAbs=True))

fig.tight_layout()
plt.show()