1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8" />
- <base href="../../../" />
- <script src="page.js"></script>
- <link type="text/css" rel="stylesheet" href="page.css" />
- </head>
- <body>
- [page:BufferGeometry] →
- <h1>[name]</h1>
- <p class="desc">Creates meshes with axial symmetry like vases. The lathe rotates around the Y axis.</p>
- <iframe id="scene" src="scenes/geometry-browser.html#LatheGeometry"></iframe>
- <script>
- // iOS iframe auto-resize workaround
- if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
- const scene = document.getElementById( 'scene' );
- scene.style.width = getComputedStyle( scene ).width;
- scene.style.height = getComputedStyle( scene ).height;
- scene.setAttribute( 'scrolling', 'no' );
- }
- </script>
- <h2>Code Example</h2>
- <code>
- const points = [];
- for ( let i = 0; i < 10; i ++ ) {
- points.push( new THREE.Vector2( Math.sin( i * 0.2 ) * 10 + 5, ( i - 5 ) * 2 ) );
- }
- const geometry = new THREE.LatheGeometry( points );
- const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
- const lathe = new THREE.Mesh( geometry, material );
- scene.add( lathe );
- </code>
- <h2>Constructor</h2>
- <h3>[name]([param:Array points], [param:Integer segments], [param:Float phiStart], [param:Float phiLength])</h3>
- <p>
- points — Array of Vector2s. The x-coordinate of each point must be greater than zero.<br />
- segments — the number of circumference segments to generate. Default is 12.<br />
- phiStart — the starting angle in radians. Default is 0.<br />
- phiLength — the radian (0 to 2PI) range of the lathed section 2PI is a closed lathe, less than 2PI is a portion. Default is 2PI.
- </p>
- <p>
- This creates a [name] based on the parameters.
- </p>
- <h2>Properties</h2>
- <p>See the base [page:BufferGeometry] class for common properties.</p>
- <h3>[property:Object parameters]</h3>
- <p>
- An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
- </p>
- <h2>Methods</h2>
- <p>See the base [page:BufferGeometry] class for common methods.</p>
- <h2>Source</h2>
- <p>
- [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
- </p>
- </body>
- </html>
|