Changing cap style of Mobject to ROUND is influencing Write animations behavior
Description of bug / unexpected behavior
When I change the cap style of an Mobject (a line, in my case) using either the parameter cap_style=CapStyleType.ROUND or the method .set_cap_style(CapStyleType.ROUND) , subsequent Write() animations of MathTex equations appear with dots on the screen. Even though the MathTex object has no direct influence on the Mobject whose cap style was changed.
@nikolajmunk guesses that the points show up because round linestyle (by design) also applies a stroke to paths of length 0, while the other choices don't. That means we're suddenly seeing a stroke show up out of nowhere when the animation starts, even when it's at its beginning size of length 0.
Expected behavior
The expectation is that changing the cap style of a Mobject will not affect other objects.
How to reproduce the issue
This is a simple and clean version of the problem. As we can see, although the second equation is identical to the first, because it was instantiated after the line specifying CapStyleType.ROUND, dots appear on the screen when using the Write animation.
def construct(self):
eq1 = MathTex(r"f(x)=ax^2+bx+c").scale(2)
line = Line(cap_style=CapStyleType.ROUND)
eq2 = MathTex(r"f(x)=ax^2+bx+c").scale(2)
VGroup(eq1, line, eq2).arrange(DOWN, buff=1)
self.play(Write(eq1, run_time=2))
self.play(Create(line))
self.play(Write(eq2, run_time=2))
self.wait()Additional media files
Video generated by manim.exe:
Images/GIFshttps://github.com/user-attachments/assets/85954503-3c6a-434c-aea3-8f1978364728
System specifications
System Details - OS: Windows 10 Pro - RAM: 32 GB - Python version: 3.13.5 - Installed modules: ``` Package Version ----------------------- ------- asttokens 3.0.2 audioop-lts 0.2.2 av 18.1.0 beautifulsoup4 4.15.0 click 8.4.2 cloup 3.1.0 colorama 0.4.6 dearpygui 2.3.1 decorator 5.3.1 executing 2.2.1 glcontext 3.0.0 ipython 9.16.1 ipython_pygments_lexers 1.1.1 isosurfaces 0.1.2 jedi 0.20.0 manim 0.21.0 ManimPango 0.6.1 mapbox_earcut 2.0.0 markdown-it-py 4.2.0 matplotlib-inline 0.2.2 mdurl 0.1.2 MF-Tools 1.4.9 moderngl 5.12.0 moderngl-window 3.1.1 networkx 3.6.1 numpy 2.5.2 packaging 26.3 parso 0.8.7 pillow 12.3.0 pip 26.2.1 prompt_toolkit 3.0.53 psutil 7.2.2 pure_eval 0.2.3 pycairo 1.29.1 pydub 0.25.1 pyglet 2.1.16 pyglm 2.8.3 Pygments 2.20.0 rich 15.0.0 scipy 1.18.0 screeninfo 0.8.1 setuptools 84.0.0 skia-pathops 0.9.2 soupsieve 2.9.2 srt 3.5.3 stack-data 0.6.3 svgelements 1.9.6 tqdm 4.70.0 traitlets 5.16.1 typing_extensions 4.16.0 typst 0.15.0 watchdog 6.0.0 wcwidth 0.8.2 wheel 0.48.0 ```Source: ManimCommunity/manim