lineclip

WebJar for lineclip

License

License

ISC
Categories

Categories

CLI User Interface
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

lineclip
Last Version

Last Version

1.1.5
Release Date

Release Date

Type

Type

jar
Description

Description

lineclip
WebJar for lineclip
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/mapbox/lineclip

Download lineclip

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/lineclip/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>lineclip</artifactId>
    <version>1.1.5</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/lineclip/
implementation 'org.webjars.npm:lineclip:1.1.5'
// https://jarcasting.com/artifacts/org.webjars.npm/lineclip/
implementation ("org.webjars.npm:lineclip:1.1.5")
'org.webjars.npm:lineclip:jar:1.1.5'
<dependency org="org.webjars.npm" name="lineclip" rev="1.1.5">
  <artifact name="lineclip" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='lineclip', version='1.1.5')
)
libraryDependencies += "org.webjars.npm" % "lineclip" % "1.1.5"
[org.webjars.npm/lineclip "1.1.5"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

lineclip

Build Status Coverage Status

A very fast JavaScript library for clipping polylines and polygons by a bounding box.

lineclip(
    [[-10, 10], [10, 10], [10, -10]], // line
    [0, 0, 20, 20]); // bbox
// returns [[[0, 10], [10, 10], [10, 0]]]

API

lineclip.polyline(points, bbox[, result])

  • points — an array of [x, y] points
  • bbox — a bounding box as [xmin, ymin, xmax, ymax]
  • result — an array to append the results to

Returns an array of clipped lines.

lineclip is an alias to lineclip.polyline.

lineclip.polygon(points, bbox)

Returns a clipped polygon.

Install

Install with NPM:

npm install lineclip

To build a browser-compatible version, clone the repository locally, then run:

npm install -g browserify
browserify -s lineclip index.js > lineclip.js

Changelog

1.1.5 (Sep 23, 2015)

  • Fixed a bug where polygon clip broke on out-of-bbox polygons.

1.1.4 (Sep 22, 2015)

  • Fixed a bug where last point was omitted if the last two points are in bbox.
  • Fixed a bug where a line outside of bbox would produce [[]] instead of [].

1.1.3 (Sep 12, 2015)

  • Fixed a polygon clipping race condition.

1.1.2 (Sep 11, 2015)

  • Fixed a bug that completely broke the clipping on many cases. Sorry!

1.1.1 (Sep 11, 2015)

  • Fixed a polyline clipping edge case.

1.1.0 (Sep 11, 2015)

  • Added Sutherland-Hodgeman polygon clipping (lineclip.polygon).

1.0.1 (Sep 11, 2015)

  • Minor code cleanup and optimizations.

1.0.0 (Sep 8, 2015)

  • Initial release.
org.webjars.npm

Mapbox

Mapbox is the location data platform for mobile and web applications. We're changing the way people move around cities and explore our world.

Versions

Version
1.1.5