45 for (
size_t i = 0; i < poly.
size(); ++i)
54 argc > 1 ?
argv[1] :
"tikz_polygons_example.tex";
59 std::cerr <<
"Cannot open output file: " <<
output_path <<
'\n';
75 add_polygon_vertices(plane,
convex);
76 add_polygon_vertices(plane,
concave);
83 out <<
"\\documentclass[tikz,border=8pt]{standalone}\n"
84 <<
"\\usepackage{tikz}\n"
85 <<
"\\begin{document}\n\n";
89 out <<
"\n\\end{document}\n";
92 <<
"Compile with: pdflatex " <<
output_path <<
'\n';
bool has_curr() const noexcept
Return true if the iterator has current item.
Represents a point with rectangular coordinates in a 2D plane.
A general (irregular) 2D polygon defined by a sequence of vertices.
void add_vertex(const Point &point)
Add a vertex to the polygon.
void close()
Close the polygon.
A regular polygon defined by center, side length, and vertex count.
Point get_vertex(const size_t &i) const
Get the i-th vertex of the polygon.
const size_t & size() const
Get the number of vertices.
Represents a text string positioned at a 2D point.
2D TikZ canvas storing geometry objects and emitting LaTeX output.
void draw(std::ostream &output, const bool squarize=true) const
Emit a complete tikzpicture with all inserted objects.
void put_cartesian_axis()
Enable Cartesian axes drawing (only when 0 lies in range).
void set_point_radius_mm(const double &radius_mm)
Configure point marker radius.
void add_polygon_vertices(SvgScene &scene, const ::Polygon &poly, const bool as_highlight=false)
Main namespace for Aleph-w library functions.
void put_in_plane(Tikz_Plane &plane, const Geom &geom_obj)
Insert any supported geometry type in a Tikz_Plane.
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.
Iterator over the vertices of a polygon.
TikZ/LaTeX geometric drawing utilities.