Skip to content

andrewisen-tikab/three-tunnel

Repository files navigation

three-tunnel

three-tunnel is a tunnel & grouting library for three.js. It's also a part of Tunnel Sketcher is a free tool for visualizing geological structures and grouting in tunnels. Use parts of this library to create your own tunnel visualization tool.

Installation

npm install three-tunnel

Usage

Begin by adding a tunnel.

import { Tunnel3D } from 'three-tunnel';

const tunnel = new Tunnel3D();
scene.add(tunnel);

To help you design the tunnel, you can add a controller.

import { TunnelControls } from 'three-tunnel';
const tunnelControls = new TunnelControls();
tunnelControls.attach(this._tunnel);

You can now add grouts to the tunnel.

const grout1 = this.tunnelControls.addGrout();
const grout2 = this.tunnelControls.addGrout();
this.tunnelControls.update();

Example

A complete example can be found in the example folder. Or, you can run the demo at:

https://andrewisen-tikab.github.io/three-tunnel/example/

Docs

Auto-generated docs can be found here: https://andrewisen-tikab.github.io/three-tunnel/docs/

Status

This is a work in progress. It's not production ready.