написал функцию рисования полигона по центру холста

main
serr 2025-06-25 18:21:35 +03:00
parent 6b8d5773de
commit 21686c52e4
9 changed files with 8 additions and 8 deletions

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
imgs/polygons/36.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -24,12 +24,12 @@ fn polygon(corners_number: u32, steps_count: u32, output_path: &'static str) {
} }
fn main() { fn main() {
polygon(3, 10, "imgs/polygons/triangle.png"); polygon(3, 10, "imgs/polygons/3.png");
polygon(4, 10, "imgs/polygons/square.png"); polygon(4, 10, "imgs/polygons/4.png");
polygon(5, 10, "imgs/polygons/pentagon.png"); polygon(5, 10, "imgs/polygons/5.png");
polygon(6, 10, "imgs/polygons/hexagon.png"); polygon(6, 10, "imgs/polygons/6.png");
polygon(7, 10, "imgs/polygons/heptagon.png"); polygon(7, 10, "imgs/polygons/7.png");
polygon(8, 10, "imgs/polygons/octagon.png"); polygon(8, 10, "imgs/polygons/8.png");
polygon(9, 5, "imgs/polygons/nonagon.png"); polygon(9, 5, "imgs/polygons/9.png");
polygon(36, 2, "imgs/polygons/circle.png"); polygon(36, 2, "imgs/polygons/36.png");
} }