Skip to content

About

Explore a BMW six-cylinder engine in 3D in your browser: spin it, pull it apart and click any part to learn what it does.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

BMW Engine Explorer (N53B30)

A 3D model of a BMW six-cylinder petrol engine that you can spin round and pull apart in your web browser. Click any part to find out what it is, what it does and what tends to go wrong with it.

The 3D engine pulled apart, with one piston highlighted in yellow and a panel on the right explaining what a piston does

What is it?

A learning tool for anyone curious about how a car engine is put together. No car or engineering knowledge needed.

It models the BMW N53B30, a 3.0-litre straight-six petrol engine (six cylinders in a row) used in several BMW models from the late 2000s. You can turn the engine round, zoom in, slide it apart into its main sections, and show one system at a time, such as the fuel system.

The shapes are simple stand-ins for now: boxes and cylinders, roughly the right size and in the right place, but not exact copies of the real parts. Every part says how accurate it is.

Try it

In your browser, nothing to install: islamtahsinul.github.io/Engine-project

How to use it:

  • Drag to turn the engine round. Scroll to zoom. Right-drag to move it sideways.
  • Click a part to read about it in the panel on the right.
  • Exploded view slider (bottom left) pulls the engine apart.
  • Isolate assembly shows one system on its own and fades out the rest.

Run it on your own computer:

  1. Install Node.js (the "LTS" version).
  2. On this page, click the green Code button, then Download ZIP, and unzip it.
  3. Open a terminal in the unzipped folder. On Windows: open the folder, right-click an empty space and choose Open in Terminal.
  4. Type npm install and press Enter. This downloads what the app needs; you only do it once.
  5. Type npm run dev and press Enter, then open the address it shows (usually http://localhost:5173).

What it looks like

Sliding the engine apart and back together:

Animation: the engine separates into its cylinder head, pistons and block, then goes back together

Showing only the fuel system, with the high-pressure fuel pump selected:

The fuel rail, injectors and pump shown on their own, with the rest of the engine faded out

How accurate is it?

This is an early prototype, not an exact digital copy of the engine. Each part shows a coloured badge saying how it was made. Today every part is a placeholder: a simple shape at roughly the right size and position. The plan is to replace placeholders one at a time with measured, more realistic parts, and to update each badge when that happens. Never read a part as more accurate than its badge says.


Technical details

An interactive 3D learning tool built with React and Three.js. The long-term goal is a dimensionally accurate digital twin, built up component by component with tracked provenance, rather than a one-shot 3D model.

Current engine: BMW N53B30 (confirmed)

3.0 L naturally aspirated inline-6 with direct injection ("High Precision Injection"), double VANOS and no Valvetronic (removed versus the related N52 because of the space taken by the direct-injection hardware in the head). An earlier version of this project wrongly assumed an N52B25; the component data in src/data/engines/n53b30.ts carries the corrected specs and the references used for each part.

Accuracy tracking

Every component in src/data/engines/n53b30.ts carries a modelStatus and modelSource, shown in the app's info panel as a status badge and a "Model provenance" section. Today every component is placeholder: primitive boxes and cylinders, proportionally reasonable but not measured or CAD-derived. The schema (src/types/engine.ts) supports the full status ladder (placeholder → reference_model → visually_reconstructed → dimensionally_reconstructed → verified_multi_reference → exact_cad_scan), BMW part numbers, dimensions, mass, material, tier priority and a parent/child hierarchy, ready to be filled in as real geometry replaces placeholders one component at a time.

Tech stack

  • Vite + React + TypeScript
  • Three.js via @react-three/fiber and @react-three/drei (orbit camera controls, view gizmo)
  • Zustand for selection / isolation / exploded-view state
  • All current geometry is generated procedurally from the data-driven component schema; there are no external 3D model files yet

Development

npm install
npm run dev      # local dev server, usually http://localhost:5173
npm run build    # production build into dist/

Type-check with npx tsc --noEmit -p tsconfig.app.json. The bare tsc --noEmit at the repo root checks zero files, because the root tsconfig.json only holds project references, so always point at tsconfig.app.json directly.

The build uses relative asset paths (base: './' in vite.config.ts), so dist/ works from any sub-folder. Every push to main builds and publishes the site to GitHub Pages through .github/workflows/deploy-pages.yml.

Architecture

  • src/types/engine.ts: the shared schema, including the provenance/parts-catalogue metadata (modelStatus, modelSource, partNumber, dimensions, tier, parentId/childIds, removalOrder/installationOrder, etc.)
  • src/data/engines/n53b30.ts: the N53B30 component data and educational text
  • src/data/modelStatusMeta.ts: display labels/colours for the model-status badge
  • src/geometry/kinematics.ts: engine-agnostic slider-crank maths (takes bore/stroke/rod length as config, so any future engine's data file supplies its own)
  • src/state/engineStore.ts: Zustand store for the selected component, isolated assembly and exploded-view level
  • src/components/EngineScene.tsx, ComponentMesh.tsx: the R3F canvas and generic per-component renderer (selection highlight / isolation fade / exploded-view offset). Interaction architecture and engine data are deliberately decoupled.
  • src/components/Toolbar.tsx, InfoPanel.tsx: the UI overlay, including the model-status badge and provenance panel

Because the scene, info panel and future quiz/lesson content all read from the same EngineDef, replacing a placeholder with real geometry means updating that one component's entry (shape + modelStatus + modelSource), not touching the interaction layer.

Assembly hierarchy

Matches a parts-catalogue structure rather than a flat list:

N53B30
├── Short Block        (engine block, crankshaft, main bearings, 6 pistons, 6 rods)
├── Cylinder Head       (head casting, camshafts, valves, springs, valve cover)
├── Timing System        (chain/sprockets/tensioner — currently one bundled placeholder)
├── Fuel Injection System (direct injectors, HPFP, fuel rail — new vs. the old N52-based prototype)
├── Air Intake System     (manifold, throttle body — now correctly the primary airflow control, since there's no Valvetronic)
├── Exhaust System
├── Lubrication System    (catalogued, not yet modelled)
├── Cooling System        (catalogued, not yet modelled)
└── Electrical / Ignition (catalogued, not yet modelled)

Known limitations / not yet built

  • All geometry is placeholder status; the in-app provenance panel for each component says exactly what's approximate about it
  • No BMW CAD or scan data has been sourced yet
  • The timing system is one bundled placeholder standing in for the chain, both sprockets, guides and tensioner (these should become separate Tier-1 components)
  • Lubrication, cooling and electrical/ignition systems are catalogued in the assembly hierarchy but have no components yet
  • No animation, multi-level explosion, cutaway mode, disassembly sequencing UI, guided lessons, assembly mode or quiz mode yet. The data schema (removalOrder/installationOrder/childIds) is structured to support a future teardown sequence, but no UI uses it yet

Licence

MIT. BMW, N53 and VANOS are trademarks of BMW AG; this is an independent educational project with no connection to BMW.

About

Explore a BMW six-cylinder engine in 3D in your browser: spin it, pull it apart and click any part to learn what it does.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages