ManimCommunity / ManimCommunity/manim
V0.18.1 NumberLine's number_to_point() is broken when using `add_tip`
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
the method `.number_to_point()` does not provide the correct position in scene coordinates
## Expected behavior
...well, it should provide the correct location along the numberline
## How to reproduce the issue
Code for reproducing the problem
```py
class group2(Scene):
def construct(self):
axes = NumberLine(x_range=[-5,5.2,1]).add_numbers().add_tip(tip_length=0.5,tip_width=0.1)
t = [MathTex("h_{i}") for i in range(1,11)]
self.add(axes)
for i in range(1,10):
self.add(t[i].next_to(axes.n2p(i-6),DOWN,buff=0.5))
self.add(Dot().move_to(axes.n2p(i-6)))
```
Without the added tip, the positions are correct
```py
class group2(Scene):
def construct(self):
axes = NumberLine(
x_range=[-5,5.2,1]).add_numbers()
t = [MathTex("h_{i}") for i in range(1,11)]
self.add(axes)
for i in range(1,10):
self.add(t[i].next_to(axes.n2p(i-6),DOWN,buff=0.5))
self.add(Dot().move_to(axes.n2p(i-6)))
```
Also adding the tip from the start works
```py
class group2(Scene):
def construct(self):
axes = NumberLine(
x_range=[-5,5.5,1],
include_tip=True,
).add_numbers()
t = [MathTex("h_{i}") for i in range(1,11)]
self.add(axes)
for i in range(1,10):
self.add(t[i].next_to(axes.n2p(i-6),DOWN,buff=0.5))
self.add(Dot().move_to(axes.n2p(i-6)))
```
## Additional media files
Images/GIFs



## System specifications
System Details
- OS (with version, e.g., Windows 10 v2004 or macOS 10.15 (Catalina)): Windows 10 64 bit
- Python version (`python/py/python3 --version`): 3.11.6
## Additional comments
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 at NumberLine.number_to_point() and compare the provided reproductions where add_tip() is called after construction versus include_tip=True at initialization. Run the example scene and verify that points returned by number_to_point() remain at the correct scene coordinates when a tip is added.
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
- Mostly clear
- Newbie friendliness
- 45/100