Creates a 2d arc in 3d space
Switch branches/tags
Nothing to show
Clone or download
Latest commit d8695e2 Feb 2, 2016
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test Fixed winding order Mar 19, 2015
.gitignore You've been had by the snake Mar 5, 2015
LICENSE.md You've been had by the snake Mar 5, 2015
README.md Fixed a spelling/word mistake Feb 2, 2016
index.js Add uvs to the created geometry Jan 29, 2016
package.json 1.1.2 Feb 2, 2016
render.png You've been had by the snake Mar 5, 2015

README.md

geo-arc

render experimental

Creates a 2d arc in 3d space.

Usage

NPM

Example

An example can be found at ./test/index.js. You can run this test by calling:

$ npm test

A simple usage example with default values being passed as settings:

var geoArc = require('geo-arc');

// geo will be a Object will three properties:
// positions - the vertices
// cells - the indices to draw the arc
// uvs - uv values for for the arc
var geo = geoArc( {
    cellSize: 3, // 1 == points, 2 == lines, 3 == triangles
    x: 0, // x position of the center of the arc
    y: 0, // y position of the center of the arc
    z: 0, // z position of the center of the arc
    startRadian: 0, // start radian for the arc
    endRadian: 1.5, // end radian for the arc
    innerRadius: 40, // inner radius of the arc
    outerRadius: 200, // outside radius of the arc
    numBands: 2, // subdivision from inside out 
    numSlices: 40, // subdivision along curve
    drawOutline: true // if cellSize == 2 draw only the outside of the shape
});

Generated uv values look like this: Generated UVs

License

MIT, see LICENSE.md for details.