ParametricGeometry.html 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. [page:BufferGeometry] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. Generate geometry representing a parametric surface.
  14. </p>
  15. <h2>Import</h2>
  16. <p>
  17. [name] is an add-on, and must be imported explicitly.
  18. See [link:#manual/introduction/Installation Installation / Addons].
  19. </p>
  20. <code>
  21. import { ParametricGeometry } from 'three/addons/geometries/ParametricGeometry.js';
  22. </code>
  23. <h2>Code Example</h2>
  24. <code>
  25. const geometry = new THREE.ParametricGeometry( THREE.ParametricGeometries.klein, 25, 25 );
  26. const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
  27. const klein = new THREE.Mesh( geometry, material );
  28. scene.add( klein );
  29. </code>
  30. <h2>Constructor</h2>
  31. <h3>[name]([param:Function func], [param:Integer slices], [param:Integer stacks])</h3>
  32. <p>
  33. func — A function that takes in a [page:Float u] and [page:Float v] value each between 0 and 1 and modifies a third [page:Vector3] argument. Default is a function that generates a curved plane surface.<br />
  34. slices — The count of slices to use for the parametric function. Default is *8*.<br />
  35. stacks — The count of stacks to use for the parametric function. Default is *8*.
  36. </p>
  37. <h2>Properties</h2>
  38. <p>See the base [page:BufferGeometry] class for common properties.</p>
  39. <h3>[property:Object parameters]</h3>
  40. <p>
  41. An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
  42. </p>
  43. <h2>Methods</h2>
  44. <p>See the base [page:BufferGeometry] class for common methods.</p>
  45. <h2>Source</h2>
  46. <p>
  47. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/geometries/ParametricGeometry.js examples/jsm/geometries/ParametricGeometry.js]
  48. </p>
  49. </body>
  50. </html>