LatheGeometry.html 1.5 KB

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