1#include <gtest/gtest.h>
11#include <system_error>
28 return s.find(
"nan") != std::string::npos
or
29 s.find(
"inf") != std::string::npos;
32#ifdef ALEPH_PDFLATEX_EXECUTABLE
38 for (
const char c :
value)
49 std::filesystem::path path_;
54 const auto stamp = std::chrono::high_resolution_clock::now()
55 .time_since_epoch().count();
56 path_ = std::filesystem::temp_directory_path() /
57 (
"aleph-tikz-latex-" + std::to_string(
stamp));
58 std::filesystem::create_directories(path_);
67 std::error_code
error;
68 std::filesystem::remove_all(path_,
error);
80 const std::string & text)
82 std::ofstream
output(path);
90 std::ifstream
input(path);
91 return {std::istreambuf_iterator<char>(
input),
92 std::istreambuf_iterator<char>()};
201 std::ostringstream
output;
203 const std::string result =
output.str();
205 const size_t green_pos = result.find(
"draw=green");
206 const size_t red_pos = result.find(
"draw=red");
234 std::ostringstream
output;
236 const std::string result =
output.str();
238 EXPECT_NE(result.find(
"draw=red"), std::string::npos);
252 std::ostringstream
output;
254 const std::string result =
output.str();
256 EXPECT_NE(result.find(
"fill=red!30"), std::string::npos);
274 std::ostringstream
output;
276 const std::string result =
output.str();
278 EXPECT_NE(result.find(
"dashed"), std::string::npos);
299 std::ostringstream
output;
301 const std::string result =
output.str();
302 EXPECT_NE(result.find(
"draw=blue"), std::string::npos);
319 std::ostringstream
output;
321 const std::string result =
output.str();
323 EXPECT_NE(result.find(
"violet"), std::string::npos);
346 std::ostringstream
output;
348 const std::string result =
output.str();
350 EXPECT_NE(result.find(
"teal!70!black"), std::string::npos);
374 std::ostringstream
output;
376 const std::string result =
output.str();
378 EXPECT_NE(result.find(
"blue!20"), std::string::npos);
385 const Point source(2, 16);
386 const Point target(18, 16);
394 std::ostringstream
output;
396 const std::string result =
output.str();
398 EXPECT_NE(result.find(
"draw=red"), std::string::npos);
399 EXPECT_NE(result.find(
"fill=green!50!black"), std::string::npos);
400 EXPECT_NE(result.find(
"fill=blue"), std::string::npos);
422 std::ostringstream
output;
424 const std::string result =
output.str();
426 EXPECT_NE(result.find(
"orange!90!black"), std::string::npos);
445 std::ostringstream
output;
447 const std::string result =
output.str();
448 EXPECT_NE(result.find(
"blue!60"), std::string::npos);
466 std::ostringstream
output;
468 const std::string result =
output.str();
469 EXPECT_NE(result.find(
"draw=red"), std::string::npos);
483 std::ostringstream
output;
485 const std::string result =
output.str();
486 EXPECT_NE(result.find(
"draw=red"), std::string::npos);
487 EXPECT_NE(result.find(
"draw=blue"), std::string::npos);
501 std::ostringstream
output;
503 const std::string result =
output.str();
504 EXPECT_NE(result.find(
"fill=red!25"), std::string::npos);
527 std::ostringstream
output;
529 const std::string result =
output.str();
530 EXPECT_NE(result.find(
"fill=red!26"), std::string::npos);
545 std::ostringstream
output;
547 const std::string result =
output.str();
548 EXPECT_NE(result.find(
"blue!65"), std::string::npos);
555 const Point query(2, 16);
561 std::ostringstream
output;
563 const std::string result =
output.str();
564 EXPECT_NE(result.find(
"orange!90!black"), std::string::npos);
580 std::ostringstream
output;
582 const std::string result =
output.str();
583 EXPECT_NE(result.find(
"blue!60"), std::string::npos);
584 EXPECT_NE(result.find(
"fill=red"), std::string::npos);
604 std::ostringstream
output;
606 const std::string result =
output.str();
607 EXPECT_NE(result.find(
"fill=red"), std::string::npos);
630 std::ostringstream
output;
632 const std::string result =
output.str();
633 EXPECT_NE(result.find(
"draw=red"), std::string::npos);
653 std::ostringstream
output;
655 const std::string result =
output.str();
656 EXPECT_NE(result.find(
"draw=red"), std::string::npos);
673 std::ostringstream
output;
675 const std::string result =
output.str();
676 EXPECT_NE(result.find(
"draw=red"), std::string::npos);
693 std::ostringstream
output;
695 const std::string result =
output.str();
696 EXPECT_NE(result.find(
"draw=red"), std::string::npos);
703 for (
int i = 0; i < 20; ++i)
710 std::ostringstream
output;
718 const Point source(2, 16);
719 const Point target(18, 16);
728 std::ostringstream
output;
730 const std::string result =
output.str();
732 EXPECT_NE(result.find(
"draw=purple"), std::string::npos);
733 EXPECT_NE(result.find(
"dashed"), std::string::npos);
734 EXPECT_NE(result.find(
"draw=red"), std::string::npos);
750 std::ostringstream
output;
752 const std::string result =
output.str();
754 EXPECT_NE(result.find(
"blue!20"), std::string::npos);
761 const Point source(2, 16);
762 const Point target(18, 16);
777 const Point source(2, 16);
778 const Point target(18, 16);
787 std::ostringstream
output;
789 const std::string result =
output.str();
791 EXPECT_NE(result.find(
"draw=purple"), std::string::npos);
792 EXPECT_NE(result.find(
"draw=orange!90!black"), std::string::npos);
804 scene.put_cartesian_axis()
805 .set_point_radius_mm(0.65);
819 for (
size_t i = 0; i <
arrangement.vertices.size(); ++i)
834 const std::string
tikz =
scene.to_tikz();
835 EXPECT_NE(
tikz.find(
"draw=teal!70!black"), std::string::npos);
851 const auto dt =
scene.visualize_delaunay(points);
854 const auto cp =
scene.visualize_closest_pair(points);
878 const auto rv =
scene.visualize_range_tree_query(
887 const auto av =
scene.visualize_aabb_tree_query(
891 const std::string
tikz =
scene.to_tikz();
906 EXPECT_NE(
latex.find(
"\\documentclass[tikz,border=6pt]{standalone}"),
908 EXPECT_NE(
latex.find(
"}\n\\usepackage{tikz}\n"), std::string::npos);
909 EXPECT_EQ(
latex.find(
"}\\n\\usepackage{tikz}\\n"), std::string::npos);
920 pattern.
pattern =
"north east lines";
929 std::vector<Tikz_Scene>
steps;
931 steps.emplace_back(120, 80, 0, 0,
true);
936 overlays.find(
"\\usetikzlibrary{patterns}");
945 pattern.
pattern =
"north east lines";
947 scene.add_legend_entry(
"Patterned region", pattern);
961 scene.register_tikz_style(
"patternedArea", pattern);
977 opts.frame_title =
"Scene Demo";
978 opts.frame_options =
"t";
984 EXPECT_NE(
latex.find(
"\\setbeamertemplate{navigation symbols}{}"),
986 EXPECT_NE(
latex.find(
"\\begin{frame}[t]{Scene Demo}"), std::string::npos);
987 EXPECT_NE(
latex.find(
"\\usepackage{graphicx}"), std::string::npos);
990 EXPECT_EQ(
latex.find(
"\\documentclass[handout,aspectratio=43]{beamer}"),
1002 opts.frame_title =
"Handout Demo";
1006 EXPECT_NE(
latex.find(
"\\documentclass[handout,aspectratio=169]{beamer}"),
1008 EXPECT_NE(
latex.find(
"\\begin{frame}[t]{Handout Demo}"), std::string::npos);
1011 opts.class_options =
"handout,aspectratio=169";
1020 std::vector<Tikz_Scene>
steps;
1021 steps.emplace_back(120, 80, 0, 0,
true);
1023 steps.emplace_back(120, 80, 0, 0,
true);
1028 opts.frame_title =
"Overlay Demo";
1029 opts.frame_options =
"t";
1033 EXPECT_NE(
latex.find(
"\\documentclass[aspectratio=169]{beamer}"),
1035 EXPECT_NE(
latex.find(
"\\begin{frame}[t]{Overlay Demo}"), std::string::npos);
1040 EXPECT_EQ(
latex.find(
"\\documentclass[handout,aspectratio=169]{beamer}"),
1047 std::vector<Tikz_Scene>
steps;
1048 steps.emplace_back(120, 80, 0, 0,
true);
1050 steps.emplace_back(120, 80, 0, 0,
true);
1056 opts.frame_title =
"Overlay Handout";
1059 EXPECT_NE(
latex.find(
"\\documentclass[handout,aspectratio=43]{beamer}"),
1065 const size_t picture =
latex.find(
"\\begin{tikzpicture}");
1082 const std::vector<Tikz_Scene>
steps;
1085 EXPECT_NE(
latex.find(
"No overlays provided."), std::string::npos);
1092#ifndef ALEPH_PDFLATEX_EXECUTABLE
1093 GTEST_SKIP() <<
"pdflatex, standalone, beamer, or TikZ is unavailable";
1097 pattern.
pattern =
"north east lines";
1101 std::vector<Tikz_Scene>
steps;
1102 for (
size_t i = 0; i < 3; ++i)
1104 steps.emplace_back(178, 108, 0, 0,
true);
1107 Point(20, 20 -
static_cast<long>(i))),
1117 const std::vector<std::pair<std::string, std::string>>
documents = {
1118 {
"standalone",
patterned.to_standalone()},
1125 const std::filesystem::path
tex =
temporary.path() / (name +
".tex");
1130 const std::string command =
1132 " -interaction=nonstopmode -halt-on-error -output-directory=" +
1133 shell_quote(
temporary.path().string()) +
" " +
1134 shell_quote(
tex.string()) +
" > " +
1136 const int status = std::system(command.c_str());
1138 ASSERT_EQ(status, 0) << name <<
" failed:\n" << diagnostics;
1140 const std::string
log =
1143 << name <<
" contains a layout overflow:\n" <<
log;
1145 << name <<
" contains a LaTeX error:\n" <<
log;
1146 EXPECT_EQ(
log.find(
"Undefined control sequence"), std::string::npos)
1147 << name <<
" contains an undefined command:\n" <<
log;
size_t size_t int32_t value
Axis-aligned bounding box tree for spatial queries.
size_t build(Array< size_t > &idx, const size_t lo, const size_t hi)
Alpha shape of a point set.
Andrew's monotonic chain convex hull algorithm.
Simple dynamic array with automatic resizing and functional operations.
constexpr size_t size() const noexcept
Return the number of elements stored in the stack.
T & append(const T &data)
Append a copy of data
Decompose a simple polygon into convex parts using Hertel-Mehlhorn.
Iterator on the items of list.
Doubly-linked list (defined in tpl_dynList.H).
T & append(const T &item)
bool has_curr() const noexcept
static Array< HalfPlane > from_convex_polygon(const Polygon &poly)
Build half-planes from the edges of a closed convex polygon.
static KDTreePointSearch build(const Array< Point > &points, const Geom_Number &xmin, const Geom_Number &ymin, const Geom_Number &xmax, const Geom_Number &ymax)
Build a balanced KD-tree from a point array.
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.
const size_t & size() const
Get the number of vertices.
Dynamic R-tree indexing axis-aligned rectangles by payload.
void insert(const Rectangle &bbox, const Payload &value)
Insert a (bbox, value) entry, copying value.
Static 2D range tree for orthogonal range queries.
void build(const DynList< Point > &points)
Build the range tree from a point set.
An axis-aligned rectangle.
Compute the full planar subdivision induced by a set of segments.
Represents a line segment between two points.
Compute the shortest Euclidean path between two points inside a simple polygon.
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.
static constexpr int Layer_Default
static constexpr int Layer_Overlay
High-level scene wrapper to compose objects and algorithm visualizations.
static std::string to_handout_overlays(const std::vector< Tikz_Scene > &steps, const Tikz_Beamer_Document_Options &options={})
String variant of draw_handout_overlays.
static std::string to_beamer_overlays(const std::vector< Tikz_Scene > &steps, const Tikz_Beamer_Document_Options &options={})
String variant of draw_beamer_overlays.
A non-degenerate triangle defined by three points.
O(n log n) Voronoi diagram construction.
__gmp_expr< T, __gmp_unary_expr< __gmp_expr< T, U >, __gmp_log_function > > log(const __gmp_expr< T, U > &expr)
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
std::string shell_quote(const std::string &s)
Main namespace for Aleph-w library functions.
AABBTreeQueryVizResult visualize_aabb_tree_query(Tikz_Plane &plane, const AABBTree &tree, const Rectangle &query_rect, const Tikz_Style &node_bbox_style=tikz_wire_style("teal!70!black"), const Tikz_Style &leaf_bbox_style=tikz_wire_style("blue!70"), const Tikz_Style &query_rect_style=tikz_wire_style("red", true), const Tikz_Style &query_hit_style=tikz_wire_style("red"))
Visualize AABB tree with a rectangle query overlay.
std::string tolower(const char *str)
Convert a C std::string to lower-case.
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.
AlphaShape::Result visualize_alpha_shape(Tikz_Plane &plane, const DynList< Point > &points, const Geom_Number &alpha_squared, const AlphaShape &algorithm={}, const bool draw_kept_triangles=false, const Tikz_Style &triangle_style=tikz_wire_style("gray!55"), const Tikz_Style &boundary_style=tikz_path_style("orange!90!black"), const bool draw_sites=true, const Tikz_Style &site_style=tikz_points_style("black"))
Compute and insert alpha-shape for input points.
void put_funnel_trace_step(Tikz_Plane &plane, const Polygon &polygon, const Point &source, const Point &target, const FunnelTraceResult &trace, size_t step_index, const Tikz_Style &polygon_style=tikz_area_style("black", "gray!15", 0.22), const Tikz_Style &source_style=tikz_points_style("green!50!black"), const Tikz_Style &target_style=tikz_points_style("blue"), const Tikz_Style &all_portals_style=tikz_wire_style("purple", true), const Tikz_Style &active_portal_style=tikz_path_style("purple"), const Tikz_Style &funnel_leg_style=tikz_path_style("orange!90!black"), const Tikz_Style &committed_style=tikz_path_style("red"), const bool draw_waypoints=true, const Tikz_Style &waypoint_style=tikz_points_style("red"), const int polygon_layer=Tikz_Plane::Layer_Default, const int portal_layer=Tikz_Plane::Layer_Foreground, const int highlight_layer=Tikz_Plane::Layer_Overlay)
Render one funnel-trace frame in a plane.
RangeTreeQueryVizResult visualize_range_tree_query(Tikz_Plane &plane, const RangeTree2D &tree, const Rectangle &query_rect, const bool draw_points=true, const Tikz_Style &split_style=tikz_wire_style("purple"), const Tikz_Style &point_style=tikz_points_style("black"), const Tikz_Style &query_rect_style=tikz_wire_style("red", true), const Tikz_Style &query_hit_style=tikz_points_style("red"))
Visualize range-tree plus a query rectangle and matching points.
PowerDiagram::Result visualize_power_diagram(Tikz_Plane &plane, const Array< PowerDiagram::WeightedSite > &sites, const PowerDiagram &algorithm={}, const bool draw_cells=true, const Tikz_Style &cell_style=tikz_area_style("violet", "violet!18", 0.35), const Tikz_Style &edge_style=tikz_wire_style("violet"), const Tikz_Style &site_style=tikz_points_style("purple"))
Compute and insert Power diagram for weighted sites.
DelaunayTriangulationBowyerWatson::Result visualize_delaunay(Tikz_Plane &plane, const DynList< Point > &points, const DelaunayTriangulationBowyerWatson &algorithm={}, const Tikz_Style &triangle_style=tikz_wire_style("blue"), const bool draw_sites=true, const Tikz_Style &site_style=tikz_points_style("black"))
Compute and insert Delaunay triangulation as triangle outlines.
VoronoiDiagram::Result visualize_voronoi(Tikz_Plane &plane, const DynList< Point > &sites, const VoronoiDiagram &algorithm={}, const bool draw_cells=false, const Tikz_Style &cell_style=tikz_area_style("gray!50!black", "gray!15", 0.35), const Tikz_Style &edge_style=tikz_wire_style("black"), const Tikz_Style &unbounded_edge_style=tikz_wire_style("black", true, true), const Tikz_Style &site_style=tikz_points_style("red"), const Geom_Number &unbounded_ray_length=Geom_Number(50))
Compute and insert Voronoi diagram for input sites.
RegularTriangulationBowyerWatson::Result visualize_regular_triangulation(Tikz_Plane &plane, const Array< RegularTriangulationBowyerWatson::WeightedSite > &weighted_sites, const RegularTriangulationBowyerWatson &algorithm={}, const Tikz_Style &triangle_style=tikz_wire_style("blue!60"), const bool draw_sites=true, const Tikz_Style &site_style=tikz_points_style("black"))
Compute and insert regular (weighted Delaunay) triangulation.
Polygon visualize_half_plane_intersection(Tikz_Plane &plane, const Array< HalfPlaneIntersection::HalfPlane > &halfplanes, const HalfPlaneIntersection &algorithm={}, const Tikz_Style &boundary_style=tikz_wire_style("gray!60", true, true), const Tikz_Style &result_style=tikz_area_style("red", "red!25", 0.50))
Compute and draw bounded half-plane intersection.
void put_in_plane(Tikz_Plane &plane, const Geom &geom_obj)
Insert any supported geometry type in a Tikz_Plane.
RTree< Payload, MaxEntries, MinEntries, Variant >::DebugSnapshot visualize_rtree(Tikz_Plane &plane, const RTree< Payload, MaxEntries, MinEntries, Variant > &tree, const Tikz_Style &node_bbox_style=tikz_wire_style("teal!70!black"), const Tikz_Style &leaf_bbox_style=tikz_wire_style("blue!70"), const Tikz_Style &entry_bbox_style=tikz_wire_style("gray!55"))
Visualize an R-tree/R*-tree hierarchy (node MBRs by depth, plus leaf entry boxes).
Polygon visualize_visibility_polygon(Tikz_Plane &plane, const Polygon &polygon, const Point &query_point, const VisibilityPolygon &algorithm={}, const Tikz_Style &polygon_style=tikz_wire_style("black"), const Tikz_Style &visibility_style=tikz_area_style("orange!90!black", "orange!25", 0.50), const Tikz_Style &query_style=tikz_points_style("red"))
Compute and draw visibility polygon from a query point.
ShortestPathDebugResult visualize_shortest_path_with_portals(Tikz_Plane &plane, const Polygon &polygon, const Point &source, const Point &target, const ShortestPathInPolygon &algorithm={}, const Tikz_Style &polygon_style=tikz_area_style("black", "gray!15", 0.25), const Tikz_Style &source_style=tikz_points_style("green!50!black"), const Tikz_Style &target_style=tikz_points_style("blue"), const Tikz_Style &portal_style=tikz_wire_style("purple", true), const Tikz_Style &path_style=tikz_path_style("red"), const bool draw_waypoints=true, const Tikz_Style &waypoint_style=tikz_points_style("red"), const int polygon_layer=Tikz_Plane::Layer_Default, const int portal_layer=Tikz_Plane::Layer_Foreground, const int path_layer=Tikz_Plane::Layer_Overlay)
Visualize the shortest path plus funnel portals.
Array< SweepLineSegmentIntersection::Intersection > visualize_line_sweep(Tikz_Plane &plane, const Array< Segment > &segments, const SweepLineSegmentIntersection &algorithm={}, const Tikz_Style &segment_style=tikz_wire_style("blue!60"), const Tikz_Style &intersection_style=tikz_points_style("red"))
Compute and draw Bentley-Ottmann line-sweep intersections.
KDTreePointSearch::DebugSnapshot visualize_kdtree_partitions(Tikz_Plane &plane, const KDTreePointSearch &kd_tree, const bool draw_partition_boxes=false, const bool draw_points=true, const Tikz_Style &partition_style=tikz_wire_style("gray!55", true), const Tikz_Style &split_style=tikz_wire_style("blue!70"), const Tikz_Style &point_style=tikz_points_style("red"))
Visualize KD-tree recursive space partitions.
mpq_class Geom_Number
Numeric type used by the geometry module.
DynList< Point > visualize_shortest_path_in_polygon(Tikz_Plane &plane, const Polygon &polygon, const Point &source, const Point &target, const ShortestPathInPolygon &algorithm={}, const Tikz_Style &polygon_style=tikz_area_style("black", "gray!15", 0.25), const Tikz_Style &source_style=tikz_points_style("green!50!black"), const Tikz_Style &target_style=tikz_points_style("blue"), const Tikz_Style &path_style=tikz_path_style("red"), const bool draw_waypoints=true, const Tikz_Style &waypoint_style=tikz_points_style("red"), const int polygon_layer=Tikz_Plane::Layer_Default, const int path_layer=Tikz_Plane::Layer_Foreground)
Visualize the shortest path inside a simple polygon.
void error(const char *file, int line, const char *format,...)
Print an error message with file and line info.
ClosestPairDivideAndConquer::Result visualize_closest_pair(Tikz_Plane &plane, const DynList< Point > &points, const ClosestPairDivideAndConquer &algorithm={}, const Tikz_Style &points_style=tikz_points_style("black"), const Tikz_Style &pair_style=tikz_path_style("red"), const Tikz_Style &pair_points_style=tikz_points_style("red"))
Compute and draw the closest pair from an input point set.
RTreeQueryVizResult< Payload, MaxEntries, MinEntries, Variant > visualize_rtree_query(Tikz_Plane &plane, const RTree< Payload, MaxEntries, MinEntries, Variant > &tree, const Rectangle &query_rect, const Tikz_Style &node_bbox_style=tikz_wire_style("teal!70!black"), const Tikz_Style &leaf_bbox_style=tikz_wire_style("blue!70"), const Tikz_Style &entry_bbox_style=tikz_wire_style("gray!55"), const Tikz_Style &query_rect_style=tikz_wire_style("red", true), const Tikz_Style &query_hit_style=tikz_wire_style("red"))
Visualize an R-tree/R*-tree with a rectangle query overlay, highlighting every entry whose bbox inter...
RotatingCalipersResult visualize_rotating_calipers(Tikz_Plane &plane, const Polygon &polygon, const Tikz_Style &polygon_style=tikz_wire_style("gray!55"), const Tikz_Style &diameter_style=tikz_path_style("red"), const Tikz_Style &width_style=tikz_path_style("blue"), const Tikz_Style &witness_style=tikz_points_style("orange!90!black"))
Compute and draw rotating-calipers diameter and minimum width.
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.
SegmentArrangement::Result visualize_segment_arrangement(Tikz_Plane &plane, const Array< Segment > &segments, const SegmentArrangement &algorithm={}, const bool draw_faces=true, const bool draw_vertices=true, const bool draw_unbounded_face=false, const Tikz_Style &face_style=tikz_area_style("teal!60!black", "teal!12", 0.30), const Tikz_Style &edge_style=tikz_wire_style("teal!70!black"), const Tikz_Style &vertex_style=tikz_points_style("teal!70!black"), const bool color_faces_by_index=false)
Compute and insert arrangement for input segments.
Polygon visualize_minkowski_sum(Tikz_Plane &plane, const Polygon &first, const Polygon &second, const MinkowskiSumConvex &algorithm={}, const Tikz_Style &first_style=tikz_area_style("blue", "blue!14", 0.30), const Tikz_Style &second_style=tikz_area_style("green!60!black", "green!16", 0.30), const Tikz_Style &result_style=tikz_area_style("red", "red!26", 0.60))
Compute and draw Minkowski sum of two convex polygons.
FunnelTraceResult compute_shortest_path_funnel_trace(const Polygon &polygon, const Point &source, const Point &target)
Compute a full SSFA trace (portal-by-portal states).
DynList< Triangle > visualize_monotone_triangulation(Tikz_Plane &plane, const Polygon &polygon, const MonotonePolygonTriangulation &algorithm={}, const Tikz_Style &polygon_style=tikz_wire_style("black"), const Tikz_Style &triangle_style=tikz_wire_style("blue!65"))
Compute and draw triangulation via monotone partition pipeline.
Tikz_Style tikz_area_style(const std::string &draw_color="black", const std::string &fill_color="gray!25", const double opacity=0.6)
Creates a style for drawing filled 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.
Array< Polygon > visualize_convex_decomposition(Tikz_Plane &plane, const Polygon &polygon, const ConvexPolygonDecomposition &algorithm={}, const bool draw_input_polygon=true, const Tikz_Style &input_style=tikz_wire_style("black", true), const bool color_parts_by_index=true, const Tikz_Style &part_style=tikz_area_style("blue!60!black", "blue!15", 0.40), const int input_layer=Tikz_Plane::Layer_Default, const int part_layer=Tikz_Plane::Layer_Foreground)
Compute and insert convex decomposition for a polygon.
T sum(const Container &container, const T &init=T{})
Compute sum of all elements.
static struct argp_option options[]
Full trace for shortest-path funnel processing.
Options used by Tikz_Scene beamer/handout export helpers.
std::string frame_title
Frame title used by scene exports.
std::string class_options
beamer class options (for example aspectratio=169).
double max_picture_height_mm
Maximum rendered picture height in millimeters.
Options used by Tikz_Scene standalone document export.
std::string class_options
Style descriptor for TikZ primitives.
std::string pattern
TikZ pattern (e.g. north east lines)
std::string pattern_color
TikZ pattern color (pattern color=<color>)
Helpers to visualize computational-geometry algorithm results in TikZ.
High-level scene management for TikZ geometry visualization.
R*-tree: an R-tree tuned with the Beckmann-Kriegel-Schneider-Seeger heuristics.