Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opacity of Vector() and DashedVMobject(Vector) (Manim 0.17.3) #3220

Open
uwezi opened this issue Apr 21, 2023 · 3 comments · May be fixed by #4078
Open

opacity of Vector() and DashedVMobject(Vector) (Manim 0.17.3) #3220

uwezi opened this issue Apr 21, 2023 · 3 comments · May be fixed by #4078
Assignees
Labels
good first issue Good for newcomers issue:bug Something isn't working... For use in issues

Comments

@uwezi
Copy link
Contributor

uwezi commented Apr 21, 2023

Description of bug / unexpected behavior

The set stroke opacity and fill opacity is not obeyed for arrow heads - especially not when used within a DashedVMobject

Expected behavior

The opacity of the fill of the arrowhead is kept at 1.0 and not affected by setting the opacity value.

How to reproduce the issue

Code for reproducing the problem
class arrowTransp(Scene):
    def construct(self):
        arr1 = Arrow(ORIGIN,[2,2,0], color=GREEN).shift(2*LEFT+UP)
        arr2 = arr1.copy().shift(DOWN).set_fill(opacity=0.4).set_stroke(opacity=0.4)
        arr3 = VGroup(DashedVMobject(arr2.copy().shift(DOWN))).set_fill(opacity=0.4, family=True).set_stroke(opacity=0.4, family=True)
        self.add(arr1,arr2,arr3)
        arr4 = Arrow(ORIGIN,[2,2,0], color=RED, tip_shape=StealthTip).shift(RIGHT+UP)
        arr5 = arr4.copy().shift(DOWN).set_fill(opacity=0.4).set_stroke(opacity=0.4)
        arr6 = VGroup(DashedVMobject(arr5.copy().shift(DOWN))).set_fill(opacity=0.4, family=True).set_stroke(opacity=0.4, family=True)
        self.add(arr4,arr5,arr6)  

Additional media files

Images/GIFs

image

System specifications

System Details - ManimCE 0.17.3 - OS: Windows 10 64 bit - Python version: 3.9.8
@uwezi
Copy link
Contributor Author

uwezi commented Apr 21, 2023

Ok I discovered the cause of the main problem: for every piece of the dashed line also a copy of the arrow head is added to the dashed VMobject:

class arrowTransp(Scene):
    def construct(self):
        arr1 = Arrow(ORIGIN,[2,2,0], color=GREEN).shift(2*LEFT+UP)
        arr2 = arr1.copy().shift(DOWN).set_fill(opacity=0.4).set_stroke(opacity=0.4)
        arr3 = DashedVMobject(arr2.copy().shift(DOWN)).set_fill(opacity=0.4, family=True).set_stroke(opacity=0.4, family=True)
        self.add(arr1,arr2,arr3)
        arr3a = arr3.copy().shift(2*LEFT) 
        for i in range(len(arr3a)):
            arr3a[i].shift(0.3*i*DOWN)
        self.add(arr3a,index_labels(arr3a)) 
        arr4 = Arrow(ORIGIN,[2,2,0], color=RED, tip_shape=StealthTip).shift(RIGHT+UP)
        arr5 = arr4.copy().shift(DOWN).set_fill(opacity=0.4).set_stroke(opacity=0.4)
        arr6 = DashedVMobject(arr5.copy().shift(DOWN)).set_fill(opacity=0.4, family=True).set_stroke(opacity=0.4, family=True)
        self.add(arr4,arr5,arr6)
        arr6a = arr6.copy().shift(2*RIGHT) 
        for i in range(len(arr6a)):
            arr6a[i].shift(0.3*i*DOWN)
        self.add(arr6a,index_labels(arr6a)) 

image

@github-project-automation github-project-automation bot moved this to 🆕 New in Dev Board Jul 12, 2023
@MrDiver MrDiver added good first issue Good for newcomers issue:bug Something isn't working... For use in issues labels Dec 2, 2023
@MrDiver
Copy link
Collaborator

MrDiver commented Dec 2, 2023

That seems like a big problem!

@EngRia
Copy link

EngRia commented Dec 2, 2023

I am taking a shot at this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers issue:bug Something isn't working... For use in issues
Projects
Status: 🆕 New
Development

Successfully merging a pull request may close this issue.

3 participants