ManimCommunity / ManimCommunity/manim

Strange artifacts when rendering SVGs with opengl

Open
#2,029 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

issue:bug opengl
Dominant language
Python
Stars
40.9k
Forks
3.1k
Avg merge
3d 12h
Merged PRs (30d)
25

Description

## Description of bug / unexpected behavior

When renderering some svgs the opengl renderer sometimes renders random lines, or missing pieces from the svg. This issue doesn't exist in cairo

## Expected behavior

Expected svg to render similar to cairos without missing pieces or added artifacts. Just mentioning #1762 and #1890 here as just looking at it visually I wonder if they could be related. See media screenshots

## How to reproduce the issue

Render `half_ellipse.svg` or `arcs01.svg` with code below to see issue.

Code for reproducing the problem

```py
class SvgTest(Scene):
def construct(self):
a = SVGMobject("../tests/test_graphical_units/img_svg_resources/half_ellipse.svg")
self.add(a)
self.interactive_embed()
```
```py
class SvgTest(Scene):
def construct(self):
a = SVGMobject("../tests/test_graphical_units/img_svg_resources/arcs01.svg")
self.add(a)
self.interactive_embed()
```

## Additional media files

Images/GIFs

OPENGL arc:

Screenshot 2021-09-08 at 12 06 23

Cairo arc:

Screenshot 2021-09-08 at 12 06 45

Opengl half ellipse:

Screenshot 2021-09-08 at 12 07 18

Cairo half ellipse:

Screenshot 2021-09-08 at 12 07 04

## 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`):
```
PASTE HERE
```

LaTeX details

+ LaTeX distribution (e.g. TeX Live 2020):
+ Installed LaTeX packages:

FFMPEG

Output of `ffmpeg -version`:

```
PASTE HERE
```

## Additional comments

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided SvgTest examples with tests/test_graphical_units/img_svg_resources/half_ellipse.svg and arcs01.svg, comparing the OpenGL output with Cairo. Trace the SVGMobject rendering path and verify that both SVGs render without missing pieces or random lines in OpenGL, matching the Cairo results.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.