Home›Journal›This post

Girih Tiles in SVG: Build Verified Patterns

Define five tile families, grow only legal attachments, verify every strap seam, art-direct three editions, and export SVG with a geometry receipt.

JP
JP Casabianca
AI Engineer and Product Designer · full-stack delivery · Bogotá

Girih tiles SVG can turn a compact geometric grammar into intricate visual rhythm, but the pattern needs both mathematical proof and cultural care. This tutorial builds a simplified five-tile study, validates every shared seam, separates geometry from art direction, and exports the image beside a replayable receipt.

Frame girih tiles SVG with care

Girih tiles SVG can be a precise way to study geometry, repetition, and visual rhythm, but the medium arrives with cultural history. Girih strapwork appears across Islamic architecture and manuscript traditions; a browser exercise should not flatten that history into a generic exotic texture.

This tutorial builds a simplified five-tile geometric model for learning. It does not claim to reconstruct a specific monument, historical workshop practice, material process, or canonical construction method. Name the source tradition, describe Islamic geometric patterns without treating them as one uniform style, separate historical claims from the digital mechanism, and keep the final caption honest.

The original value here is a verifiable pattern studio. Every placed tile has a type, center, rotation, boundary, and edge signature. A seam oracle checks shared endpoints and strap continuity. A seeded composition can be exported as SVG plus a JSON receipt that another reader can replay.

For a neighboring grid-based composition system, see Truchet tile composition. The Girih model has different pieces and rules, yet both benefit from separating geometry, placement, styling, and evidence. Girih tiles SVG should be beautiful because the construction is legible, not because validation is hidden.

Five simplified girih tile familiesA decagon, pentagon, rhombus, bow tie, and elongated hexagon show numbered vertices and paired strap entry marks.FIVE TILES · ONE EDGE CONTRACTPENTAGONDECAGONRHOMBUSBOW TIEHEXAGON
Five-tile construction grammar. The grammar makes the limited tile set and its seam data visible before styling.
  • Pentagon and decagon establish fivefold and tenfold anchors.
  • Rhombus, bow tie, and elongated hexagon fill compatible edge families.
  • Every edge carries a canonical endpoint key and strap signature.
  • This is a simplified digital grammar, not a historically complete reconstruction.

Reading rule: labels, order, values, shapes, and line styles carry the conclusion; color is supplementary.

Build the five tile families

Use five simplified families: decagon, pentagon, rhombus, bow tie, and elongated hexagon. Define each as normalized vertices around a local origin, then transform by translation, rotation, and scale. This decagonal tiling vocabulary is a deliberately limited study model. Keep geometry in data rather than drawing path strings by hand.

Each edge receives an ordered pair of strap-entry parameters and a direction-independent signature. When two tile edges occupy the same segment, their signatures must agree after orientation reversal. The studio treats a mismatch as a seam defect before it chooses color or line weight.

The Lu and Steinhardt paper on decagonal and quasi-crystalline tilings in medieval Islamic architecture is a useful scholarly source for the relationship between girih tile templates and complex historical patterns. It is not a license to label this simplified browser set historically exact.

The first figure shows the five tile silhouettes, indexed vertices, and strap-entry marks. Shape names appear in text below the graphic, and line styles distinguish boundary from strap. That semantic duplicate matters: a reader should understand the construction without relying on hue. Girih tiles SVG begins with a small grammar whose limits are visible.

Use exact edge keys before tolerance

Floating-point coordinates make adjacent edges look different after independent transforms. Avoid comparing arbitrary decimals directly. Quantize endpoints to a declared grid, order the two endpoint keys canonically, and use the pair as an edge identity. Preserve the unquantized coordinates for drawing.

The tolerance is part of the edition receipt. Too coarse a grid can merge nearby edges; too fine a grid can miss intended neighbors. The oracle rejects zero-length edges, nonfinite coordinates, duplicate tile IDs, self-intersections, and more than two owners per interior edge.

SVG provides the drawing primitives, not the topology proof. The specification for the SVG polygon element defines how point lists become closed shapes. Our SVG tessellation data model must still prove that the point order is valid and that transformed tiles meet under the declared construction.

Show seam status in more than color. The studio adds a short tick for a verified pair, a crossed mark for a mismatch, and an open boundary mark for an exposed edge. A table reports counts by status. That keeps the diagnostic usable in monochrome, forced colors, print, and visual review.

Grow a patch from legal attachments

Start from one decagon at the origin. Enumerate exposed edges, choose one by a deterministic rule, and try candidate tile families whose compatible edge can be transformed onto it. Reject placements that overlap existing interiors, exceed the radius bound, or create an incompatible shared seam.

The generator is intentionally bounded: at most 80 tiles, 2,000 placement attempts, and a fixed viewport. Seeded choice varies which legal candidate wins without weakening the oracle. A failed attempt is recorded with its reason instead of disappearing.

The second figure is a placement ledger. It follows an exposed edge through candidate alignment, overlap rejection, seam validation, and acceptance. The final pattern is only one output; the ledger explains how it was earned.

Compare this process with seeded randomness for generative art, where replayable choice is treated as provenance rather than proof. Girih tiles SVG asks the layout to manage irregular boundaries and multiple tile families. That makes an explicit edge graph more valuable than a pixel-level check. If the bounded search cannot fill a region, export the frontier rather than silently inserting a decorative patch.

Placement and seam oracleAn exposed edge proposes, aligns, checks, and accepts or rejects one bounded candidate.PLACEMENT AND SEAM ORACLEEXPOSED EDGESTEP 1ALIGN CANDIDATESTEP 2OVERLAP + SEAMSTEP 3ACCEPT / REJECTSTEP 4Every handoff has a measured budget, explicit owner, and failure path.
Placement and seam oracle. A placement ledger preserves rejected attempts instead of hiding search failures.
  1. Choose one canonical exposed edge.
  2. Align a compatible candidate edge.
  3. Reject overlaps, triple ownership, and strap mismatch.
  4. Accept only a finite in-bounds tile and record the decision.

Reading rule: labels, order, values, shapes, and line styles carry the conclusion; color is supplementary.

Separate strapwork from tile boundaries

Tile boundaries are construction guides. Strapwork is the visible network carried through the tiles. Keep them in separate SVG groups with stable IDs, and let the final edition hide or soften the guides without deleting the geometry evidence.

Represent each strap segment in local tile coordinates and transform it with the tile. At shared edges, compare endpoint positions and tangent directions. Position continuity alone can produce a visible kink. The oracle therefore records angular error as well as endpoint distance and rejects seams outside the declared limits.

SVG patterns can repeat a motif efficiently; the SVG pattern specification defines that paint-server behavior. This studio does not use a pattern fill to fake the tiling. It keeps individual tiles inspectable, then uses patterns only for optional paper grain and guide texture.

The strap layer can borrow line discipline from Guilloché SVG patterns: consistent stroke width, round joins, controlled contrast, and no raster blur. Girih tiles SVG stays crisp at export sizes because the visible network remains vector geometry rather than a screenshot.

Art-direct rhythm without breaking proof

Once the patch passes topology checks, art direction can change palette, guide visibility, strap weight, corner treatment, background, and crop. It must not change tile placement or seam status. The studio hashes the canonical geometry separately from the style settings so a visual revision cannot masquerade as a new construction.

Three editions use the same patch: Ink Archive emphasizes black straps on warm paper; Cobalt Court uses restrained blue fields and pale linework; Night Compass uses a dark ground with copper accents. Each includes a high-contrast fallback. Color names are descriptive, not historical claims.

The third figure places the editions side by side and prints their shared geometry hash. A small legend lists which properties may change. This makes creative range visible while proving the pattern underneath is identical.

The one-stroke kolam SVG study offers another respectful precedent: state the cultural boundary, verify the digital mechanism, and avoid claiming that a browser rule captures a living practice. Girih tiles SVG should invite further reading and careful making, not present generated ornament as authoritative history.

Ink Archive, Cobalt Court, and Night Compass share one geometry hashThree panels use the same tiled strap network while palette, guide visibility, line weight, and background change.ONE GEOMETRY HASH · THREE EDITIONSINK ARCHIVECOBALT COURTNIGHT COMPASS
One geometry three editions. Art direction changes presentation while the verified construction stays byte-for-byte accountable.
Constant
Tile placements, edge graph, strap endpoints, and geometry hash.
Ink Archive
Warm paper and dark line.
Cobalt Court
Blue field and pale strap.
Night Compass
Dark ground and copper accent.

Reading rule: labels, order, values, shapes, and line styles carry the conclusion; color is supplementary.

Make the SVG accessible and portable

The exported root SVG includes a title and description tied with aria-labelledby. Tile, strap, guide, and diagnostic groups have meaningful IDs. Decorative texture is marked hidden from accessibility APIs. A companion HTML summary reports seed, tile counts, open boundaries, seam mismatches, geometry hash, and edition name.

Keep text out of the artwork except for optional diagnostics. When labels are necessary, use real SVG text with enough contrast and a static HTML equivalent. Do not rely on hover to expose edge details. Keyboard controls in the studio must reach seed, growth limit, edition, guide toggle, regenerate, and export actions with visible focus and 44-pixel targets.

ViewBox dimensions define the logical canvas; width and height adapt to the container. Use vector-effect carefully if line weight must remain constant, and test at narrow widths, 200 percent zoom, print, reduced motion, and forced colors. Animation is optional and never required to understand the pattern.

The downloadable SVG contains no script, external image, remote font, or network reference. That makes the artifact portable and safer to inspect. Girih tiles SVG remains a deterministic document, while the studio that produced it stays a separate local tool.

Export the edition and its receipt

The JSON receipt includes version, seed, bounds, quantization grid, tile definitions, placements, edge owners, seam thresholds, oracle results, geometry hash, edition settings, source notes, and truth boundary. The SVG embeds the geometry hash and a short metadata block so the two files can be paired later.

Reparse both exports. Recompute every polygon and shared edge from the receipt, confirm the SVG groups and hash, and reject unexpected URLs or script. Mutation fixtures reverse a polygon, delete a strap endpoint, accept a triple-owned edge, coarsen the tolerance, and let style alter geometry. An independent validator must kill all five.

The studio’s result is evidence for this simplified construction, not historical authentication. A strong final caption says what was generated, what was verified, which source tradition informed the study, and what remains outside the model.

Girih tiles SVG becomes most interesting when mathematics and visual judgment stay in conversation. The edge graph supports confidence; the editions demonstrate taste; the cultural boundary keeps that confidence proportionate. Export both picture and receipt, invite readers to inspect the mechanism, and revisit the piece when scholarship, source links, browser SVG behavior, or the seam oracle changes.

Runnable local artifact — The studio is a simplified digital geometry study informed by cited scholarship; it does not reproduce a specific historic work, material practice, or complete tradition.

Plain text1 line
Grow a seeded patch from legal attachments, inspect seam evidence, switch style without changing geometry, and export paired SVG and JSON.