extrude-by-path
extrude a 2d shape along a 3d path to build a simplicial complex
example
This demo extrudes a star polygon along a helix path, twisting eight times per revolution of the helix.
https://substack.neocities.org/extrude-helix.html
var extrude =var helix =for var i = 0; i < 1000; i++var theta = i/320*2*MathPI d = i-500/250helixvar mesh =console
api
var extrude =
var mesh = extrude(opts)
opts.positions
- array of[x,y]
points in the polygonopts.edges
- array of[i,j]
indices of positionsopts.cells
- array of[i,j,k]
indices of positions (required for capping)opts.path
- array of[x,y,z]
or[x,y,z,twist]
points. twist in radians.opts.closed
- set totrue
if the path is a closed loopopts.startCap
- set tofalse
to skip the start capopts.endCap
- set tofalse
to skip the end capopts.caps
- set tofalse
to skip all caps
install
npm install extrude-by-path
license
BSD