greiner-hormann

WebJar for greiner-hormann

Лицензия

Лицензия

MIT
Категории

Категории

ORM Данные
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

greiner-hormann
Последняя версия

Последняя версия

1.3.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

greiner-hormann
WebJar for greiner-hormann
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/w8r/GreinerHormann

Скачать greiner-hormann

Как подключить последнюю версию

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

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

License Greiner-Hormann polygon clipping

  • Does AND, OR, XOR (intersection, union, difference, if you're human)
  • Plays nicely with Leaflet, comes with an adaptor for it
  • Handles non-convex polygons and multiple clipping areas
  • ~3kb compressed, no dependencies

Demo and documentation

Note: If you are looking for something more powerful, take a look at the Martinez polygon clipping implementation.

Install

$ npm install greiner-hormann

Browserify

var greinerHormann = require('greiner-hormann');

Browser

<script src="path/to/greiner-hormann(.leaflet).min.js"></script>

Use

...
var intersection = greinerHormann.intersection(source, clip);
var union        = greinerHormann.union(source, clip);
var diff         = greinerHormann.diff(source, clip);

...

if(intersection){
    if(typeof intersection[0][0] === 'number'){ // single linear ring
        intersection = [intersection];
    }
    for(var i = 0, len = intersection.length; i < len; i++){
        L.polygon(intersection[i], {...}).addTo(map);
    }
}

Format

Input and output can be {x:x, y:y} objects or [x,y] pairs. It will output the points in the same format you put in.

Версии библиотеки

Версия
1.3.2