123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- <!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:Path] →
- <h1>[name]</h1>
- <div class="desc">
- Defines an arbitrary 2d shape plane using paths with optional holes. It can be used with [page:ExtrudeGeometry],
- [page:ShapeGeometry], to get points, or to get triangulated faces.
- </div>
-
- <code>
- var heartShape = new THREE.Shape();
- heartShape.moveTo( 25, 25 );
- heartShape.bezierCurveTo( 25, 25, 20, 0, 0, 0 );
- heartShape.bezierCurveTo( 30, 0, 30, 35,30,35 );
- heartShape.bezierCurveTo( 30, 55, 10, 77, 25, 95 );
- heartShape.bezierCurveTo( 60, 77, 80, 55, 80, 35 );
- heartShape.bezierCurveTo( 80, 35, 80, 0, 50, 0 );
- heartShape.bezierCurveTo( 35, 0, 25, 25, 25, 25 );
-
- var extrudeSettings = { amount: 8, bevelEnabled: true, bevelSegments: 2, steps: 2, bevelSize: 1, bevelThickness: 1 };
-
- var geometry = new THREE.ExtrudeGeometry( shape, extrudeSettings );
- var mesh = new THREE.Mesh( geometry, new THREE.MeshPhongMaterial() );
- </code>
-
- <h2>Examples</h2>
-
- <div>
- [example:webgl_geometry_shapes geometry / shapes ]<br/>
- [example:webgl_geometry_extrude_shapes geometry / extrude / shapes ]<br/>
- [example:webgl_geometry_extrude_shapes2 geometry / extrude / shapes2 ]<br/>
- [example:webgl_particles_shapes particles / shapes ]
- </div>
- <h2>Constructor</h2>
- <h3>[name]()</h3>
- <h2>Properties</h2>
- <h3>[property:array holes]</h3>
- <div>
- An array of [page:Path paths] that define the holes in the shape.
- </div>
- <h2>Methods</h2>
- <h3>[method:ShapeGeometry makeGeometry]([page:Object options])</h3>
- <div>
- options -- This is passed as the second argument to [page:ShapeGeometry ShapeGeometry]
- </div>
- <div>
- Convenience method to return ShapeGeometry
- </div>
- <h3>[method:Array extractAllPoints]([page:Integer divisions])</h3>
- <div>
- divisions -- The number of divisions to create on the shape
- </div>
- <div>
- Get points of shape and holes (keypoints based on segments parameter)
- </div>
- <h3>[method:ExtrudeGeometry extrude]([page:Object options])</h3>
- <div>
- options -- This is passed as the second argument to [page:ExtrudeGeometry ExtrudeGeometry]
- </div>
- <div>
- Convenience method to return ExtrudeGeometry
- </div>
- <h3>[method:Object extractPoints]([page:Integer divisions])</h3>
- <div>
- divisions -- The number of divisions to create on the shape
- </div>
- <div>
- Returns an object with a *shape* and *holes* property that each reference an array of [page:Vector2 Vector2s].
- </div>
- <h3>[method:Object extractAllSpacedPoints]([page:Integer divisions])</h3>
- <div>
- divisions -- The number of divisions to create on the shape
- </div>
- <div>
- Returns an object with a *shape* and *holes* property that each reference an array of [page:Vector2 Vector2s]. The
- points will all be equally spaced along the shape.
- </div>
- <h3>[method:Array getPointsHoles]([page:Integer divisions])</h3>
- <div>
- divisions -- The number of divisions to create on the shape
- </div>
- <div>
- Get an array of [page Vector2 Vector2s] that represent the holes in the shape.
- </div>
- <h3>[method:Array getSpacedPointsHoles]([page:Integer divisions])</h3>
- <div>
- divisions -- The number of divisions to create on the shape
- </div>
- <div>
- Get an array of equally spaced [page Vector2 Vector2s] that represent the holes in the shape.
- </div>
- <h2>Source</h2>
- [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
- </body>
- </html>
|