@doodle3d/clipper-js
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -233,3 +233,2 @@ 'use strict'; | ||
value: function thresholdArea(minArea) { | ||
// code not tested yet | ||
var _arr = [].concat(_toConsumableArray(this.paths)); | ||
@@ -239,3 +238,3 @@ | ||
var path = _arr[_i]; | ||
var area = Math.abs(_clipperLib2.default.Clipper.Area(shape)); | ||
var area = Math.abs(_clipperLib2.default.Clipper.Area(path)); | ||
@@ -334,4 +333,4 @@ if (area < minArea) { | ||
if (this.closed) { | ||
var _shape = _clipperLib2.default.Clipper.SimplifyPolygons(this.paths, _clipperLib2.default.PolyFillType[fillType]); | ||
return new Shape(_shape, true); | ||
var shape = _clipperLib2.default.Clipper.SimplifyPolygons(this.paths, _clipperLib2.default.PolyFillType[fillType]); | ||
return new Shape(shape, true); | ||
} else { | ||
@@ -401,3 +400,3 @@ return this; | ||
var _shape2 = [outline]; | ||
var shape = [outline]; | ||
@@ -412,3 +411,3 @@ var index = this.paths.indexOf(outline); | ||
if (pointInHole) { | ||
_shape2.push(hole); | ||
shape.push(hole); | ||
@@ -420,3 +419,3 @@ var _index = holes.indexOf(hole); | ||
shapes.push(new Shape(_shape2, true)); | ||
shapes.push(new Shape(shape, true)); | ||
} | ||
@@ -423,0 +422,0 @@ } catch (err) { |
@@ -233,3 +233,2 @@ 'use strict'; | ||
value: function thresholdArea(minArea) { | ||
// code not tested yet | ||
var _arr = [].concat(_toConsumableArray(this.paths)); | ||
@@ -239,3 +238,3 @@ | ||
var path = _arr[_i]; | ||
var area = Math.abs(_clipperLib2.default.Clipper.Area(shape)); | ||
var area = Math.abs(_clipperLib2.default.Clipper.Area(path)); | ||
@@ -334,4 +333,4 @@ if (area < minArea) { | ||
if (this.closed) { | ||
var _shape = _clipperLib2.default.Clipper.SimplifyPolygons(this.paths, _clipperLib2.default.PolyFillType[fillType]); | ||
return new Shape(_shape, true); | ||
var shape = _clipperLib2.default.Clipper.SimplifyPolygons(this.paths, _clipperLib2.default.PolyFillType[fillType]); | ||
return new Shape(shape, true); | ||
} else { | ||
@@ -401,3 +400,3 @@ return this; | ||
var _shape2 = [outline]; | ||
var shape = [outline]; | ||
@@ -412,3 +411,3 @@ var index = this.paths.indexOf(outline); | ||
if (pointInHole) { | ||
_shape2.push(hole); | ||
shape.push(hole); | ||
@@ -420,3 +419,3 @@ var _index = holes.indexOf(hole); | ||
shapes.push(new Shape(_shape2, true)); | ||
shapes.push(new Shape(shape, true)); | ||
} | ||
@@ -423,0 +422,0 @@ } catch (err) { |
{ | ||
"name": "@doodle3d/clipper-js", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Clipper-lib abstraction layer (simplified API)", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -150,5 +150,4 @@ import ClipperLib from 'clipper-lib'; | ||
thresholdArea(minArea) { | ||
// code not tested yet | ||
for (const path of [...this.paths]) { | ||
const area = Math.abs(ClipperLib.Clipper.Area(shape)); | ||
const area = Math.abs(ClipperLib.Clipper.Area(path)); | ||
@@ -155,0 +154,0 @@ if (area < minArea) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
98746
11
1358