Geometry

TubeGeometry

Creates a tube that extrudes along a 3d curve.

Example

``` function CustomSinCurve(scale) { v3d.Curve.call(this); this.scale = (scale === undefined) ? 1 : scale; } CustomSinCurve.prototype = Object.create(v3d.Curve.prototype); CustomSinCurve.prototype.constructor = CustomSinCurve; CustomSinCurve.prototype.getPoint = function(t) { var tx = t * 3 - 1.5; var ty = Math.sin(2 * Math.PI * t); var tz = 0; return new v3d.Vector3(tx, ty, tz).multiplyScalar(this.scale); }; var path = new CustomSinCurve(10); var geometry = new v3d.TubeGeometry(path, 20, 2, 8, false); var material = new v3d.MeshBasicMaterial({ color: 0x00ff00 }); var mesh = new v3d.Mesh(geometry, material); scene.add(mesh); ```

Constructor

TubeGeometry(path : Curve, tubularSegments : Integer, radius : Float, radialSegments : Integer, closed : Boolean)

path — Curve - A path that inherits from the Curve base class
tubularSegments — Integer - The number of segments that make up the tube, default is 64
radius — Float - The radius of the tube, default is 1
radialSegments — Integer - The number of segments that make up the cross-section, default is 8
closed — Boolean Is the tube open or closed, default is false

Properties

# .parameters : Object

An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.

# .tangents : Array

An array of Vector3 tangents

# .normals : Array

An array of Vector3 normals

# .binormals : Array

An array of Vector3 binormals