Cutaway 4-stroke engine
slice + parameter sweep
Single-cylinder 4-stroke cutaway with cross-sections and a 36-frame crank-angle sweep.
What it is
A single-cylinder 4-stroke engine, cut away on the +X face to expose piston, conrod, crankshaft, valves, ports, and spark plug — all sized from real bore/stroke/conrod-length parameters and positioned by slider-crank kinematics at a tunable crankAngle. Each part is colored distinctively: copper-orange piston, gray block + head + crankshaft, blue intake valve, red exhaust valve, yellow spark plug, translucent intake/exhaust ports.
Why visual feedback matters
The cutaway face shows every internal feature at once. Because crankAngle is a parameter, sweeping it 0° → 360° produces an animated crank rotation — the centerpiece GIF below. Per-part coloring also makes the assembly self-explanatory without labels: you can tell what each piece does at a glance.
Screenshots
36-frame crank-angle sweep — piston travels TDC → BDC → TDC as the crank rotates.
Iteration GIF: this engine shipped to main four times before all the bugs were out. See the essay below for the full story.
Parameters
Parameters 7
| Name | Default | Description |
|---|---|---|
bore | — mm | Cylinder bore diameter. |
stroke | — mm | Piston stroke length. |
conrodLength | — mm | Connecting-rod center-to-center length. |
compressionRatio | 10 | Drives combustion-chamber dome size. |
crankAngle | 30 ° | Piston + conrod position. Sweep this to animate. |
intakeValveOpen | — | Intake valve lift fraction (0..1). |
exhaustValveOpen | — | Exhaust valve lift fraction (0..1). |
Related essay
Try it
- Open in your browser → openjscad.xyz, bundled single-file
- Source on GitHub →
- Full walkthrough on GitHub →