How to use the TubeGeometry function from three

Find comprehensive JavaScript three.TubeGeometry code examples handpicked from public code repositorys.

63
64
65
66
67
68
69
70
71
72

//create tubes
var path3D = new THREE.SplineCurve3(data);
var segments = data.length < options.maxSegments ? data.length : options.maxSegments;
segments = Math.ceil(options.quality * segments);
var tube = new THREE.TubeGeometry(path3D, segments, options.width, options.radiusSegments, false);

geometry.merge(tube);
tube.dispose();
path3D = undefined;
fork icon2
star icon11
watch icon4

+ 5 other calls in file

14
15
16
17
18
19
20
21
22
    new Vector3(-prevDir[0] * blockSize / 2, -prevDir[1] * blockSize / 2, -prevDir[2] * blockSize / 2),
    new Vector3(0, 0, 0),
    new Vector3(0, 0, 0),
    new Vector3(nextDir[0] * blockSize / 2, nextDir[1] * blockSize / 2, nextDir[2] * blockSize / 2)
  )
  const bendGeom = new TubeGeometry(bendCurve, 10, 10, 8, false)
  // bend.add(blockHelper.clone())
  return bendGeom
}
fork icon21
star icon0
watch icon1

+ 3 other calls in file

25
26
27
28
29
30
31
32
33
34
    r * x3 / m
  )
}

// returns 'fiber' geometry corresponding to the point on the 2-sphere with spherical coordinates phi, eta
var tubeGeometry = new THREE.TubeGeometry(
  fiber,  // path
  64,     // segments
  0.01,   // radius
  8,      // radiusSegments
fork icon0
star icon3
watch icon4

+ 3 other calls in file

163
164
165
166
167
168
169
170
171
  return new THREE.Vector3( tx, ty, tz );

};

const path = new EllipticCurve();
const smileGeom = new THREE.TubeGeometry( path, 64, .1, 3, false);
const smileMat = basicMaterials.black;
const smile = new THREE.Mesh( smileGeom, smileMat );
head.add( smile );
fork icon0
star icon0
watch icon1

+ 3 other calls in file

54
55
56
57
58
59
60
61
62
  this.spline = new THREE.CatmullRomCurve3(this.points)
  for (var i = (1/500); i < 1; i+= (1/500)) {
    this.pointsPerTunnel.push(this.spline.getPointAt(i))
  }

  return new THREE.TubeGeometry(this.spline, segments, radius, radiusSegments, false)
}

render() {
fork icon0
star icon0
watch icon9

Other functions in three

Sorted by popularity

function icon

three.Vector3 is the most popular function in three (22341 examples)