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

Stroke width is ignored for StreamLines when using a single color #3363

Closed
Zinoex opened this issue Sep 8, 2023 · 1 comment · Fixed by #3436
Closed

Stroke width is ignored for StreamLines when using a single color #3363

Zinoex opened this issue Sep 8, 2023 · 1 comment · Fixed by #3436

Comments

@Zinoex
Copy link

Zinoex commented Sep 8, 2023

Description of bug / unexpected behavior

The stroke width for StreamLines is ignored if only a single color is used. This is not the case when color schemes are used.

Expected behavior

I would expect StreamLines to obey the stroke_width parameter, even for the case when a single color is used.

How to reproduce the issue

Code for reproducing the problem
vector_field = StreamLines(
    func,               # It is not important what this function is. 
    x_range=[-1, 1, 0.1],
    y_range=[-1, 1, 0.1],
    padding=0.1,
    stroke_width=1.0,     # Default is 4.0, hence I would expect them thinner.
    color=BLUE_D
)

self.add(vector_field)
vector_field.start_animation()
self.wait(2 * vector_field.virtual_time / vector_field.flow_speed)
vector_field.end_animation()

Additional media files

Images/GIFs

Logs

Terminal output
PASTE HERE OR PROVIDE LINK TO https://pastebin.com/ OR SIMILAR

System specifications

System Details
  • OS (with version, e.g., Windows 10 v2004 or macOS 10.15 (Catalina)):
  • RAM:
  • Python version (python/py/python3 --version):
  • Installed modules (provide output from pip list):
- Linux 5.10.189-1-MANJARO
- 16 GB RAM
- Python 3.11.3

Package                  Version
------------------------ ------------
certifi                  2023.7.22
charset-normalizer       3.2.0
click                    8.1.7
click-default-group      1.2.4
cloup                    0.13.1
cmake                    3.27.4.1
colour                   0.1.5
contourpy                1.1.0
cycler                   0.11.0
decorator                5.1.1
filelock                 3.12.3
fonttools                4.42.1
glcontext                2.4.0
idna                     3.4
isosurfaces              0.1.0
Jinja2                   3.1.2
kiwisolver               1.4.5
lit                      16.0.6
manim                    0.17.3
ManimPango               0.4.3
mapbox-earcut            1.0.1
markdown-it-py           3.0.0
MarkupSafe               2.1.3
matplotlib               3.7.2
mdurl                    0.1.2
moderngl                 5.8.2
moderngl-window          2.4.4
mpmath                   1.3.0
multipledispatch         1.0.0
networkx                 2.8.8
numpy                    1.25.2
nvidia-cublas-cu11       11.10.3.66
nvidia-cuda-cupti-cu11   11.7.101
nvidia-cuda-nvrtc-cu11   11.7.99
nvidia-cuda-runtime-cu11 11.7.99
nvidia-cudnn-cu11        8.5.0.96
nvidia-cufft-cu11        10.9.0.58
nvidia-curand-cu11       10.2.10.91
nvidia-cusolver-cu11     11.4.0.1
nvidia-cusparse-cu11     11.7.4.91
nvidia-nccl-cu11         2.14.3
nvidia-nvtx-cu11         11.7.91
packaging                23.1
pandas                   2.1.0
Pillow                   9.5.0
pip                      22.3.1
pycairo                  1.24.0
pydub                    0.25.1
pyglet                   2.0.9
Pygments                 2.16.1
pyparsing                3.0.9
pyrr                     0.10.3
python-dateutil          2.8.2
pytz                     2023.3.post1
requests                 2.31.0
rich                     13.5.2
scipy                    1.11.2
screeninfo               0.8.1
seaborn                  0.12.2
setuptools               65.5.1
six                      1.16.0
skia-pathops             0.7.4
srt                      3.5.3
svgelements              1.9.6
sympy                    1.12
torch                    2.0.1
tqdm                     4.66.1
triton                   2.0.0
typing_extensions        4.7.1
tzdata                   2023.3
urllib3                  2.0.4
watchdog                 2.3.1
wheel                    0.38.4
LaTeX details
  • LaTeX distribution (e.g. TeX Live 2020):
  • Installed LaTeX packages:
FFMPEG

Output of ffmpeg -version:

ffmpeg version n6.0 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 13.1.1 (GCC) 20230429
configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libjxl --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-version3 --enable-vulkan
libavutil      58.  2.100 / 58.  2.100
libavcodec     60.  3.100 / 60.  3.100
libavformat    60.  3.100 / 60.  3.100
libavdevice    60.  1.100 / 60.  1.100
libavfilter     9.  3.100 /  9.  3.100
libswscale      7.  1.100 /  7.  1.100
libswresample   4. 10.100 /  4. 10.100
libpostproc    57.  1.100 / 57.  1.100

Additional comments

I believe manim/mobject/vector_field.py#L832 ought to be the following to enable stroke_width when self.single_color is true.

if config["renderer"] == "opengl":
    line.set_stroke(self.color, width=self.stroke_width / 4.0)
else:
    line.set_stroke(self.color, width=self.stroke_width)
@u7489432
Copy link

Hi there, I'd like to attempt to resolve this issue, would you mind assigning it to me please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

Successfully merging a pull request may close this issue.

2 participants