Skip to content

Latest commit

 

History

History
101 lines (71 loc) · 2.26 KB

File metadata and controls

101 lines (71 loc) · 2.26 KB

Pixel2Plex

Pixel2Plex turns raster images into mosaics built from the 20 two-uniform (demiregular) tessellations of the plane.

It extends the ideas from Pixel2Polygon: instead of regular or Archimedean tilings, this app renders richer edge-to-edge patterns whose vertices alternate between multiple configurations.

Live demo

https://multilingualprogramming.github.io/pixel2plex/

Features

  • 20 demiregular (2-uniform) tiling patterns
  • Drag-and-drop, click-to-upload, and PNG export
  • Adjustable tile size and optional outlines
  • Geometry computed in WebAssembly compiled from French Multilingual sources
  • Static frontend with GitHub Pages deployment

Canonical mapping

See docs/demiregular-mapping.md for the current mapping notes between the project's 20 methods and the canonical 20 demiregular tilings.

Project structure

Pixel2Plex/
|-- src/
|   |-- demiregulier_wasm.multi
|   `-- main.multi
|-- scripts/
|   `-- compile_wasm.multi
|-- public/
|   |-- index.html
|   |-- style.css
|   `-- app.js
|-- tests/
|   `-- smoke.js
`-- requirements-build.txt

Building the WASM

Install the build dependencies:

pip install -r requirements-build.txt

Compile the WebAssembly bundle:

python -m multilingualprogramming scripts/compile_wasm.multi

This generates:

  • public/demiregulier.wasm
  • public/demiregulier.wat

The build script also copies the Multilingual source files into public/ for inspection alongside the generated WASM output.

Running locally

Serve the public/ directory with any static file server that sends the application/wasm MIME type for .wasm files.

python -m http.server 8080 --directory public

Then open http://localhost:8080.

Smoke tests

Run the frontend and WASM smoke suite with:

node tests/smoke.js

The test suite validates:

  • the DOM contract used by the frontend
  • the render pipeline for all 20 methods
  • the exported WASM API and method codes
  • tile buffer readability for compiled WebAssembly output

CI and deployment

The repository includes GitHub Actions for:

  • smoke tests on pushes and pull requests
  • WebAssembly build verification
  • GitHub Pages deployment from main