[page:Geometry] →

[name]

Creates a tube that extrudes along a 3d curve

Example

var CustomSinCurve = THREE.Curve.create( function ( scale ) { //custom curve constructor this.scale = (scale === undefined) ? 1 : scale; }, function ( t ) { //getPoint: t is between 0-1 var tx = t * 3 - 1.5, ty = Math.sin( 2 * Math.PI * t ), tz = 0; return new THREE.Vector3(tx, ty, tz).multiplyScalar(this.scale); } ); var path = new CustomSinCurve( 10 ); var geometry = new THREE.TubeGeometry( path, //path 20, //segments 2, //radius 8, //radiusSegments false //closed );

Constructor

[name]([page:Curve path], [page:Integer segments], [page:Float radius], [page:Integer radiusSegments], [page:Boolean closed])

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

Properties

[property:Object parameters]

An object with all of the parameters that were used to generate the geometry.

[property:Array tangents]

An array of [page:Vector3] tangents

[property:Array normals]

An array of [page:Vector3] normals

[property:Array binormals]

An array of [page:Vector3] binormals

Methods

THREE.TubeGeometry.FrenetFrames([page:Curve path], [page:Integer segments], [page:Boolean closed])

path — A path that inherits from the [page:Curve] base class
segments — The number of segments that make up the tube
closed — Is the tube open or closed
A static method that generates the Frenet Frames. This is internally run on any new TubeGeometry and then the generated tangents, normals, and binormals are exposed as properties on the TubeGeometry object.

Source

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]