apply_matrix not working
- Linguagem predominante
- Python
- Estrelas
- 93.9k
- Forks
- 7.7k
- Merge médio
- 2d 13h
- PRs com merge (30d)
- 4
Descrição
Hi, i'm trying to apply a simple matrix to 2d vector. The code below draws a vector, but when it comes to
applying matrix i get the following error:
File "c:\users\professional\appdata\local\programs\python\python39\lib\site-packages\manimlib\utils\bezier.py", line 141, in get_smooth_quadratic_bezier_handle_points
last_str = smooth_to_left[0]
IndexError: index 0 is out of bounds for axis 0 with size 0
**Code**:
```
from manimlib.scene.vector_space_scene import *
from manimlib.mobject import *
import numpy as np
class LinearTransformation(LinearTransformationScene):
CONFIG = {
"show_basis_vectors": True,
"foreground_plane_kwargs": {
"x_max": 10,
"x_min": -10,
"y_max": 10,
"y_min": -10,
"faded_line_ratio": 0
},
}
def construct(self):
self.setup()
self.wait()
myVec = Vector([6,1])
myVec.set_color(ORANGE)
self.add_vector(myVec)
self.add_moving_mobject(myVec)
matrix = [[0, 1], [-1, 0]]
self.apply_matrix(matrix)
self.wait()
```
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Direção de pesquisa
O erro ocorre em bezier.py linha 141 em get_smooth_quadratic_bezier_handle_points. Comece examinando o método apply_matrix do LinearTransformationScene e como ele interage com os Vector mobjects. Olhe o vector animation code e o módulo bezier para entender por que smooth_to_left está vazio. Execute o script fornecido para reproduzir o erro, depois rastreie o call stack.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Domínio
- computer-graphics
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 45/100