написал функцию рисования полигона по центру холста
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
16
src/main.rs
|
@ -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");
|
||||||
}
|
}
|
||||||
|
|