# Neusis (Marked-Ruler) Heptagon Construction as an HTML Animation: A Hard Benchmark for LLM Capabilities
When evaluating large language models, HTML page generation is still one of the most common test formats: quick to set up and easy to inspect. But as model capability has improved across the board, these tests have lost much of their discriminating power. Tasks that combine strict geometric constraints with animation logic are the exception. Constructing a regular heptagon with a marked ruler and animating the whole construction in HTML is one such task: it compresses mathematical reasoning, construction logic, coordinate math, and rendering animation into a single deliverable, and getting it wrong is easy. This article explains why the heptagon is a good test case, how the marked-ruler construction works, which engineering problems show up in the HTML implementation, and how to evaluate output by process rather than by final screenshot.
1. From “Toy Tests” to a Real Capability Threshold
When evaluating large language models, generating an HTML page has long been one of the most common testing methods. It is quick to set up and the results are easy to inspect. As model capability has improved broadly, though, the discriminating power of this kind of test is falling fast: more and more models can produce a runnable page without difficulty, and the evaluation has gradually degraded into a toy exercise.
That does not mean HTML-based tasks have lost their value. Quite the opposite. Certain pages that combine strict geometric constraints with animation logic have become an effective capability threshold: whether a model can complete them directly reflects its real level in long-chain reasoning, spatial geometry understanding, and front-end code organization.
“Build an HTML animation of a regular heptagon using a marked ruler” is exactly such a case. On the surface it is about drawing a figure. In practice it packs mathematical reasoning, construction logic, coordinate calculation, and animation rendering into one task, and a single careless step can derail the whole thing.
2. Why the Regular Heptagon Is a Good Test
To understand the difficulty here, start from classical geometry. By Gauss’s well-known result on constructible polygons, a regular n-gon can be constructed with straightedge and compass alone (an unmarked straightedge and a pair of compasses) if and only if n is a product of a power of 2 and some number of distinct Fermat primes. The constructible prime side counts are limited to sporadic values such as 3, 5, 17, and 257 — and 7 is not among them.
In other words, a regular heptagon cannot be constructed with straightedge and compass alone. The key quantities associated with it, such as cos(2π/7), satisfy an irreducible cubic equation, so the corresponding field extension has degree 3. Straightedge-and-compass construction can only handle quadratic extensions and cannot solve a cubic problem of this kind. This is precisely why the heptagon has become a landmark counterexample in the history of geometry: it forces you to step outside the standard toolkit.
One classic way to step outside that toolkit is the marked ruler (a straightedge with graduations, also called a sliding ruler). This tool can perform a “sliding alignment” operation that straightedge and compass cannot, which makes cubic problems solvable and, in turn, makes the regular heptagon constructible. In geometry this is known as neusis — insertion construction with a marked ruler. Solving a cubic equation and drawing a regular heptagon with a graduated ruler is essentially the translation of an algebraically impossible construction into executable geometric steps. That is the essence of the task as a benchmark: the model must not only know the result, it must actually walk through every step.
3. The Core Idea of the Marked-Ruler Construction
Taking the approach given in the task as an example, it can be broken down into the following stages. This describes one typical construction; the point is to understand its logic, not to treat it as the only canonical answer:
- Establish the base figure: take a square as the coordinate reference, and fix its bottom edge and four vertices (for example, label the bottom-left vertex D and the bottom-right vertex E).
- Draw an auxiliary line: construct the perpendicular bisector of the bottom edge as the target line for the subsequent alignment.
- Draw an auxiliary circle: with the bottom-right vertex E as center and the diagonal length as radius, draw circle E.
- Align with the marked ruler: the graduated ruler stays pressed against the bottom-left vertex D while sliding, so that its first graduation lands on circle E and its second graduation passes exactly through the perpendicular bisector of the bottom edge. This is the crux of the whole problem — a single non-classical alignment achieved through two simultaneous constraints.
- Finish with the standard toolkit: once the alignment is fixed, return to straightedge-and-compass work and proceed with the perpendicular bisector, locating the circumcenter of the circumscribed circle, and so on.
- Complete the heptagon and add animation: fill in all the construction marks that were omitted, leave compass traces only where they are necessary, and finally support export to an animated image.
Notice that the difficulty does not lie in any single step being impossible to “calculate.” It lies in whether the model can stay consistent across the entire long chain: the coordinate system must not drift, no constraint may be dropped, and the order must not get tangled.
4. Implementation Challenges
Even if a model understands the mathematical logic, turning it into runnable HTML brings several engineering challenges:
- Coordinate system and geometric computation: both SVG and Canvas use a screen coordinate system with the y-axis pointing downward. The model has to correctly map geometric points to actual render coordinates, avoiding mirrored flips or distorted proportions.
- Trace animation: compass-and-straightedge construction is fundamentally about “leaving arcs behind.” A high-quality implementation should make arcs appear on demand rather than filling the screen with all auxiliary lines at once. This requires precise control over when to draw and how much to draw.
- Interaction and export: the task also asks for the ability to “output an animated image,” which typically requires drawing frame by frame on an offscreen canvas inside the page and then encoding those frames into an animation — involving frame sequence management and coordination with the browser rendering pipeline.
A schematic SVG skeleton looks roughly like this:
<svg viewBox="0 0 400 400" id="stage"><!-- Base square and perpendicular bisector of the bottom edge --><line id="perpBisector" x1="0" y1="200" x2="400" y2="200" /><!-- Circle E: centered on the bottom-right vertex, radius = diagonal --><circle id="circleE" cx="350" cy="350" r="..." /><!-- Marked ruler: slides while staying against D, its two graduationslanding on circle E and on the perpendicular bisector respectively --><line id="markedRuler" ... /></svg><script>// Advance the marked ruler frame by frame so that// "first graduation on circle E, second graduation on the perpendicular bisector" holdsfunction step(t) {// Compute the ruler angle from t so that both constraints hold simultaneously// Update x1/y1/x2/y2 of markedRulerrequestAnimationFrame(step);}</script>
What this code really tests is whether the model can translate “two geometric constraints holding simultaneously” into a solvable equation, and then converge on that equation stably inside an animation loop.
5. How to Evaluate Output: Respecting the Constraints vs. Forcing an Answer
When evaluating this kind of task, the most important criterion is not “did a regular heptagon appear at the end,” but “does the construction match what the task asked for.”
A common failure mode: the model does produce a heptagon that looks correct, but it never followed the marked-ruler path given in the task. Instead it quietly adds extra steps that were not in the prompt and forces out the result using a different line of logic. This kind of output looks almost fine in a static screenshot; inspect the construction process frame by frame, and you will see that it departed from the intended direction.
A reliable evaluation should therefore focus on three things:
- Process consistency: does every construction step correspond to a constraint described in the prompt, and are there any steps that appeared out of nowhere?
- Constraint closure: are the two marked-ruler alignments strictly satisfied, rather than papered over with approximations or skipped steps?
- Explainability: can the model clearly state the basis for each step, instead of handing over code that “just runs”?
An implementation that genuinely works through the construction is more valuable than a fast one that sidesteps the core constraints, even if the working one stutters and takes longer — because it demonstrates capability rather than coincidence.
6. Common Failure Modes and Tuning Directions
In practice, this kind of long-chain geometric task tends to show the following problems:
- Reasoning without landing: the model keeps “thinking” but is slow to produce usable code, which makes the experience feel disjointed.
- Slow output: complex geometric reasoning often comes with a longer time to first token and a drop in per-segment generation speed. That is an understandable cost, but it is not friendly to real-time interaction.
- Constraint drift: over a long context, the model gradually departs from the original requirement and substitutes self-invented steps for the construction given in the task.
- Rendering distortion: poor handling of the coordinate system produces incorrect proportions, orientation, or positioning.
The corresponding tuning directions are equally clear: state explicitly in the prompt that no steps outside the task description may be introduced; split the task into four independently checkable stages — mathematical modeling, constraint solving, rendering, and export; and run unit-test-style validation on each stage rather than judging only the final image.
7. Recommendations for Teams: Building a More Discriminating Benchmark
If the goal is to continuously track and compare model capability across versions, then instead of relying on increasingly “watered-down” generic HTML tests, it is better to introduce tasks with hard constraints and pair them with the following practices:
- Design decidable tasks: tasks with an objective right-or-wrong standard, like the regular heptagon, reflect real capability better than subjective judgments of whether something “looks nice.”
- Emphasize process over result: put the review focus on whether the construction logic and constraints hold, so that a screenshot which “looks right” does not mislead you.
- Standardize the evaluation environment: fix the runtime environment, the coordinate reference, and the input format to reduce noise from irrelevant variables.
- Keep multimodal evidence: retain the code, the frame-by-frame animation, and a summary of the model’s reasoning together, so that failure causes can be reviewed afterwards.
Conclusion
“Constructing a regular heptagon with a marked ruler” looks like a small geometry exercise, but it is actually an excellent probe for the overall capability of a large language model: it tests mathematical reasoning, constraint solving, spatial understanding, and front-end engineering implementation all at once. When a model can walk through every step while following the logic given in the task, it has already demonstrated a level far beyond “toy grade,” even if it is slower and stutters along the way. For developers, a truly valuable evaluation is never one where the model “looks like it finished the task,” but one where it “finishes the task in the right direction.”
