Browse Source

Merge pull request #5414 from TatumCreative/docs-geometry

Geometry docs
Mr.doob 11 years ago
parent
commit
8417f95dd0

+ 39 - 0
docs/api/extras/geometries/DodecahedronGeometry.html

@@ -0,0 +1,39 @@
+<!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:PolyhedronGeometry] &rarr;
+	
+		<h1>[name]</h1>
+
+		<div class="desc">A class for generating a dodecahedron geometries.</div>
+
+
+		<h2>Constructor</h2>
+
+
+		<h3>[name]([page:Float radius], [page:Integer detail])</h3>
+		<div>
+		radius — Radius of the dodecahedron. Default is 1.<br />
+		detail — Default is 0. Setting this to a value greater than 0 adds vertices making it no longer a dodecahedron.
+		</div>
+
+
+		<h2>Properties</h2>
+
+		<h3>.[page:Object parameters]</h3>
+		<div>
+		An object with all of the parameters that were used to generate the geometry.
+		</div> 
+
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 3 - 3
docs/api/extras/geometries/IcosahedronGeometry.html

@@ -25,10 +25,10 @@
 
 		<h2>Properties</h2>
 
-
+		<h3>.[page:Object parameters]</h3>
 		<div>
-		Each of the contructor parameters is accessible as a property of the same name. Any modification of these properties after instantiation does not change the geometry.
-		</div>
+		An object with all of the parameters that were used to generate the geometry.
+		</div> 
 
 
 		<h2>Source</h2>

+ 8 - 4
docs/api/extras/geometries/OctahedronGeometry.html

@@ -8,10 +8,9 @@
 	</head>
 	<body>
 		[page:PolyhedronGeometry] &rarr;
-		
 		<h1>[name]</h1>
 
-		<div class="desc">todo</div>
+		<div class="desc">A class for generating an octahedron geometry.</div>
 
 
 		<h2>Constructor</h2>
@@ -22,9 +21,14 @@
 		radius — Radius of the octahedron. Default is 1.<br />
 		detail — Default is 0.  Setting this to a value greater than zero add vertices making it no longer an octahedron.
 		</div>
+
+
+		<h2>Properties</h2>
+		
+		<h3>.[page:Object parameters]</h3>
 		<div>
-		todo
-		</div>
+		An object with all of the parameters that were used to generate the geometry.
+		</div> 
 
 		<h2>Source</h2>
 

+ 5 - 8
docs/api/extras/geometries/ParametricGeometry.html

@@ -11,20 +11,17 @@
 		
 		<h1>[name]</h1>
 
-		<div class="desc">todo</div>
+		<div class="desc">Generate geometry representing a parametric surface.</div>
 
 
 		<h2>Constructor</h2>
 
 
-		<h3>[name]([page:todo func], [page:todo slices], [page:todo stacks])</h3>
+		<h3>[name]([page:Function func], [page:Integer slices], [page:Integer stacks])</h3>
 		<div>
-		func — todo <br />
-		slices — todo <br />
-		stacks — todo
-		</div>
-		<div>
-		todo
+		func — A function that takes in a [page:Float u] and [page:Float v] value each between 0 and 1 and returns a [page:Vector3]<br />
+		slices — The count of slices to use for the parametric function <br />
+		stacks — The count of stacks to use for the parametric function
 		</div>
 
 

+ 34 - 7
docs/api/extras/geometries/PolyhedronGeometry.html

@@ -11,22 +11,49 @@
 
 		<h1>[name]</h1>
 
-		<div class="desc">todo</div>
+		<div class="desc">
+			A polyhedron is a solid in three dimensions with flat faces. This class will take an array of vertices,
+			project them onto a sphere, and then divide them up to the desired level of detail. This class is used
+			by [page:DodecahedronGeometry], [page:IcosahedronGeometry], [page:OctahedronGeometry],
+			and [page:TetrahedronGeometry] to generate their respective geometries.
+		</div>
 
+		<h2>Example</h2>
+<code>
+var verticesOfCube = [
+    -1,-1,-1,    1,-1,-1,    1, 1,-1,    -1, 1,-1,
+    -1,-1, 1,    1,-1, 1,    1, 1, 1,    -1, 1, 1,
+];
+
+var indicesOfFaces = [
+    2,1,0,    0,3,2,
+    0,4,7,    7,3,0,
+    0,1,5,    5,4,0,
+    1,2,6,    6,5,1,
+    2,3,7,    7,6,2,
+    4,5,6,    6,7,4
+];
+
+var geometry = new THREE.PolyhedronGeometry( verticesOfCube, indicesOfFaces, 6, 2 );
+</code>
 
 		<h2>Constructor</h2>
 
 
 		<h3>[name]([page:Array vertices], [page:Array faces], [page:Float radius], [page:Integer detail])</h3>
 		<div>
-		vertices — todo <br />
-		faces — todo <br />
-		radius — todo <br />
-		detail — todo
+		vertices — [page:Array] of points of the form [1,1,1, -1,-1,-1, ... ] <br />
+		faces — [page:Array] of indices that make up the faces of the form [0,1,2, 2,3,0, ... ] <br />
+		radius — [page:Float] - The radius of the final shape <br />
+		detail — [page:Integer] - How many levels to subdivide the geometry. The more detail, the smoother the shape.
 		</div>
+		
+		<h2>Properties</h2>
+		
+		<h3>.[page:Object parameters]</h3>
 		<div>
-		todo
-		</div>
+		An object with all of the parameters that were used to generate the geometry.
+		</div> 
 		
 
 		<h2>Source</h2>

+ 14 - 20
docs/api/extras/geometries/ShapeGeometry.html

@@ -11,7 +11,7 @@
 		
 		<h1>[name]</h1>
 
-		<div class="desc">todo</div>
+		<div class="desc">Creates a one-sided polygonal geometry from one or more path shapes. Similar to [page:ExtrudeGeometry]</div>
 
 		<h2>Example</h2>
 		
@@ -36,42 +36,36 @@
 
 		<h3>[name]([page:Array shapes], [page:Object options])</h3>
 		<div>
-		shapes — todo <br />
-		options — 
+		shapes — [page:Array] of shapes, or a single [page:Shape shape] <br />
+		options — Optional options [page:Object object]
 		<ul>
-		<li>curveSegments - todo</li>
-		<li>material - todo</li>
-		<li>UVGenerator - todo</li>
+		<li>curveSegments - [page:Integer] - Not used at the moment - defaults to 12</li>
+		<li>material - [page:Integer] - index of the material in a material list</li>
+		<li>UVGenerator - A UV generator, defaults to [page:ExtrudeGeometry]'s WorldUVGenerator</li>
 		</ul>
 		</div>
-		<div>
-		todo
-		</div>
-
-
-		<h2>Properties</h2>
 
 
 		<h2>Methods</h2>
 
 
 
-		<h3>.addShapeList([page:todo shapes], [page:Object options]) [page:this]</h3>
+		<h3>.addShapeList([page:Array shapes], [page:Object options]) [page:this]</h3>
 		<div>
-		shapes — todo <br />
-		options — todo
+		shapes — [page:Array] of [page:Shape shapes] <br />
+		options — See options in constructor
 		</div>
 		<div>
-		todo
+		Adds a list of shapes to the geometry.
 		</div>
 
-		<h3>.addShape([page:todo shape], [page:Object options])</h3>
+		<h3>.addShape([page:Shape shape], [page:Object options])</h3>
 		<div>
-		shape — todo <br />
-		options — todo
+		shape — [page:Shape] <br />
+		options — See options in constructor
 		</div>
 		<div>
-		todo
+		Adds a single shape to the geometry
 		</div>
 
 		<h2>Source</h2>

+ 8 - 0
docs/api/extras/geometries/TetrahedronGeometry.html

@@ -24,6 +24,14 @@
 		</div>
 
 
+		<h2>Properties</h2>
+
+		<h3>.[page:Object parameters]</h3>
+		<div>
+		An object with all of the parameters that were used to generate the geometry.
+		</div> 
+
+
 		<h2>Source</h2>
 
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]

+ 45 - 38
docs/api/extras/geometries/TubeGeometry.html

@@ -11,77 +11,84 @@
 		
 		<h1>[name]</h1>
 
-		<div class="desc">todo</div>
+		<div class="desc">Creates a tube that extrudes along a 3d curve</div>
 
+		<h2>Example</h2>
+		
+<code>
+var CustomSinCurve = THREE.Curve.create(
+    function ( scale ) { //custom curve constructor
+        this.scale = (scale === undefined) ? 1 : scale;
+    },
+    
+    function ( t ) { //getPoint: t is between 0-1
+        var tx = t * 3 - 1.5,
+            ty = Math.sin( 2 * Math.PI * t ),
+            tz = 0;
+        
+        return new THREE.Vector3(tx, ty, tz).multiplyScalar(this.scale);
+    }
+);
+
+var path = new CustomSinCurve( 10 );
+
+var geometry = new THREE.TubeGeometry(
+    path,  //path
+    20,    //segments
+    2,     //radius
+    8,     //radiusSegments
+    false  //closed
+);
+</code>
 
 		<h2>Constructor</h2>
 
 
-		<h3>[name]([page:todo path], [page:Integer segments], [page:Float radius], [page:Integer radiusSegments], [page:Boolean closed], [page:Boolean debug])</h3>
+		<h3>[name]([page:Curve path], [page:Integer segments], [page:Float radius], [page:Integer radiusSegments], [page:Boolean closed])</h3>
 		<div>
-		path — todo <br />
-		segments — todo <br />
-		radius — todo <br />
-		radiusSegments — todo <br />
-		closed — todo <br />
-		debug — todo
+		path — [page:Curve] - A path that inherits from the [page:Curve] base class<br />
+		segments — [page:Integer] - The number of segments that make up the tube, default is 64<br />
+		radius — [page:Float] - The radius of the tube, default is 1<br />
+		radiusSegments — [page:Integer] - The number of segments that make up the cross-section, default is 8 <br />
+		closed — [page:Float] Is the tube open or closed, default is false <br />
 		</div>
 
 
 		<h2>Properties</h2>
 
-		<h3>.[page:todo path]</h3>
-		<div>
-		todo
-		</div> 
-
-		<h3>.[page:Integer segments]</h3>
-		<div>
-		todo
-		</div> 
-
-		<h3>.[page:Float radius]</h3>
-		<div>
-		todo
-		</div> 
-
-		<h3>.[page:Integer radiusSegments]</h3>
-		<div>
-		todo
-		</div> 
-
-		<h3>.[page:Boolean closed]</h3>
+		<h3>.[page:Object parameters]</h3>
 		<div>
-		todo
+		An object with all of the parameters that were used to generate the geometry.
 		</div> 
 
 		<h3>.[page:Array tangents]</h3>
 		<div>
-		todo
+		An array of [page:Vector3] tangents
 		</div> 
 
 		<h3>.[page:Array normals]</h3>
 		<div>
-		todo
+		An array of [page:Vector3] normals
 		</div> 
 
 		<h3>.[page:Array binormals]</h3>
 		<div>
-		todo
+		An array of [page:Vector3] binormals
 		</div> 
 
 
 		<h2>Methods</h2>
 		
 
-		<h3>.FrenetFrames([page:todo path], [page:Integer segments], [page:Boolean closed])</h3>
+		<h3>THREE.TubeGeometry.FrenetFrames([page:Curve path], [page:Integer segments], [page:Boolean closed])</h3>
 		<div>
-		path — todo <br />
-		segments — todo <br />
-		closed — todo
+		path — A path that inherits from the [page:Curve] base class <br />
+		segments — The number of segments that make up the tube <br />
+		closed — Is the tube open or closed
 		</div>
 		<div>
-		todo
+		A static method that generates the Frenet Frames. This is internally run on any new TubeGeometry and then the
+		generated tangents, normals, and binormals are exposed as properties on the TubeGeometry object.
 		</div>
 		
 		<h2>Source</h2>

+ 1 - 0
docs/list.js

@@ -184,6 +184,7 @@ var list = {
 			[ "CircleGeometry", "api/extras/geometries/CircleGeometry" ],
 			[ "CubeGeometry", "api/extras/geometries/CubeGeometry" ],
 			[ "CylinderGeometry", "api/extras/geometries/CylinderGeometry" ],
+			[ "DodecahedronGeometry", "api/extras/geometries/DodecahedronGeometry" ],
 			[ "ExtrudeGeometry", "api/extras/geometries/ExtrudeGeometry" ],
 			[ "IcosahedronGeometry", "api/extras/geometries/IcosahedronGeometry" ],
 			[ "LatheGeometry", "api/extras/geometries/LatheGeometry" ],