Opened 3 years ago
Closed 3 years ago
#25095 closed defect (fixed)
polygon3d ignores the "alpha" (and equivalent "opacity") argument
Reported by:  yzh  Owned by:  

Priority:  major  Milestone:  sage8.2 
Component:  graphics  Keywords:  IMAPolyGeom, alpha, opacity, transparency, 3d 
Cc:  mkoeppe, slelievre  Merged in:  
Authors:  Yuan Zhou  Reviewers:  JeanPhilippe Labbé 
Report Upstream:  N/A  Work issues:  
Branch:  93fe1e2 (Commits, GitHub, GitLab)  Commit:  93fe1e2cc56f22d3662872d83a0ce7510e4d0e69 
Dependencies:  Stopgaps: 
Description (last modified by )
The methods sage.plot.plot3d.shapes2.polygon3d
and sage.plot.plot3d.shapes2.polygons3d
have the keyword argument "alpha" (as well as the equivalent, outdated "opacity" argument). However it is not passed to the plot function. For example,
polygon3d([[1, 2, 3], [0,1,0], [1,0,1], [3,0,0]], color=(0,1,0), alpha=0.5)
or
polygon3d([[1, 2, 3], [0,1,0], [1,0,1], [3,0,0]], color=(0,1,0), opacity=0.5)
is treated as opacity=1.
Related tickets: #21984
Update: The argument "alpha" is equivalent to "opacity" in all the 3d plot functions, such as
point3d
,line3d
,sphere
,icosahedron
,tetrahedron
,dodecahedron
,polygon3d
,polygons3d
,bezier3d
,parametric_plot3d
,revolution_plot3d
, `arrow3d', etc.
Change History (12)
comment:1 Changed 3 years ago by
 Branch set to u/yzh/polygon3d_ignores_the__opacity__argument
comment:2 Changed 3 years ago by
 Cc mkoeppe added
 Commit set to 8948ca22289a7dd97a68ac037ca035a26f2ac6be
 Status changed from new to needs_review
comment:3 Changed 3 years ago by
 Status changed from needs_review to needs_work
For consistency, use alpha instead of opacity, see #21984.
comment:4 Changed 3 years ago by
 Cc slelievre added
 Keywords alpha opacity transparency 3d added
comment:5 Changed 3 years ago by
 Commit changed from 8948ca22289a7dd97a68ac037ca035a26f2ac6be to 6d6a2511a09e63ba33de177fa4ea1826db114dc3
Branch pushed to git repo; I updated commit sha1. New commits:
6d6a251  make keyword alpha equivalent to opacity

comment:6 Changed 3 years ago by
 Description modified (diff)
 Status changed from needs_work to needs_review
 Summary changed from polygon3d ignores the "opacity" argument to polygon3d ignores the "alpha" (and equivalent "opacity") argument
New commits:
6d6a251  make keyword alpha equivalent to opacity

comment:7 Changed 3 years ago by
 Description modified (diff)
comment:8 Changed 3 years ago by
 Commit changed from 6d6a2511a09e63ba33de177fa4ea1826db114dc3 to e01426f55fdad6ab9204b1afaa5fb9772ffca919
Branch pushed to git repo; I updated commit sha1. New commits:
e01426f  import decorator rename_keyword

comment:9 Changed 3 years ago by
 Commit changed from e01426f55fdad6ab9204b1afaa5fb9772ffca919 to 93fe1e2cc56f22d3662872d83a0ce7510e4d0e69
Branch pushed to git repo; I updated commit sha1. New commits:
93fe1e2  keywords alpha and opacity play the same role in all plot3d functions

comment:10 Changed 3 years ago by
 Description modified (diff)
comment:11 Changed 3 years ago by
 Reviewers set to JeanPhilippe Labbé
 Status changed from needs_review to positive_review
Looks good to me.
comment:12 Changed 3 years ago by
 Branch changed from u/yzh/polygon3d_ignores_the__opacity__argument to 93fe1e2cc56f22d3662872d83a0ce7510e4d0e69
 Resolution set to fixed
 Status changed from positive_review to closed
New commits:
pass extra kwds such as opacity in IndexFaceSet
remove obsolete docstring