上传者: 42098104
|
上传时间: 2021-11-10 22:43:32
|
文件大小: 2.3MB
|
文件类型: -
多边形裁剪
对您的Polygons&MultiPolygons应用boolean Polygon裁剪操作( intersection , union , difference , xor )。
快速开始
const polygonClipping = require ( 'polygon-clipping' )
const poly1 = [ [ [ 0 , 0 ] , [ 2 , 0 ] , [ 0 , 2 ] , [ 0 , 0 ] ] ]
const poly2 = [ [ [ - 1 , 0 ] , [ 1 , 0 ] , [ 0 , 1 ] , [ - 1 , 0 ] ] ]
polygonClipping . union ( poly1 , poly2 /* , poly3, ... */ )
polygonClipping . intersection ( pol