# @mesh.js/core

> A graphics system born for visualization.

Latest version **1.1.25** (published 2022-07-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mesh.js/core
pnpm add @mesh.js/core
yarn add @mesh.js/core
bun add @mesh.js/core
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.25 |
| Published | 2022-07-13 |
| First published | 2019-07-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 13 |
| Unpacked size | 1.7 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 254 |
| Author | akira-cn |
| Maintainers | akira_cn, spritejs |

## Links

- npm: https://www.npmjs.com/package/@mesh.js/core
- Repository: https://github.com/mesh-js/mesh.js
- Homepage: https://meshjs.org/
- Issues: https://github.com/mesh-js/mesh.js/issues
- npm.io page: https://npm.io/package/@mesh.js/core

## Dependencies (13)

- [tess2](https://npm.io/package/tess2.md) ^1.0.0
- [xtend](https://npm.io/package/xtend.md) ^4.0.2
- [as-number](https://npm.io/package/as-number.md) ^1.0.0
- [gl-matrix](https://npm.io/package/gl-matrix.md) ^3.1.0
- [color-rgba](https://npm.io/package/color-rgba.md) ^2.1.1
- [gl-renderer](https://npm.io/package/gl-renderer.md) ^0.13.5
- [abs-svg-path](https://npm.io/package/abs-svg-path.md) ^0.1.1
- [bound-points](https://npm.io/package/bound-points.md) ^1.0.0
- [simplify-path](https://npm.io/package/simplify-path.md) ^1.1.0
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.4.5
- [parse-svg-path](https://npm.io/package/parse-svg-path.md) ^0.1.2
- [polyline-miter-util](https://npm.io/package/polyline-miter-util.md) ^1.0.1
- [adaptive-bezier-curve](https://npm.io/package/adaptive-bezier-curve.md) ^1.0.3

## Recent versions

- 1.1.25 (latest) — 2022-07-13
- 1.1.23 — 2021-07-22
- 1.1.22 — 2021-04-29
- 1.1.21 — 2021-01-17
- 1.1.20 — 2020-09-29
- 1.1.19 — 2020-09-01
- 1.1.18 — 2020-07-16
- 1.1.17 — 2020-06-10
- 1.1.16 — 2020-06-10
- 1.1.15 — 2020-06-04
- 1.1.14 — 2020-05-19
- 1.1.13 — 2020-05-18
- 1.1.12 — 2020-05-18
- 1.1.11 — 2020-05-18
- 1.1.10 — 2020-05-18
- … 184 more at https://npm.io/package/@mesh.js/core/versions

## README

# Mesh.js

A graphics system born for visualization 😘.

As simple as Canvas2D and as FAST as WebGL/WebGPU.

![](https://p2.ssl.qhimg.com/t01300899f9a1c796df.jpg)

## Why mesh.js

- Blazing fast rendering massive sprites. See our [benchmark](http://meshjs.webgl.group/demo/#/benchmark/triangles).
- Cross platform. Support both canvas2d and webgl.
- Support SVG Path.
- Support gradients and filters.
- Support Worker and OffscreenCanvas.

Learn more at [meshjs.webgl.group](http://meshjs.webgl.group).

## Installation

From CDN:

```html
<script src="https://unpkg.com/@mesh.js/core/dist/mesh.js"></script>
```

Use NPM:

```bash
npm i @mesh.js/core --save;
```

```js
import {Renderer, Figure2D, Mesh2D} from '@mesh.js/core';
```

## Usage

👉🏻 [online demo](https://code.h5jun.com/tedom/edit?html,js,output)

```js
const {Renderer, Figure2D, Mesh2D} = meshjs;

const canvas = document.querySelector('canvas');
const renderer = new Renderer(canvas);

const figure = new Figure2D();
figure.rect(50, 50, 100, 100);

const mesh1 = new Mesh2D(figure, canvas);
mesh1.setFill({
  color: [1, 0, 0, 1],
});

const mesh2 = new Mesh2D(figure, canvas);
mesh2.setFill({
  color: [0, 0, 1, 1],
});

function update(t) {
  mesh2.setTransform(1, 0, 0, 1, 50, 50);
  mesh2.rotate(t * 0.001 * Math.PI, [150, 150]);
  renderer.drawMeshes([mesh1, mesh2]);
  requestAnimationFrame(update);
}

update(0);
```

## Roadmap

- [ ] Complete documentations
- [ ] More demos and benchmark.
- [ ] Unit tests.
- [ ] Figure3D and Mesh3D.
- [ ] Optimize mesh compressor.
- [ ] WebGPU.
- [x] Work with Worker+OffscreenCanvas.

## LICENSE

MIT

---
_Source: https://npm.io/package/@mesh.js/core · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
