3b1b / 3b1b/manim

Incomplete lines while rendering

未關閉
#2,295 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
bug
主要語言
Python
星號
93.9k
分支
7.7k
平均合併
2 天 13 小時
30 天內合併 PR
4

描述

I tried to code the Lorenz Attractor recently mentioned in the 3b1b. However, on rendering the Lorenz Attractor the curve breaks in between as some places.

**Code**:
```
from manimlib import *
from scipy.integrate import solve_ivp
import numpy as np

def lorenz_system(t, state, sigma=10, rho=28, beta=8/3):
x,y,z = state
dxdt = sigma*(y-x)
dydt = x*(rho-z)-y
dzdt = x*y-beta*z
return [dxdt, dydt, dzdt]

def ode_solution_points(function, state0, time, dt=0.01):
solution = solve_ivp(
function,
t_span = (0,time),
y0=state0,
t_eval=np.arange(0, time, dt)
)
return solution.y.T

class LorenzButterfly(Scene):
def construct(self):
axes = ThreeDAxes(
x_range = [-50, 50, 5],
y_range = [-50, 50, 5],
z_range = [0, 50, 5],
width = 16,
height = 16,
depth = 8
)
axes.set_width(FRAME_WIDTH)
axes.center()

self.frame.reorient(43, 76, 1, IN,10)
self.add(axes)

state0 = [10,10,10]
points = ode_solution_points(lorenz_system, state0, 30)
curve = VMobject().set_points_as_corners(axes.c2p(*points.T))
self.add(curve)
```

**Wrong display or Error traceback**:
![image](https://github.com/user-attachments/assets/6e87341f-e143-4f57-a98d-5668fff1d895)

### Additional context
I had cloned the repository on 4th January, 2025. The python version I am using is 3.13.1.

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

此問題與從 ODE 解方程結果點生成的 3D 曲線的 VMobject 渲染有關。查看 manimlib/mobject/types/vectorized_mobject.py 中的 VMobject 類以及 set_points_as_corners 如何處理 3D 座標。檢查 axes.c2p 轉換和 ThreeDAxes 類。曲線中斷表示可能有插值或點順序問題。運行提供的代碼進行重現,然後檢查生成的 points 陣列以及它們如何映射到畫面座標。

由索引模型根據 Issue 內容生成。

評估

領域
computer-graphics, data-visualization
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
描述清楚
新手友好度
55/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。