65 argc > 1 ?
argv[1] :
"tikz_intersection_example.tex";
70 std::cerr <<
"Cannot open output file: " <<
output_path <<
'\n';
90 BooleanPolygonOperations::Op::INTERSECTION);
94 out <<
"\\documentclass[tikz,border=8pt]{standalone}\n"
95 <<
"\\usepackage{tikz}\n"
96 <<
"\\begin{document}\n\n";
98 out <<
"\n\\end{document}\n";
101 <<
"Compile with: pdflatex " <<
output_path <<
'\n';
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.
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.
static constexpr int Layer_Overlay
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.
Polygon visualize_convex_intersection(Tikz_Plane &plane, const Polygon &subject, const Polygon &clip, const ConvexPolygonIntersectionBasic &intersection_algorithm={}, const Tikz_Style &subject_style=tikz_area_style("blue", "blue!15", 0.45), const Tikz_Style &clip_style=tikz_area_style("orange", "orange!20", 0.45), const Tikz_Style &result_style=tikz_area_style("red", "red!30", 0.60), const int input_layer=Tikz_Plane::Layer_Default, const int result_layer=Tikz_Plane::Layer_Foreground)
Visualizes the intersection of two convex polygons.
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.
Tikz_Style make_tikz_draw_style(const std::string &draw_color)
Create a basic draw style with a custom color.
Array< Polygon > visualize_boolean_operation(Tikz_Plane &plane, const Polygon &a, const Polygon &b, const BooleanPolygonOperations::Op op, const BooleanPolygonOperations &bop={}, const Tikz_Style &a_style=tikz_area_style("blue", "blue!15", 0.35), const Tikz_Style &b_style=tikz_area_style("green!60!black", "green!20", 0.35), const Tikz_Style &result_style=tikz_area_style("red", "red!35", 0.65), const int input_layer=Tikz_Plane::Layer_Default, const int result_layer=Tikz_Plane::Layer_Foreground)
Visualizes a boolean operation (union, intersection, difference) on two polygons.
Helpers to visualize computational-geometry algorithm results in TikZ.