mankyd/pipefitter

A Parametric 3D Pipe Adapter Design Tool

JavaScript

0

57 commits

updated Sep 24, 2026

See the code

See what people are saying

README

Pipe Fitter

A single-page web app for designing 3D-printable pipe adapters and exporting them as STL or 3MF. You describe a pipe as a chain of straight sections joined by optional bends, set each end's treatment, and the app builds a live, watertight 3D model plus an annotated 2D cross-section - all in the browser, with no accounts and no build step.

It's meant for makers who need a transition between two tubes (a hose to a pipe, one diameter to another, a bent run between fixed ports) and want a printable part in a minute rather than a full CAD session.

View It Live

What it can do

  • Any number of sections - from a single straight run to multiple bends - each with its own inner diameter, wall thickness, and length, joined by bends of up to 180 degrees.
  • End treatments on each pipe's two open ends: plain, chamfer, flange (with bolt holes), hose barb, teeth, and a slip joint for sliding two pipes together.
  • Up to four separate pipes connected end to end by their end treatments. Each joint keeps its two mating ends in agreement - diameters, and flange's bolt pattern.
  • Live 3D preview (orbit / pan / zoom, multiple render styles) and a live 2D cross-section with dimensions.
  • Export to binary STL or 3MF, optionally oriented to sit flat on an end face. A multi-pipe design exports as a ZIP of one STL per part, or a single multi-object 3MF.
  • Everything lives in the URL - the complete parameters, display units (mm/in), render style, camera pose, and panel state - so the URL reproduces exactly what you see.

For instructions use each control, open the in-app help (the ? button); or read HELP.md.

Running it

There is no build step and nothing to install - it's plain HTML, CSS, and JS. It's only dependencies are three.js and a few fonts, all of which is bundled. You need to serve the folder over HTTP, because ES-module imports don't work from file://.

git clone https://github.com/mankyd/pipefitter.git && cd pipefitter

then

    python -m http.server 8000

or

    npx http-server -p 8000

or your server of choice.

Finally, open http://localhost:8000.

Files

These must all be served together, with their relative paths preserved:

PathPurpose
index.htmlEntry point; wires up the layout and loads app.js as a module.
app.jsApplication: UI, panel, camera, exports, URL state.
pipe-geometry.jsAll CAD math + the binary STL / 3MF writers. Dependency-free ES module.
pipe-diagram.jsThe 2D cross-section schematic (Canvas 2D).
app.cssApplication styles.
dark.cssDesign-system stylesheet (tokens + components).
HELP.mdIn-app help text, fetched at runtime for the ? dialog.
vendor/three.module.jsthree.js r160 (MIT), the only third-party runtime dependency.
fonts/fonts.css@font-face rules.
fonts/*.woff2Inter and JetBrains Mono (latin / latin-ext subsets).
assets/buymeacoffee.pngSupport-link logo.

How it works (briefly)

  • pipe-geometry.js sweeps a per-station inner/outer profile along a planar centerline and triangulates a closed mesh; build(params, segments) returns positions, indices, a bounding box, a 2D silhouette, and clamp notes. It's pure, with no DOM or three.js dependency.
  • app.js memoizes the geometry on the parameter signature, renders it with three.js, draws the schematic via pipe-diagram.js, and mirrors the whole state into the URL hash. Every input is clamped, never rejected, so the model is always valid and exportable.

License

MIT - see LICENSE.md. Third-party components retain their own licenses; see CREDITS.md.

Contributors

mankyd

57 commits

mankyd/pipefitter

A Parametric 3D Pipe Adapter Design Tool

JavaScript

0

57 commits

updated Sep 24, 2026

See the code

See what people are saying

README

Pipe Fitter

A single-page web app for designing 3D-printable pipe adapters and exporting them as STL or 3MF. You describe a pipe as a chain of straight sections joined by optional bends, set each end's treatment, and the app builds a live, watertight 3D model plus an annotated 2D cross-section - all in the browser, with no accounts and no build step.

It's meant for makers who need a transition between two tubes (a hose to a pipe, one diameter to another, a bent run between fixed ports) and want a printable part in a minute rather than a full CAD session.

View It Live

What it can do

  • Any number of sections - from a single straight run to multiple bends - each with its own inner diameter, wall thickness, and length, joined by bends of up to 180 degrees.
  • End treatments on each pipe's two open ends: plain, chamfer, flange (with bolt holes), hose barb, teeth, and a slip joint for sliding two pipes together.
  • Up to four separate pipes connected end to end by their end treatments. Each joint keeps its two mating ends in agreement - diameters, and flange's bolt pattern.
  • Live 3D preview (orbit / pan / zoom, multiple render styles) and a live 2D cross-section with dimensions.
  • Export to binary STL or 3MF, optionally oriented to sit flat on an end face. A multi-pipe design exports as a ZIP of one STL per part, or a single multi-object 3MF.
  • Everything lives in the URL - the complete parameters, display units (mm/in), render style, camera pose, and panel state - so the URL reproduces exactly what you see.

For instructions use each control, open the in-app help (the ? button); or read HELP.md.

Running it

There is no build step and nothing to install - it's plain HTML, CSS, and JS. It's only dependencies are three.js and a few fonts, all of which is bundled. You need to serve the folder over HTTP, because ES-module imports don't work from file://.

git clone https://github.com/mankyd/pipefitter.git && cd pipefitter

then

    python -m http.server 8000

or

    npx http-server -p 8000

or your server of choice.

Finally, open http://localhost:8000.

Files

These must all be served together, with their relative paths preserved:

PathPurpose
index.htmlEntry point; wires up the layout and loads app.js as a module.
app.jsApplication: UI, panel, camera, exports, URL state.
pipe-geometry.jsAll CAD math + the binary STL / 3MF writers. Dependency-free ES module.
pipe-diagram.jsThe 2D cross-section schematic (Canvas 2D).
app.cssApplication styles.
dark.cssDesign-system stylesheet (tokens + components).
HELP.mdIn-app help text, fetched at runtime for the ? dialog.
vendor/three.module.jsthree.js r160 (MIT), the only third-party runtime dependency.
fonts/fonts.css@font-face rules.
fonts/*.woff2Inter and JetBrains Mono (latin / latin-ext subsets).
assets/buymeacoffee.pngSupport-link logo.

How it works (briefly)

  • pipe-geometry.js sweeps a per-station inner/outer profile along a planar centerline and triangulates a closed mesh; build(params, segments) returns positions, indices, a bounding box, a 2D silhouette, and clamp notes. It's pure, with no DOM or three.js dependency.
  • app.js memoizes the geometry on the parameter signature, renders it with three.js, draws the schematic via pipe-diagram.js, and mirrors the whole state into the URL hash. Every input is clamped, never rejected, so the model is always valid and exportable.

License

MIT - see LICENSE.md. Third-party components retain their own licenses; see CREDITS.md.

Contributors

mankyd

57 commits

Languages

JavaScript

86.9%

CSS

10.8%

HTML

2.2%