123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8" />
- <base href="../../" />
- <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">Creates a one-sided polygonal geometry from one or more path shapes. Similar to [page:ExtrudeGeometry].</div>
- <iframe id="scene" src="scenes/geometry-browser.html#ShapeGeometry"></iframe>
- <script>
- // iOS iframe auto-resize workaround
- if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
- var scene = document.getElementById( 'scene' );
- scene.style.width = getComputedStyle( scene ).width;
- scene.style.height = getComputedStyle( scene ).height;
- scene.setAttribute( 'scrolling', 'no' );
- }
- </script>
- <h2>Example</h2>
- <code>
- var length = 16, width = 12;
- var shape = new THREE.Shape();
- shape.moveTo( 0,0 );
- shape.lineTo( 0, width );
- shape.lineTo( length, width );
- shape.lineTo( length, 0 );
- shape.lineTo( 0, 0 );
- var geometry = new THREE.ShapeGeometry( shape );
- var material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
- var mesh = new THREE.Mesh( geometry, material ) ;
- scene.add( mesh );
- </code>
- <h2>Constructor</h2>
- <h3>[name]([page:Array shapes], [page:Object options])</h3>
- <div>
- shapes — [page:Array] of shapes, or a single [page:Shape shape] <br />
- options — Optional options [page:Object object]
- <ul>
- <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>
- <h2>Methods</h2>
- <h3>.addShapeList([page:Array shapes], [page:Object options]) [page:this]</h3>
- <div>
- shapes — [page:Array] of [page:Shape shapes] <br />
- options — See options in constructor
- </div>
- <div>
- Adds a list of shapes to the geometry.
- </div>
- <h3>[method:null addShape]([page:Shape shape], [page:Object options])</h3>
- <div>
- shape — [page:Shape] <br />
- options — See options in constructor
- </div>
- <div>
- Adds a single shape to the geometry
- </div>
- <h2>Source</h2>
- [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
- </body>
- </html>
|