1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <!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>
- <h1>[name]</h1>
- <div class="desc">
- A class containing utility functions for shapes.<br /><br />
- Note that these are all linear functions so it is neccessary to calculate separately for
- x, y (and z, w if present) components of a vector.
- </div>
- <h2>Methods</h2>
- <h3>[method:Number area]( contour )</h3>
- <div>
- contour -- 2D polygon.<br /><br />
- Calculate area of a ( 2D ) contour polygon.<br /><br />
- </div>
- <h3>[method:Boolean isClockwise]( pts )</h3>
- <div>
- pts -- points defining a 2D polygon<br /><br />
- Note that this is a linear function so it is neccessary to calculate separately for
- x, y components of a polygon.<br /><br />
- Used internally by [page:Path Path],
- [page:ExtrudeGeometry ExtrudeGeometry] and [page:ShapeBufferGeometry ShapeBufferGeometry].
- </div>
- <h3>[method:null triangulate]( contour, indices )</h3>
- <div>
- vertices -- flat array of vertices like [ x0,y0, x1,y1, x2,y2, ... ].<br />
- holeIndices -- array of hole indices.<br /><br />
- Performs a polygon triangulation based on earcut. The implementation is a port of [link:https://github.com/mapbox/earcut mapbox/earcut].
- </div>
- <h3>[method:null triangulateShape]( contour, holes )</h3>
- <div>
- contour -- 2D polygon.<br />
- holes -- array of holes<br /><br />
- Used by [page:ExtrudeGeometry ExtrudeGeometry] and [page:ShapeBufferGeometry ShapeBufferGeometry] to calculate faces in shapes with holes.
- </div>
- <h2>Source</h2>
- [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
- </body>
- </html>
|