2023-03-14 23:10:31 +01:00
|
|
|
#ifndef POLYGON_GENERATOR_H_INCLUDED
|
|
|
|
#define POLYGON_GENERATOR_H_INCLUDED
|
|
|
|
|
|
|
|
#include "polygons.h"
|
|
|
|
|
|
|
|
#include <cassert>
|
|
|
|
|
|
|
|
namespace poly_generate {
|
|
|
|
|
2023-05-19 16:31:38 +02:00
|
|
|
polygon
|
|
|
|
rectangle(double width, double height, std::string label = "rectangle");
|
2023-03-14 23:10:31 +01:00
|
|
|
|
2023-05-19 16:31:38 +02:00
|
|
|
inline polygon square(double width, std::string label = "square") {
|
2023-03-14 23:10:31 +01:00
|
|
|
assert(width > 0);
|
2023-05-19 16:31:38 +02:00
|
|
|
return rectangle(width, width, label);
|
2023-03-14 23:10:31 +01:00
|
|
|
};
|
|
|
|
|
2023-05-19 16:31:38 +02:00
|
|
|
polygon triangle(
|
|
|
|
double side1, double side2, double angle, std::string label = "triangle"
|
|
|
|
);
|
2023-03-14 23:10:31 +01:00
|
|
|
|
2023-05-19 16:31:38 +02:00
|
|
|
polygon regular(double radius, uint n_sides, std::string label = "regular");
|
2023-04-25 12:01:51 +02:00
|
|
|
|
2023-05-19 16:31:38 +02:00
|
|
|
polygon general(std::vector<vec2d> points, std::string label = "general");
|
2023-04-25 12:01:51 +02:00
|
|
|
|
2023-03-14 23:10:31 +01:00
|
|
|
}; // namespace poly_generate
|
|
|
|
#endif
|