Board 0.9.6
SketchFilter.h
Go to the documentation of this file.
1/* -*- mode: c++ -*- */
26#ifndef BOARD_SKETCH_FILTER_H
27#define BOARD_SKETCH_FILTER_H
28
29#include <board/Point.h>
30#include <board/Shape.h>
31#include <board/ShapeList.h>
32#include <board/Types.h>
33#include <tuple>
34#include <vector>
35
36/*
37 * matplotlib.pyplot.xkcd
38 *
39 * https://shihn.ca/posts/2020/roughjs-algorithms/
40 *
41 * https://openaccess.city.ac.uk/id/eprint/1274/
42 */
43
44namespace LibBoard
45{
46struct Path;
47struct Ellipse;
48
49ShapeList makeRough(const Shape & shape, int repeat = 1, SketchFilling filling = PlainFilling, double hachureAngle = 0.0, double hachureSpacing = 0.0);
50
51ShapeList hachuresLinesOrBezier(const std::vector<std::tuple<Point, Point>> & lines, Style style, SketchFilling type);
52
53std::vector<std::tuple<Point, Point>> hachures(const Path & path, double spacing, double angle = 0.0, bool addHorizontals = false);
54
55std::vector<std::tuple<Point, Point>> hachures(const Ellipse & ellipse, double spacing, double angle = 0.0);
56
57ShapeList hachures(const Ellipse & ellipse, Style style, SketchFilling type, double spacing, double angle = 0.0);
58
59ShapeList hachures(const Path & path, Style style, SketchFilling type, double spacing, double angle = 0.0, bool addHorizontals = false);
60
61ShapeList hachures(const Path & path, SketchFilling type, Color color, double width, double spacing, double angle = 0.0);
62} // namespace LibBoard
63
64#endif /* BOARD_SKETCH_FILTER_H */
The Point structure. @copyright This source code is part of the Board project, a C++ library whose pu...
ShapeList class.
@copyright This source code is part of the Board project, a C++ library whose purpose is to allow sim...
@copyright This source code is part of the Board project, a C++ library whose purpose is to allow sim...
Definition Board.h:55
ShapeList makeRough(const Shape &shape, int repeat=1, SketchFilling filling=PlainFilling, double hachureAngle=0.0, double hachureSpacing=0.0)
Definition SketchFilter.cpp:171
SketchFilling
Definition Types.h:33
@ PlainFilling
Definition Types.h:35
ShapeList hachuresLinesOrBezier(const std::vector< std::tuple< Point, Point > > &lines, Style style, SketchFilling type)
Definition SketchFilter.cpp:261
Group hachures()
Definition rough.cpp:71