There are following library modules used by demo applications:
utils2D.py--- different procedures work with segments, polygons etc.;
aabb2D.py--- axis-aligned bounding boxes;
isconvex.py--- procedures work with convex polygons;
cbezier2D.py--- procedures work with cubic Bezier curves;
- convex hull algorithms:
- Tkinter events serializer
- BSP tree demo (tkinter)
- Approximation of a Bezier curve (tkinter)
- Intersection of Bezier curves (tkinter)
- Find a convex hull using Graham algorithm (tkinter)
- Sutherland-Hodgman --- clip a polygon against a convex polygon (tkinter)
- Exact bounding box of Tkinter "smooth curve" (tkinter)
- Graph layout using force-based approach (Tkinter)
Most Tkinter-based scripts relie on
tkes.py, it's my attempt to express
interactive tasks in an imperative way. File
tkes-demo.py is a simple
drawing program which use this approach.
BSP-tree-tkdemo.py allows to edit a polygon and represents it as a BSP tree. Then a user may check if a point lies inside or outside the drawn polygon using the tree.
cbezier-as-tkdemo.py use different metrics to approximate a Bezier curve with polyline.
cbezier-cc-tkdemo.py approximates curves with polylines, then check intersection of polylines.
graham-tkdemo.py calculates convex hull of point using Graham algorithm.
polyintersect-tkdemo.py allows to define two or more polygons and clip them using Sutherland-Hodgman algorithm.
tk_ebbox-demo.py --- Tkinter uses Bezier splines to represent "smoothed curves", however its method bbox returns the bounding box of control points. This demo shows how to calculate an exact bounding box.
Cohen_Sutherland-demo.svg demonstrates the algorithm.
elarc_aabb-demo.svg shows how to find the bounding-box of a rotated elliptical arc using basic math properties.
There's an article in Polish which describes the algorithm.
segment-circle-intersection-test.svg show an algorithm to check whether a segment crosses a circle or not.
fba.py allows to select a few graphs and adjust algorithm's settings.