Skip to content

Commit

Permalink
Updating package name and preparing for initial release.
Browse files Browse the repository at this point in the history
  • Loading branch information
smallsaucepan committed Nov 6, 2024
1 parent 9ef9cd1 commit 2cb9237
Show file tree
Hide file tree
Showing 4 changed files with 1,335 additions and 2,290 deletions.
22 changes: 11 additions & 11 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
# License

```
marching-squares-ts
marching-squares
Portions Copyright (c) 2015, 2015 Ronny Lorenz <[email protected]>
Portions Copyright (c) 2024 James Beard <[email protected]>
marching-squares-ts is free software: you can redistribute it and/or modify
marching-squares is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
marching-squares-ts is distributed in the hope that it will be useful,
marching-squares is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
As additional permission under GNU Affero General Public License version 3
section 7, third-party projects (personal or commercial) may distribute,
include, or link against UNMODIFIED VERSIONS of marching-squares-ts without the
include, or link against UNMODIFIED VERSIONS of marching-squares without the
requirement that said third-party project for that reason alone becomes
subject to any requirement of the GNU Affero General Public License version 3.
Any modifications to marching-squares-ts, however, must be shared with the public
Any modifications to marching-squares, however, must be shared with the public
and made available.
In summary this:
- allows you to use marching-squares-ts at no cost
- allows you to use marching-squares-ts for both personal and commercial purposes
- allows you to distribute UNMODIFIED VERSIONS of marching-squares-ts under any
- allows you to use marching-squares at no cost
- allows you to use marching-squares for both personal and commercial purposes
- allows you to distribute UNMODIFIED VERSIONS of marching-squares under any
license as long as this license notice is included
- enables you to keep the source code of your program that uses marching-squares-ts
- enables you to keep the source code of your program that uses marching-squares
undisclosed
- forces you to share any modifications you have made to marching-squares-ts,
- forces you to share any modifications you have made to marching-squares,
e.g. bug-fixes
You should have received a copy of the GNU Affero General Public License
along with marching-squares-ts. If not, see <http://www.gnu.org/licenses/>.
along with marching-squares. If not, see <http://www.gnu.org/licenses/>.
```
28 changes: 15 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
![GitHub tag](https://img.shields.io/github/v/release/smallsaucepan/marching-squares-ts.svg)
![GitHub tag](https://img.shields.io/github/v/release/smallsaucepan/marching-squares.svg)

![Build Status](https://img.shields.io/github/actions/workflow/status/smallsaucepan/marching-squares-ts/ci.yaml)
![Build Status](https://img.shields.io/github/actions/workflow/status/smallsaucepan/marching-squares/ci.yaml)

[![npm](https://img.shields.io/npm/dw/marching-squares-ts.svg)](https://www.npmjs.com/package/marching-squares-ts)
[![npm](https://img.shields.io/npm/dw/marching-squares.svg)](https://www.npmjs.com/package/marching-squares)

[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)

# marching-squares-ts
# marching-squares

A TypeScript implementation of the [Marching Squares](https://en.wikipedia.org/wiki/Marching_squares) algorithm featuring IsoLines and IsoBand computation.

The implementation computes _iso lines_ (_iso contours_) or _iso bands_ for rectangular 2-dimensional scalar fields and returns an array of (closed) paths that enclose the respective threshold(s). To speed-up computations when multiple _iso lines_/_iso bands_ are required, the implementation makes use of a [Quad-Tree](https://en.wikipedia.org/wiki/Quadtree) data structure for fast look-ups of those cells in the scalar field that actually contribute to the _iso line_ or _iso band_, respectively.

This library is a fork of [MarchingSquares.js](https://github.com/RaumZeit/MarchingSquares.js) by Ronny Lorenz (@RaumZeit), converted to TypeScript and with some minor differences in behaviour. Published and maintained going forward by James Beard (@smallsaucepan).

The implementation computes _iso lines_ (_iso contours_) or _iso bands_ for rectangular 2-dimensional scalar fields and returns an array of (closed) paths that enclose the respective threshold(s). To speed-up computations when multiple _iso lines_/_iso bands_ are required, the implementation makes use of a [Quad-Tree](https://en.wikipedia.org/wiki/Quadtree) data structure for fast look-ups of those cells in the scalar field that actually contribute to the _iso line_ or _iso band_, respectively.
The marching-squares namespace on NPM previously contained an [old project](https://github.com/scottglz/marching-squares) by @scottglz, who agreed to let the name be used by this more modern implementation instead.

## Table of contents

Expand All @@ -25,7 +27,7 @@ The implementation computes _iso lines_ (_iso contours_) or _iso bands_ for rect

## Availability

You can use this module as an [npm package](https://www.npmjs.com/package/marching-squares-ts), load it directly in the browser from a [CDN](), or view the source over on [github](https://github.com/smallsaucepan/marching-squares-ts).
You can use this module as an [npm package](https://www.npmjs.com/package/marching-squares), load it directly in the browser from a [CDN](), or view the source over on [github](https://github.com/smallsaucepan/marching-squares).

The library should be usable in both CommonJS (require) and ESM (import) environments.

Expand All @@ -35,7 +37,7 @@ The library should be usable in both CommonJS (require) and ESM (import) environ

```shell

npm install marching-squares-ts
npm install marching-squares

```

Expand All @@ -52,7 +54,7 @@ There are some easy optimisations available, especially if you are calling `isoL
The basics first - iso lines.

```javascript
import { isoLines } from "marching-squares-ts");
import { isoLines } from "marching-squares");

const data = [
[1, 1, 2],
Expand All @@ -70,7 +72,7 @@ This will yield the data of two lines, which if displayed graphically would look
Next - iso bands.

```javascript
import { isoBands } from "marching-squares-ts");
import { isoBands } from "marching-squares");

const data = [
[1, 1, 2],
Expand All @@ -94,7 +96,7 @@ As part of processing the input data this module uses a Quad Tree to improve per
Instead of

```javascript
import { isoBands } from "marching-squares-ts");
import { isoBands } from "marching-squares");

...
const lines1 = isoLines(data, thresholds1);
Expand All @@ -104,7 +106,7 @@ const lines2 = isoLines(data, thresholds2);
do this

```javascript
import { isoBands, QuadTree } from "marching-squares-ts");
import { isoBands, QuadTree } from "marching-squares");

...
const tree = new QuadTree(data); // extra step :(
Expand Down Expand Up @@ -210,9 +212,9 @@ You can find more examples in the [example/](example/) directory.

## License

marching-squares-ts is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
marching-squares is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

marching-squares-ts grants additional permissions under GNU Affero General Public License version 3 section 7. See [LICENSE.md](LICENSE.md) for details.
marching-squares grants additional permissions under GNU Affero General Public License version 3 section 7. See [LICENSE.md](LICENSE.md) for details.

---

Expand Down
Loading

0 comments on commit 2cb9237

Please sign in to comment.