ManimCommunity / ManimCommunity/manim
TipableVMobject tips when adding a tip in Manim 0.17.2
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 40.9k
- Forks
- 3.1k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 25
Description
## Description of bug / unexpected behavior
When adding an arrow tip to a non-straight TipableVMobject, the tip appears to be added twice and the shape itself gets deformed in the process. This appears to be caused bu the code in mobject.py, def put_start_and_end_on(self, start, end) which is supposed to make space for the tip at the beginning or end of the shape. If I understand it correctly the problem arises from the fact that the current start point and the current end point are not on a straight line, while the algorithm appears to be extracting a directional vector between current start- and end-point which it then tries to preserve.
## Expected behavior
Adding a tip should not affect the rest of the shape.
## How to reproduce the issue
The code below creates an arrow at the end of a polyline. Adding the tip turns the whole shape. At the end of the rendering there also appear two arrow tips, one in the correct direction with respect to the original shape and one with respect to the rotated shape.
The problem happens when adding the final object including the tip, as well as when animating the addition of the tip.
Code for reproducing the problem
```py
class SpecialArrow(Scene):
def construct(self):
arrow = TipableVMobject()
vertices = [UR, UL, DL, DR]
arrow.set_points_as_corners(vertices)
self.play(Create(arrow))
self.play(arrow.animate.add_tip())
self.wait()
```
## Additional media files
Images/GIFs
https://user-images.githubusercontent.com/8582807/209808516-2ae3af35-caa1-479a-bd20-5741b4dbd9d0.mp4
## Additional comments
from Discord [https://discord.com/channels/581738731934056449/1057420298615537754](https://discord.com/channels/581738731934056449/1057420298615537754)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in mobject.py at put_start_and_end_on and follow how TipableVMobject.add_tip uses it during the reproduced SpecialArrow scene. Run the provided polyline example, then verify that adding or animating the tip preserves the original shape and produces only the expected tip.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100