Skip to content

Conversation

@fzaverl
Copy link
Contributor

@fzaverl fzaverl commented Jun 9, 2023

PR Summary

Copy link
Member

@QuLogic QuLogic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is interesting; how do you manage to workaround Matplotlib not implementing a true 3D renderer?

@QuLogic QuLogic merged commit 1eeec12 into matplotlib:main Jun 12, 2023
@fzaverl
Copy link
Contributor Author

fzaverl commented Jun 13, 2023

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 ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants