You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Axes3D voxels with alpha rendered wrong -- surfaces seem to cancel #9745
changed the title [-]Axes3D voxels with alpha rendered wrong -- surfaces seem to cancel[[/-][+]Axes3D voxels with alpha rendered wrong -- surfaces seem to cancel[/+]on Nov 10, 2017
I am putting together a PR for this feature (and might have found a bug in the original implementation, too), but I can't think of a good kwarg name for this. Any ideas?
Ah, yeah, I got it to partly work, but could only get 5 of the 6 faces to
get made for some reason. Then I ran out of time to work on it. How about I
push up my branch and set up a WIP PR so you can try it out and see what I
did wrong?
This was a deliberate decision in #6404, but it wasn't a principled one. There was a choice between
Drawing both faces in the same position, and letting z-fighting occur, making their color either a random function of viewing angle, or a function of draw order
Computing a "mixed" color for the two faces, and then drawing one. This is a little more work, and requires you to come up with a good mixing algorithm. Obviously for your single-color case, the algorithm is trivial.
Not drawing them at all
(1) could be fixed by drawing one-sided patches, but I'm not sure if matplotlib supports that.
(2) was more work that I was willing to invest for my problem (alpha was an afterthought), so I thought I'd leave it to someone more opinionated.
@eric-wieser yeah I saw that example, but it seems like a lot of bookkeeping/data-shuffling for a result that (to me) seems like a natural expectation. Would people still be interested in the work started in #9927 ?
That might be reasonable, with gapsize=None or maybe gapsize=0 being the current behavior. I think it should be a fraction of the voxel edge lengths, to scale well to the non-uniform cases.
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
Activity
[-]Axes3D voxels with alpha rendered wrong -- surfaces seem to cancel[[/-][+]Axes3D voxels with alpha rendered wrong -- surfaces seem to cancel[/+]lukasheinrich commentedon Nov 10, 2017
a simpler test dataset exhibiting the same behavior is
notebooks are attached
https://github.com/lukasheinrich/code-snippets/blob/master/voxels.ipynb
https://github.com/lukasheinrich/code-snippets/blob/master/voxels_custom.ipynb
jklymak commentedon Nov 10, 2017
Crossref #9559?
WeatherGod commentedon Nov 10, 2017
no, this is different. The implementation drops faces for adjoining voxels. Perhaps we can make this optional?
lukasheinrich commentedon Nov 10, 2017
@WeatherGod yes that would be great. the internal faces are important if you want to do a 3d heatmap/ density plot.
WeatherGod commentedon Nov 13, 2017
I am putting together a PR for this feature (and might have found a bug in the original implementation, too), but I can't think of a good kwarg name for this. Any ideas?
lukasheinrich commentedon Nov 13, 2017
maybe
internal_faces? with valuesTrue/FalseWeatherGod commentedon Nov 13, 2017
Would
unexposed_facesbe clearer, perhaps?lukasheinrich commentedon Nov 13, 2017
to me
internal_facesis more understandable. Also googling the term brings up similar problems, so maybe it's not a bad term?http://meshlabstuff.blogspot.ch/2009/04/how-to-remove-internal-faces-with.html
WeatherGod commentedon Nov 13, 2017
ok,
internal_facesit is.lukasheinrich commentedon Dec 4, 2017
just following up, what's the status on this -- anyways we can contribute?
WeatherGod commentedon Dec 4, 2017
WeatherGod commentedon Dec 4, 2017
@lukasheinrich , the PR is #9927
eric-wieser commentedon Dec 11, 2017
This was a deliberate decision in #6404, but it wasn't a principled one. There was a choice between
(1) could be fixed by drawing one-sided patches, but I'm not sure if matplotlib supports that.
(2) was more work that I was willing to invest for my problem (alpha was an afterthought), so I thought I'd leave it to someone more opinionated.
(3) was easy, so I went with it!
eric-wieser commentedon Dec 11, 2017
Note that you can use the approach here to force the culled faces to render, as well as avoiding z-fighting issues:

lukasheinrich commentedon Jan 19, 2018
@eric-wieser yeah I saw that example, but it seems like a lot of bookkeeping/data-shuffling for a result that (to me) seems like a natural expectation. Would people still be interested in the work started in #9927 ?
eric-wieser commentedon Jan 19, 2018
I don't think #9927 is a good solution, because it overdraws two polygons of different colors in exactly the same spot
lukasheinrich commentedon Jan 19, 2018
I do like the gapped look from the example you posted. Maybe this would be a good fit (perhaps with a adjustable
gapsizekwarg?eric-wieser commentedon Jan 19, 2018
That might be reasonable, with
gapsize=Noneor maybegapsize=0being the current behavior. I think it should be a fraction of the voxel edge lengths, to scale well to the non-uniform cases.kbasye00 commentedon Jul 11, 2020
Hi, Any progress on this? I was surprised to end up with something like this (where the two middle voxels are the same color):
If not, I might be interested in trying to work out the color blending based on https://en.wikipedia.org/wiki/Alpha_compositing#Alpha_blending Thanks!!
github-actions commentedon Apr 24, 2023
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!