Skip to content

Commit

Permalink
- Submit package after update examples section in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbol99 committed Nov 28, 2020
1 parent 7811b60 commit 4d616a9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "@flatten-js/polygon-offset",
"version": "1.1.1",
"version": "1.1.2",
"description": "Polygon equidistant offset",
"main": "dist/main.cjs.js",
"umd:main": "dist/main.umd.js",
Expand Down Expand Up @@ -44,7 +44,7 @@
"dependencies": {
},
"peerDependencies": {
"@flatten-js/core": "^1.2.14"
"@flatten-js/core": "^1.2.16"
},
"devDependencies": {
"@babel/cli": "^7.2.3",
Expand Down
19 changes: 19 additions & 0 deletions test/test.js
Expand Up @@ -208,4 +208,23 @@ describe('#Algorithms.Offset Polygon', function () {
let testOffsetArc = offsetArc(testArc, 20);
expect(testOffsetArc.faces.size).to.be.equal(1);
});
it('Method offset can enlarge to small value', function () {
// let shapes = [
// point(0, 0), point(200, 0), point(200, 200), point(0, 200)
// ];

let shapes = [
segment(point(0, 0), point(200, 0)),
segment(point(200, 0), point(200, 200)),
segment(point(200, 200), point(0, 200)),
segment(point(0, 200), point(0, 0))
];

let polygon = new Polygon(shapes);
polygon.reverse()
let offsetPolygon = offset(polygon, 2);

expect(offsetPolygon.faces.size).to.be.equal(1);
expect(offsetPolygon.edges.size).to.be.equal(8);
})
});

0 comments on commit 4d616a9

Please sign in to comment.