mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-11-19 04:27:55 +01:00
64 lines
1.8 KiB
HTML
Executable File
64 lines
1.8 KiB
HTML
Executable File
<!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] →
|
|
|
|
<h1>[name]</h1>
|
|
|
|
<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 — [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>[property: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>
|