Skip to content

This is a Python program that renders a doughnut in a 3D space on the terminal using ASCII art. It calculates the 3D coordinates of the doughnut using trigonometry and renders it using the terminal cursor and color control characters. The program is customizable and has no external dependencies, making it easy to use and modify.

Notifications You must be signed in to change notification settings

codewithkim1/Python-Program-to-render-a-doughnut-in-terminal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Program to Renderer Doughnut in Terminal

This is a Python program that renders a doughnut in a 3D space on the terminal using ASCII art. The program calculates the 3D coordinates of the doughnut using trigonometry and renders it using the terminal cursor and color control characters.

Usage

To run the program, simply execute the terminal_doughnut_renderer.py file in your terminal. The doughnut will be rendered continuously until you stop the program using Ctrl + C.

python terminal_doughnut_renderer.py

Usage

Customization You can customize the shape and animation of the doughnut by modifying the parameters in the code:

# Define the parameters of the doughnut
R = 15
r = 7

# Render the doughnut
while True:
    render_doughnut(R, r, 5, 15)

The R and r parameters control the size of the doughnut, while the third and fourth arguments of the render_doughnut() function control the increments for the theta and phi angles, respectively.

Dependencies

This program has no external dependencies and can be run using only the Python Standard Library.

License

MIT

About

This is a Python program that renders a doughnut in a 3D space on the terminal using ASCII art. It calculates the 3D coordinates of the doughnut using trigonometry and renders it using the terminal cursor and color control characters. The program is customizable and has no external dependencies, making it easy to use and modify.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages