Skip to content

Commit

Permalink
docs(geom-clip-line): update readme
Browse files Browse the repository at this point in the history
BREAKING CHANGE: extract as own pkg (formerly @thi.ng/geom-clip)
  • Loading branch information
postspectacular committed Feb 23, 2020
1 parent c0cc9af commit f78374b
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 8 deletions.
38 changes: 33 additions & 5 deletions packages/geom-clip-line/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- This file is generated - DO NOT EDIT! -->

# ![@thi.ng/geom-clip-line](https://media.thi.ng/umbrella/banners/thing-geom-clip-line.svg?1581809314)
# ![@thi.ng/geom-clip-line](https://media.thi.ng/umbrella/banners/thing-geom-clip-line.svg?1582472092)

[![npm version](https://img.shields.io/npm/v/@thi.ng/geom-clip-line.svg)](https://www.npmjs.com/package/@thi.ng/geom-clip-line)
![npm downloads](https://img.shields.io/npm/dm/@thi.ng/geom-clip-line.svg)
Expand All @@ -21,17 +21,23 @@ This project is part of the

2D line clipping (Liang-Barsky).

Current implementation is based on [toxiclibs](http://toxiclibs.org)
(Java) and Clojure version of [thi.ng/geom](http://thi.ng/geom).

This package has been extracted from the former (now obsolete)
@thi.ng/geom-clip package.

### Status

**ALPHA** - bleeding edge / work-in-progress
**STABLE** - used in production

## Installation

```bash
yarn add @thi.ng/geom-clip-line
```

Package sizes (gzipped): CJS: 0.4KB
Package sizes (gzipped): ESM: 0.3KB / CJS: 0.3KB / UMD: 0.4KB

## Dependencies

Expand All @@ -41,12 +47,34 @@ Package sizes (gzipped): CJS: 0.4KB

[Generated API docs](https://docs.thi.ng/umbrella/geom-clip-line/)

TODO
- `liangBarsky2`
- `liangBarksy2Raw`

```ts
import { liangBarsky2 } from "@thi.ng/geom-clip-line";

liangBarsky2(
// line end points
[-10, -20], [30, 400],
// min/max clip rect
[0, 0], [100, 200]
)
// [ [ 0, 85 ], [ 10.952380952380953, 200 ], 0.25, 0.5238095238095238 ]

// returns undefined if line is completely outside the clip rect
liangBarsky2(
// line end points
[-10, -20], [-30, 400],
// min/max bbox
[0, 0], [100, 200]
)
// undefined
```

## Authors

Karsten Schmidt

## License

&copy; 2020 Karsten Schmidt // Apache Software License 2.0
&copy; 2013 - 2020 Karsten Schmidt // Apache Software License 2.0
30 changes: 29 additions & 1 deletion packages/geom-clip-line/README.tpl.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ This project is part of the

${pkg.description}

Current implementation is based on [toxiclibs](http://toxiclibs.org)
(Java) and Clojure version of [thi.ng/geom](http://thi.ng/geom).

This package has been extracted from the former (now obsolete)
@thi.ng/geom-clip package.

${status}

${supportPackages}
Expand All @@ -39,7 +45,29 @@ ${examples}

${docLink}

TODO
- `liangBarsky2`
- `liangBarksy2Raw`

```ts
import { liangBarsky2 } from "@thi.ng/geom-clip-line";

liangBarsky2(
// line end points
[-10, -20], [30, 400],
// min/max clip rect
[0, 0], [100, 200]
)
// [ [ 0, 85 ], [ 10.952380952380953, 200 ], 0.25, 0.5238095238095238 ]

// returns undefined if line is completely outside the clip rect
liangBarsky2(
// line end points
[-10, -20], [-30, 400],
// min/max bbox
[0, 0], [100, 200]
)
// undefined
```

## Authors

Expand Down
3 changes: 1 addition & 2 deletions packages/geom-clip-line/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
},
"sideEffects": false,
"thi.ng": {
"status": "alpha",
"year": 2020
"year": 2013
}
}

0 comments on commit f78374b

Please sign in to comment.