ParametricGeometry.js 731 B

123456789101112131415161718192021222324252627282930
  1. /**
  2. * Parametric Surfaces Geometry
  3. * based on the brilliant article by @prideout https://prideout.net/blog/old/blog/index.html@p=44.html
  4. */
  5. import { Geometry } from '../core/Geometry.js';
  6. import { ParametricBufferGeometry } from './ParametricBufferGeometry.js';
  7. function ParametricGeometry( func, slices, stacks ) {
  8. Geometry.call( this );
  9. this.type = 'ParametricGeometry';
  10. this.parameters = {
  11. func: func,
  12. slices: slices,
  13. stacks: stacks
  14. };
  15. this.fromBufferGeometry( new ParametricBufferGeometry( func, slices, stacks ) );
  16. this.mergeVertices();
  17. }
  18. ParametricGeometry.prototype = Object.create( Geometry.prototype );
  19. ParametricGeometry.prototype.constructor = ParametricGeometry;
  20. export { ParametricGeometry };