Skip to content
/ Drawing Public

This Rust project demonstrates how to draw various geometrical shapes using the raster crate. The shapes include points, lines, triangles, rectangles, circles, pentagons, and cubes.

License

Notifications You must be signed in to change notification settings

K11E3R/Drawing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Geometrical Shapes Drawing

This Rust project demonstrates how to draw various geometrical shapes using the raster crate. The shapes include points, lines, triangles, rectangles, circles, pentagons, and cubes.

Features

  • Point: Represents a single point on the image canvas.
  • Line: Draws a line between two points using Bresenham's line algorithm.
  • Triangle: Draws a triangle using three points.
  • Rectangle: Draws a rectangle given two opposite corners.
  • Circle: Draws a circle centered at a point with a specified radius.
  • Pentagon: Draws a regular pentagon centered at a point with a specified radius.
  • Cube: Draws a 2D representation of a cube.

Docker

To build and run the application using Docker, follow these steps:

  1. Build the Docker image:

    docker build -t rust-drawing-app .
  2. Run the Docker container:

    docker run --rm -v $(pwd):/usr/src/app rust-drawing-app

Usage

  1. Clone the repository:

    git clone https://github.com/K11E3R/drawing.git
    cd geometrical_shapes
  2. Ensure you have Rust and Cargo installed.

  3. Build and run the project:

    cargo build --release
    cargo run
  4. The program will generate an image.png file in the current directory, showcasing the drawn shapes.

Geometrical Shapes

Dependencies

  • raster: A 2D graphics library for Rust used to handle images and pixel manipulation.
  • rand: Provides random number generation capabilities.

Author

Contributing

Contributions are welcome! If you find any bugs or want to add more shapes or features, feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License. See the MIT License file for details.


Enjoy

About

This Rust project demonstrates how to draw various geometrical shapes using the raster crate. The shapes include points, lines, triangles, rectangles, circles, pentagons, and cubes.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published