matplotlib / mpl-third-party

Third-party Packages Webpage
https://matplotlib.org/mpl-third-party/
53 stars 71 forks source link

create s3dlib.yml #157

Closed fzaverl closed 1 year ago

fzaverl commented 1 year ago

PR Summary

fzaverl commented 1 year ago

Regarding your question: there are basically two aspects to creating the 3D surface visualizations.

First, the 'stacking' order of the faces in the viewing direction. Matplotlib handles this using the calculation of z-order for the Poly3DCollection using the axes view direction. However, it is limited to a single Poly3DCollection object when added to the Axes3D. This is why the S3Dlib documentation indicates that multiple surfaces may need to be added together to form a single 'composite' surface for Matplotlib rendering. ( https://s3dlib.org/examples/composite.html )

Second, each face needs 'color modification' relative to the lighting direction. S3Dlib handles this using the object methods shade, hilite, and map_cmap_from_normals. These method are called prior to adding the object to the Axes3D for Matplotlib rendering. ( https://s3dlib.org/tutorials/render_control/visualization3d.html ) The viewing direction is only needed for these three methods for open-surfaces having front and back surface effects, or for non-orientable surfaces. ( https://s3dlib.org/guides/guides/shading_open.html )

Matplotlib still does the rendering. However, when another rendering engine is used to view the objects, the 'color modification' methods by S3Dlib should not be used. This is shown in Geometry Export examples which use Blender. ( https://s3dlib.org/examples/export.html ).