@VectorStyler:
It is here feckin' finally:
The Bezigon package is attached as Bezigon-packages.zip.
It contains two versions of the library and the documentation. You only need two files to integrate either version into Vectorstyler: bezigon.h and bezigon.cpp. Everything else is for testing, the demo, or reference.
Which version to use
Bezigon 4.2.0 has three node types: Corner, Smooth and Tangent.
Bezigon 2.2.0 has two: Corner and Smooth. It is about half the size.
On paths made only of Corner and Smooth nodes, the two versions give identical handles. Use 4.2.0 if VectorStyler needs Tangent nodes. I highly recommend it. Otherwise 2.2.0 is the simpler choice.
The permutation documents appear in both version folders and in Technical Documentation. The copies are identical, and the duplication is deliberate so each folder stands alone.
What each file does
bezigon.h is the public interface: the node types, make_node, close_path, set_node_type, compute_handles, drag_handle, and in 4.2.0 segment_is_straight and handle_axis.
bezigon.cpp contains all the rules. It depends only on the standard C++ headers <vector> and <cmath>, and has no global state, I/O or exceptions.
main.cpp is an interactive demo that runs on Windows with the EGE graphics library. It shows how the functions are called and lets you test every gesture. It is not part of the product.
demo_scenes.h (4.2.0 only) holds seven example paths, used by the demo keys 1 to 7 and by the tests.
test_bezigon.cpp is the test program. It needs no window and checks the rules across thousands of cases. Build it with the same compiler and flags as VS to confirm the results match on your toolchain. Expected results are in the README.
The permutation documents show every combination of node types, closes and edits, with a picture for each case. The Corner, Smooth and Cusp document covers both versions. The Tangent document covers 4.2.0 only.
The Technical Reference is the document to read first. It covers the API, the rules, the VectorStyler integration steps, and how degenerate input is handled. The History and Derivation explains how each rule was reached: the formulas, the FreeHand and Xara comparisons, and where we overrode FreeHand for intuitiveness.
README.md is a short overview with the test commands and a manual checklist for the demo.
Further note: You will see PhotoLine addressed throughout because we wrote it with the intention of initially just giving it to PhotoLine, but then changed our minds. So ignore this. The code is software agnostic.
How we used AI: We used AI extensively to test and debug the code we wrote. The model used was Claude Opus 5.5. We used AI extensively to derive formulas from screenshots. This is well documented within the history and derivation document. AI was used to create permutation tables which we then checked against FreeHand. AI was also used to give structure to our original brain dump and produce read me files, and technical references. The code itself was hand written by two extremely patient human beings: Vira Daniel & his long-suffering mate Taras Vynnychenko who obliged me with this mammoth project. He wrote this while he and his neighbours are still under Russian occupation. I wrote zero code. But I provided the complete creative direction to the entire project.