#include <cstdlib>
#include <ctime>
#include <set>
#include <vector>
using namespace LibBoard;
int main(int, char *[])
{
board.
clear(Color::White);
srand(static_cast<unsigned int>(time(nullptr)));
Path pA(Path::ClosedPath);
Path pB(Path::ClosedPath);
board <<
Line(-50, 0, 650, 0, Color::Red);
board <<
Line(-50, 300, 650, -300, Color::Red);
board.
last<
Line>().rotate(90 * Board::Degree);
board << p;
board.
rotate(45 * Board::Degree);
Polyline square(Path::ClosedPath, Color::Black,
Color(70, 70, 130), 0.1);
int n = 80;
std::set<std::pair<int, int>> holes;
while (n--) {
holes.insert(std::make_pair((int)(rand() % 20) - 10, (int)(rand() % 20) - 10));
}
std::set<std::pair<int, int>>::iterator it = holes.begin();
while (it != holes.end()) {
Point p(it->first * 10, it->second * 10);
square.addHole(hole);
++it;
}
board << square.scaled(3).translated(1000, 0).rotated(45 * Board::Degree);
board.
saveEPS(
"holes.eps", Board::A4);
board.
saveSVG(
"holes.svg", Board::BoundingBox, 0.0, Board::UCentimeter);
}