UNPKG
extrude
Version:
latest (1.0.2)
1.0.2
1.0.1
1.0.0
turn a 2d shape into a 3d mesh with extrusion
github.com/freeman-lab/extrude
freeman-lab/extrude
extrude
/
shapes
/
circle.js
14 lines
(11 loc)
•
283 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
var
range =
require
(
'lodash.range'
)
var
line =
range
(
0
,
Math
.
PI
*
2
,
Math
.
PI
*
2
/
30
)
var
points = line.
map
(
function
(
t
) {
var
x =
Math
.
sin
(t)
var
y =
Math
.
cos
(t)
return
[x, y] })
module
.
exports
= {
points
: points.
reverse
(),
colors
: [[
0.9
,
0.8
,
0.1
], [
0.8
,
0.6
,
0.2
]] }