RatioLab in a browser
The browser app uses RatioLab's unchanged Python generation, motion, analysis and export modules through Pyodide in a Web Worker. It provides the desktop workspace and fifteen model families with browser downloads and local project recovery. CAD connection bridges and the desktop MCP companion are excluded. Calculations happen in the browser; there is no calculation backend.
Open the web app without installing the desktop program. The native installers linked in the main README remain separate downloads for desktop use and CAD integrations. Verification covers the tested flows; it does not establish compatibility with every browser, operating system or graphics driver.
Build and open locally
Use Python 3.10 or newer for these stdlib-only commands, from the checkout or
an extracted source.zip. No Node, npm, GTK or native CAD libraries are needed.
Only the first command accesses the network, fetching six exact pinned files:
python3 scripts/fetch-web-runtime.py
python3 scripts/fetch-web-runtime.py --check-only
python3 scripts/build-webapp.py --runtime-dir work/webapp-runtime
python3 scripts/serve-webapp.py
Open the local preview. Ctrl+C stops it. Change the
loopback port with --port 8767; change its bundle with --directory PATH.
The default output is work/webapp-dist; the default runtime cache is
work/webapp-runtime. Both stay outside source distributions. An existing cache
can be selected explicitly with fetch-web-runtime.py --directory PATH and
build-webapp.py --runtime-dir PATH. --check-only never fetches or writes.
The fetcher downloads the five runtime files from the pinned jsDelivr CDN and
Pyodide's LICENSE from the official GitHub 314.0.7 tag. Each file has one
fixed URL; redirects are rejected. It checks exact sizes and SHA256 against
webapp/runtime.json; valid files are reused. Edited or foreign target files
and symlinks are preserved by failing instead of replacing them. Remove or move an unwanted file yourself
before retrying. Unrelated cache metadata is retained.
The build and preview commands never fetch dependencies. The builder has an
explicit source/asset list, deterministic ZIP contents and a checksum manifest.
It refuses to replace a foreign output directory or a bundle with extra/edited
files. Choose another --output PATH to retain a modified bundle. Native wheels
remain native application packages; source distributions include the web source,
recipe and tests, but no downloaded runtime binaries.
Parameter illustrations are checked-in static assets generated from the original
RatioLab schematics. The optional development command
PYTHONPATH=src:webapp python3 scripts/generate-web-help.py regenerates them
with pycairo; --check compares output and recorded source provenance. Ordinary
web builds and browser use do not require Cairo or GTK.
For a portable copy, retain the entire built folder. It includes README.txt,
serve.py, licenses, notices and readable corresponding source in source.zip.
After unpacking a complete portable ZIP, run python3 serve.py inside its folder
(or python serve.py if that is your interpreter's name). The preview helper
verifies every manifest file and rejects symlinks in listed paths before opening
its loopback HTTP server. It serves listed files only, with no directory listing.
A browser needs WebAssembly, Web Workers, WebGL and a secure context: HTTPS or
localhost. Opening index.html through file:// fails. Python on your computer
is required only for building or the local HTTP preview, not by a user visiting
an already hosted static app.
Use the workspace
Motion keeps Input, Output and Fixed to frame roles distinct. Multi-member selectors use the full sidebar width, and each planetary stage remains independent. Wolfrom's fixed-member speeds remain available in Motion details.
Choose a family/construction, edit Dimensions, Motion and Assembly, and inspect the live model. Precise numeric fields accept decimal points or commas; incomplete entries remain visible and block exports until valid. Orbit, zoom, Fit, animation, exploded/section views and component selection are available. Right mouse drag pans; left drag orbits. The upper-right orientation cube supports face, edge and corner snaps and dragging. Its Home, Fit, Pan and Display controls replace the old View panel, retaining all display options in the sliders menu.
View and Tools share a translucent panel over the right of the model, with no reduction in preview width. The results band sits above the motion controls, with the progressive RPM slider, playback speed and preview phase available directly. Scrubbing phase pauses the preview without editing the project. Hover over parameters or Model & dimensions for adjacent help; the information button and F1 also open it. The pointer can enter the guide, and leaving both the guide and parameter dismisses it. Original schematics can be expanded for readability. CAD connections and native updates remain desktop features.
While dragging the RPM slider, the number previews your choice and the model keeps its applied speed. Releasing the pointer or adjustment key applies the final RPM once, as one Undo step. Save/Export confirms a pending slider choice.
Save/Open use desktop-compatible JSON; Save As and exports prepare browser downloads instead of native destination dialogs. Full and selected components can be exported as STEP/STL/SVG/DXF; complete packages include the preview PNG, reports and a checksum inventory. Keep downloaded JSON files: recent projects and unsaved draft recovery are local to this browser/origin, and private browsing or cleared site data can remove them. Undo/Redo preserve document edits.
Theme is an on/off switch: on selects light, off selects dark. Language changes the interface labels using the same nine languages as the documentation. Both are saved for this browser and site, independently of projects, history and numeric precision. Untranslated technical explanations and reports remain in English.
Tools include component surface measurements, theoretical gear metrology, finite combination search, discrete interference and working-backlash proposals. Search results require explicit Apply; a changed source invalidates old results. Cancel terminates the busy worker, restarts the engine and regenerates the latest current parameters. Retry restarts a failed load after missing/blocked bundle files have been corrected.
Geometry, ideal motion, construction warnings and analysis limits remain those of the canonical engine. Measurements use sampled surfaces; interference uses discrete poses and reports incomplete coverage. Finite search ranks only the specified domain. Working-backlash Apply follows solver eligibility, and an incomplete proposal remains ineligible. None establishes continuous clearance, strength, bearing life or manufacturing readiness. Read the generated reports, model warnings and technical references before using exports.
Static HTTPS hosting
The public website build composes the complete self-hosted app at _site/app/.
Run bash website/build.sh from the source checkout to build both the website
and app, using verified public desktop-release data and the pinned runtime.
For a prepared offline environment, use --offline --web-runtime-dir PATH.
See the website build guide
for the existing Cloudflare Pages configuration and checks. Building does not
itself publish a deployment.
Copy the complete self-hosted output folder to a static HTTPS host, preserving
relative paths. No Python, API endpoint or server computation is required there.
Serve .mjs/.js as text/javascript and .wasm as application/wasm.
Missing assets must return an error, rather than an HTML application fallback.
Retain licenses, notices and source.zip with the app. This recipe does not
publish or configure any host.
The self-hosted runtime performs no external fetches during operation. It does
need the locally served runtime files on load; this app has no service worker
or guaranteed offline reload. Optional help/source links open external sites.
The explicit developer option --external-runtime instead references the pinned
CDN and requires external access; it is not the portable self-hosted recipe.
Runtime and source notices
The pinned runtime is Pyodide 314.0.7 with CPython 3.14.2. The upstream
Pyodide LICENSE is explicitly stored as runtime/PYODIDE-LICENSE (MPL 2.0).
webapp/notices/ preserves CPython's LICENSE and Doc/license.rst and Emscripten
5.0.3's LICENSE and bundled musl COPYRIGHT. Its provenance.json records exact
URLs, sizes and hashes. These copies identify the pinned runtime and its listed
notices; they are not an exhaustive audit of the WebAssembly binary.
RatioLab is GPL-3.0-only; the bundle includes readable application
source, all browser build/fetch/serve scripts and this recipe in source.zip.
The runtime is supplied unmodified. Its corresponding upstream sources are
Pyodide 314.0.7,
CPython 3.14.2 and
Emscripten 5.0.3.
See Pyodide's license,
CPython's license and
the bundled notices/README.txt for the preserved texts and provenance.
Screen size and internal scrolling
On computers and tablets (viewports wider than 600 CSS pixels), the workspace fits the browser height. Long parameter lists and tool panels scroll internally; short windows and enlarged text can also require scrolling inside the model pane to reach every motion control. On phones, the page keeps its natural vertical flow and can scroll normally. All preview and motion controls remain available.
Model contains the family and variant selectors at the top of the parameter pane. A horizontal Dimensions, Motion, Assembly bar below those selectors chooses the parameter section. Changing section retains the current design and parameter drafts.
Theme is a direct on/off switch; Language is a separate compact menu in the toolbar. Their choices apply immediately; storage failures keep the session choice and show a notice. Neither menu changes the generated geometry or project recovery.