Doodle3D-Slicer/three.js-master/docs/api/extras/geometries/LatheGeometry.html

51 lines
1.5 KiB
HTML
Raw Normal View History

2015-06-12 15:58:26 +02:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<script src="../../../list.js"></script>
<script src="../../../page.js"></script>
<link type="text/css" rel="stylesheet" href="../../../page.css" />
</head>
<body>
[page:Geometry] &rarr;
<h1>[name]</h1>
<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>
<h2>Example</h2>
<code>
var points = [];
for ( var i = 0; i < 10; i ++ ) {
points.push( new THREE.Vector3( Math.sin( i * 0.2 ) * 15 + 50, 0, ( i - 5 ) * 2 ) );
}
var geometry = new THREE.LatheGeometry( points );
var material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
var lathe = new THREE.Mesh( geometry, material );
scene.add( lathe );
</code>
<h2>Constructor</h2>
<h3>[name]([page:Array points], [page:Integer segments], [page:Float phiStart], [page:Float phiLength])</h3>
<div>
points — Array of Vector3s. Since this rotates around Z axis, the y-values can be set to 0<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 2*PI) range of the lathed section 2*PI is a closed lathe, less than 2PI is a portion. Default is 2*PI
</div>
<div>
This creates a LatheGeometry based on the parameters.
</div>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
</html>