Skip to content

WIP: internal_faces option for axes3d voxels - #9927

Draft
WeatherGod wants to merge 1 commit into
matplotlib:mainfrom
WeatherGod:voxel_improve
Draft

WeatherGod wants to merge 1 commit into
matplotlib:mainfrom
WeatherGod:voxel_improve

Conversation

@WeatherGod

Copy link
Copy Markdown
Member

Can only get 5 of the 6 faces, though... Must have done something wrong.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

By default, only exposed faces of a voxel are rendered,
but you can force the rendering of all faces of the voxels
by setting this keyword argument to True.
.. versionadded:: 2.1

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

whoops, should be 2.2, not 2.1.

@WeatherGod

Copy link
Copy Markdown
Member Author

closes #9745

voxel_faces[i1].append(p2 + square_rot)
elif not filled[i1] and filled[i2]:
elif (internal_faces or not filled[i1]) and filled[i2]:
voxel_faces[i2].append(p2 + square_rot)

@eric-wieser eric-wieser Dec 11, 2017 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this will fix your bug, since right now the if and else are mutually exclusive:

if internal_faces:
    voxel_faces[i1].append(p2 + square_rot)
    voxel_faces[i2].append(p2 + square_rot)
el<the existing if>

@eric-wieser

Copy link
Copy Markdown
Contributor

Drawing both faces on every border is likely to lead to z-fighting, isn't it? Unless the faces are one-sided, in which case you'll be alright.

@eric-wieser

Copy link
Copy Markdown
Contributor

Perhaps cull_internal_faces=True? In general, it's better for bool flags to be verbs.

@jklymak
jklymak marked this pull request as draft July 16, 2020 05:27
@tacaswell

Copy link
Copy Markdown
Member

@WeatherGod what do you want to do about this PR?

@github-actions

Copy link
Copy Markdown

Since this Pull Request has not been updated in 60 days, it has been marked "inactive." This does not mean that it will be closed, though it may be moved to a "Draft" state. This helps maintainers prioritize their reviewing efforts. You can pick the PR back up anytime - please ping us if you need a review or guidance to move the PR forward! If you do not plan on continuing the work, please let us know so that we can either find someone to take the PR over, or close it.

@github-actions github-actions Bot added the status: inactive Marked by the “Stale” Github Action label Apr 27, 2023
llewelld added a commit to alan-turing-institute/hut23-hw24-1662-tournament that referenced this pull request Jun 13, 2024
By default matplotlib will cull internal voxels even if the surrounding
voxels have transparency. This change adds an extra "internal_faces"
parameter to the ax.voxel() method which, when set, ensures internal
voxels are still rendered.

This change is based on the following upstream WIP PR:

matplotlib/matplotlib#9927
llewelld added a commit to alan-turing-institute/hut23-hw24-1662-tournament that referenced this pull request Jun 13, 2024
By default matplotlib will cull internal voxels even if the surrounding
voxels have transparency. This change adds an extra "internal_faces"
parameter to the ax.voxel() method which, when set, ensures internal
voxels are still rendered.

This change is based on the following upstream WIP PR:

matplotlib/matplotlib#9927

This branch has not been deployed

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

Labels

status: inactive Marked by the “Stale” Github Action status: needs rebase topic: mplot3d

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants