DEV Community

Cover image for How I built a free Minecraft circle generator with 3,100 pre-rendered pages
codereder
codereder

Posted on

How I built a free Minecraft circle generator with 3,100 pre-rendered pages

If you've ever tried to build a circle in Minecraft, you know the problem: the game is a grid of cubes, so there are no curves — only pixelated approximations. Get one block wrong and the whole ring looks lopsided.

I built a free tool that solves this: CircleGen — a static site that turns any diameter into a block-by-block blueprint you can copy straight into the game.

The math: midpoint circle algorithm

A Minecraft circle is just a discrete circle rendered on a square grid. The classic way to compute it is the midpoint circle algorithm: instead of evaluating every point of the circle equation, you walk the arc in one octant and mirror it to the other seven, using an error term to decide whether the next block steps horizontally, vertically, or diagonally.

Two properties matter for building:

  • Odd diameters give a true center block. With an even diameter the "center" falls between four blocks, so the pattern looks off. That's why all my sizes are odd — 5, 7, 9 ... up to 256.
  • The outline vs. filled difference is big. A filled 25-block circle needs 477 blocks; its outline needs only 68. Blueprints that don't tell you which one you're looking at are useless in survival mode, where you might be mining every single block.

Turning math into pages: pre-rendered SEO at zero backend cost

The interesting engineering choice: every size and shape is a real static page, generated at build time with Next.js static export. /circle/101/ isn't a dynamic route that computes on request — it's a pre-rendered HTML file that already contains the full blueprint grid, the exact block count, and a per-size FAQ.

Why bother? Three reasons:

  1. It's genuinely useful data. Each page answers the question you actually searched for: "how many blocks is a 101-block circle?" (316), "what should I use it for?" (stadiums, large temples). That's the kind of computed fact a copy-paste article can't provide.
  2. The math runs once, at build time. Visitors get instant pages with zero server cost — the whole site is static files on a CDN.
  3. Each language gets its own pages. The site ships in 11 languages (English, German, Spanish, French, Portuguese, Turkish, Italian, Russian, Polish, Indonesian, Chinese), each with its own pre-rendered shape pages and hreflang alternates — not machine-translated widgets, but proper localized pages.

What the tool does

Pick a shape (circle, oval, sphere, dome, arc, torus, ellipsoid), a diameter, and a style (outline, chart, filled), and you get:

  • a pixel-perfect blueprint grid you can copy block by block
  • a draggable 3D preview
  • build-order animation and layer slicing for spheres and domes
  • PNG / SVG / CSV / JSON export
  • /setblock commands with your world coordinates
  • a 45-block color palette and "share this exact state" links

Everything runs in the browser — no downloads, no accounts. It works identically for Java and Bedrock editions, which matters more than you'd think: the same block grid applies to both.

The part that took the longest

Not the math — that's 30 lines. The hard part was the content around it: writing the per-size FAQs, the size guide (diameter 15 = fountain base, 101 = stadium), and doing all of it consistently in 11 languages. A generator gets you 90% of the way; the other 10% is explaining, in each language, what the numbers mean for your build.

The code is open source: github.com/ywb-coder/Minecraft-Circle--Generator. If you've built something similar — a generator, a calculator, anything with pre-rendered data pages — I'd love to hear how you structured it. And if you just want a blueprint for your next build: pixelcircle.online — it's free.

Top comments (2)

Collapse
 
coolnico profile image
Nicholas Ma

nice

Collapse
 
ywbcoder profile image
codereder

Thank you for love