39int main(
int argc,
char * argv[])
41 const std::string output_path =
42 argc > 1 ? argv[1] :
"tikz_scene_example.tex";
44 std::ofstream
out(output_path);
47 std::cerr <<
"Cannot open output file: " << output_path <<
'\n';
56 make_arrangement_segments(),
67 for (
size_t i = 0; i < arrangement.vertices.size(); ++i)
68 arrangement_points.
append(arrangement.vertices(i));
80 const Polygon corridor = make_corridor(0);
81 const Point source(72, 16);
82 const Point target(92, 16);
101 "Scene API: arrangement + hull + shortest path"),
106 "Portals=" + std::to_string(shortest.
portals.size()) +
107 ", Hull vertices=" + std::to_string(hull.
size())),
113 std::cout <<
"Generated " << output_path <<
'\n'
114 <<
"Arrangement vertices: " << arrangement.vertices.size() <<
'\n'
115 <<
"Hull vertices: " << hull.
size() <<
'\n'
116 <<
"Portals: " << shortest.
portals.size() <<
'\n'
117 <<
"Compile with: pdflatex " << output_path <<
'\n';
size_t size_t int32_t * out
Andrew's monotonic chain convex hull algorithm.
Simple dynamic array with automatic resizing and functional operations.
T & append(const T &data)
Append a copy of data
Doubly-linked list (defined in tpl_dynList.H).
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.
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.
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.
Represents a text string positioned at a 2D point.
static constexpr int Layer_Default
static constexpr int Layer_Foreground
static constexpr int Layer_Overlay
High-level scene wrapper to compose objects and algorithm visualizations.
void draw_standalone(std::ostream &output, const Tikz_Standalone_Document_Options &options={}) const
auto visualize_segment_arrangement(Args &&... args)
Tikz_Scene & put_cartesian_axis()
Tikz_Scene & add(const Geom &object)
Polygon visualize_convex_hull(const Points &points, HullAlgorithm &&algorithm, Args &&... args)
ShortestPathDebugResult visualize_shortest_path_with_portals(Args &&... args)
Tikz_Scene & set_point_radius_mm(const double radius_mm)
Main namespace for Aleph-w library functions.
Tikz_Style tikz_path_style(const std::string &color="red", const bool with_arrow=false)
Creates a style optimized for polyline paths.
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.
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.
Tikz_Style tikz_points_style(const std::string &color="black", const double opacity=-1.0)
Creates a style optimized for point clouds.
Result bundle for shortest-path + funnel portal visualization.
Array< FunnelPortal > portals
High-level scene management for TikZ geometry visualization.