TubeGeometry.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import { Geometry } from '../core/Geometry';
  2. import { TubeBufferGeometry } from './TubeBufferGeometry';
  3. /**
  4. * @author oosmoxiecode / https://github.com/oosmoxiecode
  5. * @author WestLangley / https://github.com/WestLangley
  6. * @author zz85 / https://github.com/zz85
  7. * @author miningold / https://github.com/miningold
  8. * @author jonobr1 / https://github.com/jonobr1
  9. *
  10. * Creates a tube which extrudes along a 3d spline.
  11. */
  12. function TubeGeometry( path, tubularSegments, radius, radialSegments, closed, taper ) {
  13. Geometry.call( this );
  14. this.type = 'TubeGeometry';
  15. this.parameters = {
  16. path: path,
  17. tubularSegments: tubularSegments,
  18. radius: radius,
  19. radialSegments: radialSegments,
  20. closed: closed
  21. };
  22. if ( taper !== undefined ) console.warn( 'THREE.TubeGeometry: taper has been removed.' );
  23. var bufferGeometry = new TubeBufferGeometry( path, tubularSegments, radius, radialSegments, closed );
  24. // expose internals
  25. this.tangents = bufferGeometry.tangents;
  26. this.normals = bufferGeometry.normals;
  27. this.binormals = bufferGeometry.binormals;
  28. // create geometry
  29. this.fromBufferGeometry( bufferGeometry );
  30. this.mergeVertices();
  31. }
  32. TubeGeometry.prototype = Object.create( Geometry.prototype );
  33. TubeGeometry.prototype.constructor = TubeGeometry;
  34. export { TubeGeometry };
粤ICP备19079148号