ManimCommunity / ManimCommunity/manim

add_tip() changes shape of ArcBetweenPoints

Open
#1,801 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

## Description of bug / unexpected behavior
When using a `CurvedArrow`, or an `ArcBetweenPoints` with a tip added to it, which is essentially the same, the arc changes shape because of the tip. You can see that the arc doesn't match the circle.

![Bug_ManimCE_v0 8 0](https://user-images.githubusercontent.com/68753500/125821976-d427b252-210f-405c-b943-106798585d8c.png)

This is due to `line 140 in geometry.py -> TipableVMobject -> add_tip()`:
`self.reset_endpoints_based_on_tip(tip, at_start)`

This line is needed so the arc doesn't overlap with the tip, but it changes the arc's shape. Some logic and arithmetic could be added to fix this issue.

Here's how it looks with line 140 removed/commented:
![Bug_ManimCE_v0 8 0](https://user-images.githubusercontent.com/68753500/125823084-65c1b2f6-ca4d-4c69-b1c6-73757b19e1a3.png)

You can see the arc remains the same, but the end of the line overlaps with the tip.

## Expected behavior
I would expect the arc's shape to remain unchanged.

## How to reproduce the issue

Code to reproduce the issue

```py
class Bug(Scene):
def construct(self):

circ = Circle(radius=2, color=WHITE).shift(LEFT*3)

curv = CurvedArrow(circ.get_right(), circ.get_top(), color=ORANGE, tip_length=.1)

circ2 = Circle(radius=3, color=WHITE).shift(RIGHT*3)

arc = ArcBetweenPoints(circ2.get_right(), circ2.get_top(), color=ORANGE).add_tip(tip_length=.1)

self.add(circ, curv, circ2, arc)
```

## Additional media files

Images/GIFs

![Bug_ManimCE_v0 8 0](https://user-images.githubusercontent.com/68753500/125821976-d427b252-210f-405c-b943-106798585d8c.png)

## 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

Reproduce the issue with the CurvedArrow and ArcBetweenPoints examples in the report, then inspect geometry.py around TipableVMobject.add_tip() and reset_endpoints_based_on_tip(). Determine how the tip adjustment changes the arc and verify that the arc keeps its original shape without overlapping the tip.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.