# geo-3d-box

> Generate 3d box geometry

Latest version **2.0.2** (published 2016-01-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install geo-3d-box
pnpm add geo-3d-box
yarn add geo-3d-box
bun add geo-3d-box
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2016-01-05 |
| First published | 2015-04-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Greg Tatum |
| Maintainers | tatumcreative |
| Keywords | 3d, geometry, WebGL, box, cube, simplicial |

## Links

- npm: https://www.npmjs.com/package/geo-3d-box
- Repository: https://github.com/TatumCreative/geo-3d-box
- Issues: https://github.com/TatumCreative/geo-3d-box/issues
- npm.io page: https://npm.io/package/geo-3d-box

## Alternatives

- [react-native-root-siblings](https://npm.io/package/react-native-root-siblings.md) — 102.9K weekly downloads
- [post-robot](https://npm.io/package/post-robot.md) — 93.7K weekly downloads
- [@praxisui/dialog](https://npm.io/package/@praxisui/dialog.md) — 2.0K weekly downloads
- [easy-toggle-state](https://npm.io/package/easy-toggle-state.md) — 350 weekly downloads
- [ngx-lightbox-evp](https://npm.io/package/ngx-lightbox-evp.md) — 19 weekly downloads

## Recent versions

- 2.0.2 (latest) — 2016-01-05
- 2.0.1 — 2016-01-04
- 2.0.0 — 2016-01-04
- 1.0.4 — 2015-07-24
- 1.0.3 — 2015-04-20
- 1.0.2 — 2015-04-20
- 1.0.1 — 2015-04-20
- 1.0.0 — 2015-04-20

## README

# 3d Box Geometry

Generate a 3d box, with optional segments, centered on the origin.

![Spinning Box](http://fat.gfycat.com/IgnorantDependentGorilla.gif)

	var box = require('geo-3d-box')({
		size: [5,5,5],
		segments: [2,2,2]
	})

or

	var box = require('geo-3d-box')({
		size: 5,
		segments: 2
	})

The returned object is in the format of a simplicial complex with positions and cell indices (faces). In addition uvs and normals are generated.

	box = {
		positions: [ [x,y,z], [x,y,z], ... ],
		cells: [ [0,1,4], [4,3,0], ... ],
		uvs: [ [u,v], [u,v], ... ],
		normals: [ [x,y,z], [x,y,z], ... ],
	}

## Size (Array or Number)

Either an array or a single number. Sets the width, height, and depth of the box. Defaults to [1,1,1].

## Segments (Array or Number)

Subdivide the cube.

## Migrating from v1.x.x

The data is now all chunked in tuples like `[ [x,y,z], [x,y,z], ... ]` instead of `[ x,y,z,x,y,z,... ]` to be more in-line with stack.gl's ecosystem. In addition normals are now provided by default.

---
_Source: https://npm.io/package/geo-3d-box · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
