3b1b / 3b1b/manim

Incomplete lines while rendering

Open
#2,295 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
93.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.