LatheGeometry.html 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <script src="../../../list.js"></script>
  6. <script src="../../../page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="../../../page.css" />
  8. </head>
  9. <body>
  10. [page:Geometry] &rarr;
  11. <h1>[name]</h1>
  12. <div class="desc">Class for generating meshes with axial symmetry. Possible uses include donuts, pipes, vases etc. The lathe rotate around the Z axis.</div>
  13. <h2>Example</h2>
  14. <code>
  15. var points = [];
  16. for ( var i = 0; i < 10; i ++ ) {
  17. points.push( new THREE.Vector3( Math.sin( i * 0.2 ) * 15 + 50, 0, ( i - 5 ) * 2 ) );
  18. }
  19. var geometry = new THREE.LatheGeometry( points );
  20. var material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
  21. var lathe = new THREE.Mesh( geometry, material );
  22. scene.add( lathe );
  23. </code>
  24. <h2>Constructor</h2>
  25. <h3>[name]([page:Array points], [page:Integer segments], [page:Float phiStart], [page:Float phiLength])</h3>
  26. <div>
  27. points — Array of Vector3s. Since this rotates around Z axis, the y-values can be set to 0<br />
  28. segments — the number of circumference segments to generate. Default is 12.<br />
  29. phiStart — the starting angle in radians. Default is 0.<br />
  30. phiLength — the radian (0 to 2*PI) range of the lathed section 2*PI is a closed lathe, less than 2PI is a portion. Default is 2*PI
  31. </div>
  32. <div>
  33. This creates a LatheGeometry based on the parameters.
  34. </div>
  35. <h2>Source</h2>
  36. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  37. </body>
  38. </html>