Materializr
Open-source parametric 3D CAD for makers — constraint sketches, solid modeling, threads, SVG & text engraving, STL/STEP export. Android, iPad, Linux, Mac, Windows. Vibe coded.
Interactive honeycomb editor for designing benzenoid (fused-ring C/H) molecules and exporting them as .xyz files.
DesignTypeScript · CSSGitHub @Drashko73OnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
Interactive honeycomb editor for designing benzenoid (fused-ring C/H) molecules and exporting .xyz files
Taken from the repository README
Loading the full README. The saved excerpt is shown below.
An interactive honeycomb editor for designing benzenoid molecules — fused hexagonal
rings of carbon with hydrogens on the perimeter (benzene, naphthalene, pyrene, coronene,
graphene flakes, …) — and exporting them as standard .xyz files with ideal
lattice geometry.
Click hexagons on a honeycomb grid; the carbon skeleton and the hydrogens appear as you
go, the formula and validation update live, and the exported file is ready for
ParaView, Avogadro, VMD, or a quantum-chemistry / machine-learning pipeline.Read the full README ↗An interactive honeycomb editor for designing benzenoid molecules — fused hexagonal
rings of carbon with hydrogens on the perimeter (benzene, naphthalene, pyrene, coronene,
graphene flakes, …) — and exporting them as standard .xyz files with ideal
lattice geometry.
Click hexagons on a honeycomb grid; the carbon skeleton and the hydrogens appear as you go, the formula and validation update live, and the exported file is ready for ParaView, Avogadro, VMD, or a quantum-chemistry / machine-learning pipeline.
It is aimed at anyone who needs polycyclic aromatic hydrocarbon geometries quickly — for a calculation, a figure, a teaching example, or as input to a machine-learning pipeline — without hand-editing coordinates.
.xyz download or copy, ring coordinates as JSON, SVG / PNG image of the
structure, and a share link that reproduces the whole state (rings are stored as row
ranges, so even a 5 000-ring flake fits in ~1 500 characters; a selection that would
need more than 8 000 characters is kept out of the URL and shared as cells JSON instead).The app is a static site. To run it locally:
npm install
npm run dev # http://localhost:5173
npm run build writes a deployable copy to dist/. The repository ships a GitHub
Actions workflow that publishes dist/ to GitHub Pages on every push to main
(enable Settings → Pages → Source: GitHub Actions once).
Benzenoids are polyhexes: sets of hexagons on a triangular lattice. The builder works in integer lattice coordinates and converts to Ångström once at the end, so there are no floating-point tolerances and no geometry optimisation.
A ring is an axial cell (q, r) with centre (√3·d·(q + r/2), 1.5·d·r) and pointy-top
orientation. Its six carbons sit on integer honeycomb sites
X = 2q + r + a_k, Y = 3r + b_k, (a_k, b_k) = (0,2) (−1,1) (−1,−1) (0,−2) (1,−1) (1,1)
at Cartesian position (√3·d·X/2, d·Y/2). A carbon with only two carbon neighbours
carries one hydrogen along its third, missing, lattice direction — the exterior angle
bisector, without any trigonometry.
| Convention | Value |
|---|---|
| d(C–C) | 1.42 Å (adjustable) — fitted to DFT-optimised geometries of 18 benzenoids from benzene to C114H30; every atom lands within 0.17 Å of the ideal lattice (RMSD ≤ 0.075 Å per molecule), so no geometry optimisation is needed |
| d(C–H) | 1.09 Å (adjustable) |
| Frame | all-atom centroid at the origin, molecule in the z = 0 plane |
| Orientation | long axis along x (default): principal axes of the carbon skeleton, heavier end (third moment) towards +x; round molecules (benzene, coronene, triphenylene, HBC) keep the lattice orientation. As drawn: only centred |
| Atom order | carbons first, sorted by lattice site (X, then Y); then hydrogens in the order of their parent carbons |
.xyz file 12
6 -1.229756 0.710000 0.000000
6 -1.229756 -0.710000 0.000000
...
1 -2.173735 1.255000 0.000000
Line 1 is the atom count, line 2 the comment (blank by default), then one atom per line
as atomic number and x, y, z in Å in fixed-width columns (%6d%22.6f%12.6f%12.6f).
Readers split on whitespace, so the widths are cosmetic. Atomic numbers are the default
because many computational pipelines expect them; viewers that only accept element
symbols (C, H) are served by the Write element symbols switch under Parameters.
Internally a molecule is just a list of rings in axial coordinates. Copy cells JSON gives you that list,
{"cells": [[0,0],[1,0],[1,1]]}
which is handy for scripts and for describing a molecule in a few bytes; Import cells
accepts the same text (or a bare [[q,r],…] list, or q,r q,r …). Share links use the
same coordinates in a compact row-range form.
| Keys | Action |
|---|---|
Ctrl+Z / Ctrl+Shift+Z (or Ctrl+Y) | undo / redo |
Ctrl+S | download the .xyz file |
F / 0 | fit the view to the molecule / reset the view |
G H L R | toggle grid, hydrogens, atom numbers, ring numbers |
Space + drag | pan |
| Touch | tap = add/remove, drag = move, pinch = zoom; the on-canvas Paint switch makes drags paint rings instead |
Shift + drag | erase rings |
? | help |
src/core/ chemistry engine, no DOM: lattice geometry, orientation, validation,
presets and families, .xyz writer, share-link codec
src/ui/ React application: honeycomb canvas, sidebar panels, export preview
tests/ Vitest suites; tests/fixtures/*.xyz are reference files the core must reproduce
scripts/ gen-fixtures.py (regenerate fixtures), screenshots.mjs (README images), favicon.mjs
src/core is usable outside the app:
import { buildMolecule, hexFlake, toXyz, validateCells } from './src/core';
const cells = hexFlake(1); // coronene
console.log(validateCells(cells).ok); // true
console.log(toXyz(buildMolecule(cells))); // the .xyz text
npm run dev # Vite dev server with hot reload
npm test # Vitest (core + UI smoke tests)
npm run typecheck # tsc
npm run lint # ESLint
npm run format # Prettier
npm run build # production build in dist/
The .xyz files in tests/fixtures/ were produced by an independent Python
implementation of the same lattice construction; the TypeScript core must reproduce
them byte for byte, which pins the geometry and the file format. scripts/gen-fixtures.py
regenerates them given that implementation (MOLGEN_SRC=/path/to/its/src).
The core already carries an element registry (src/core/elements.ts: H, C, N, O, F, S,
Cl, B with atomic numbers, colours and typical bond lengths to carbon) and a per-site
terminal-atom map in BuildParams.terminal, so a perimeter hydrogen can be replaced by
another single atom without touching the writer or the renderer. The UI does not expose
this yet; wiring a picker to terminal is the intended path.
.xyz import with ring detection (recognise the hexagons in an existing file)If this tool is useful in your work, please cite it — see CITATION.cff.
MIT.