Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hughsk/extrude-edges
Takes a 2D shape and generates the sides of an extruded mesh.
https://github.com/hughsk/extrude-edges
Last synced: 8 days ago
JSON representation
Takes a 2D shape and generates the sides of an extruded mesh.
- Host: GitHub
- URL: https://github.com/hughsk/extrude-edges
- Owner: hughsk
- License: other
- Created: 2013-09-20T01:04:28.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2013-09-20T01:04:43.000Z (about 11 years ago)
- Last Synced: 2024-10-17T16:38:56.395Z (22 days ago)
- Language: JavaScript
- Size: 97.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# extrude-edges [![experimental](http://hughsk.github.io/stability-badges/dist/experimental.svg)](http://github.com/hughsk/stability-badges) #
[![extrude-edges](https://nodei.co/npm/extrude-edges.png?mini=true)](https://nodei.co/npm/extrude-edges)
Takes a 2D shape and generates the sides of an extruded mesh. One half of
making 2D shapes into 3D models.## Usage ##
### `extrude(out, shape1, bottom, top[, shape2])` ###
* `out` is an array-like object to output the results to. Pass something
falsey to have a new one created for you instead.
* `shape1` is a flat array-like object listing the vertices in 2D space of the
object to extrude. e.g. `[x0, y0, x1, y1, x2, y2, ...]`
* `bottom` is the bottom y-position of the 3D mesh to be generated.
* `top` is the top y-position of the 3D mesh to be generated.
* `shape2` is an optional second shape to use for the opposite face. Otherwise,
`shape1` will be used in its place.### `extrude.faces(shape)` ###
Given a `shape`, generates an index of faces for the associated mesh. You can
also draw the triangles directly using `gl.TRIANGLES_STRIP`.