Stanford BunnyΒΆ

../../_images/bunny1.png

View of the Stanford Bunny test model using an obj format file with Matplotlib rendering.

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

# Stanford Bunny Obj datafile

# Setup surface ................................................

surface = s3d.get_surfgeom_from_obj("data/bunny.obj", color='w',edgecolor='k',lw=.25)

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

fig = plt.figure(figsize=plt.figaspect(1))
fig.text(0.975,0.975,str(surface), ha='right', va='top', fontsize='smaller', multialignment='right')
ax = plt.axes(projection='3d')
ax.set( xlabel='X', ylabel='Y', zlabel='Z' )

s3d.auto_scale(ax,surface,uscale=.8)
ax.add_collection3d(surface)

fig.tight_layout()

plt.show()