12 argc > 1 ?
argv[1] :
"tikz_convex_hull_example.tex";
17 std::cerr <<
"Cannot open output file: " <<
output_path <<
'\n';
59 out <<
"\\documentclass[tikz,border=8pt]{standalone}\n"
60 <<
"\\usepackage{tikz}\n"
61 <<
"\\begin{document}\n\n";
63 out <<
"\n\\end{document}\n";
66 <<
"Compile with: pdflatex " <<
output_path <<
'\n';
Andrew's monotonic chain convex hull algorithm.
Dynamic singly linked list with functional programming support.
T & append(const T &item)
Represents a point with rectangular coordinates in a 2D plane.
A general (irregular) 2D polygon defined by a sequence 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).
static constexpr int Layer_Default
static constexpr int Layer_Foreground
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.
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.
Tikz_Style tikz_wire_style(const std::string &color="black", const bool dashed=false, const bool with_arrow=false)
Creates a style optimized for wireframe segments and polygons.
Polygon visualize_convex_hull(Tikz_Plane &plane, const DynList< Point > &points, const HullAlgorithm &hull_algorithm, const Tikz_Style &point_style=tikz_points_style("black", 0.6), const Tikz_Style &hull_style=tikz_wire_style("red"), const Tikz_Style &hull_vertex_style=tikz_points_style("red"), const int point_layer=Tikz_Plane::Layer_Default, const int hull_layer=Tikz_Plane::Layer_Foreground, const bool draw_hull_vertices=true)
Runs a convex hull algorithm and visualizes the result.
Tikz_Style tikz_points_style(const std::string &color="black", const double opacity=-1.0)
Creates a style optimized for point clouds.
Style descriptor for TikZ primitives.
Helpers to visualize computational-geometry algorithm results in TikZ.