@flatten-js/core
Advanced tools
Comparing version 1.2.11 to 1.2.12
{ | ||
"name": "@flatten-js/core", | ||
"version": "1.2.11", | ||
"version": "1.2.12", | ||
"description": "Javascript library for 2d geometry", | ||
@@ -5,0 +5,0 @@ "main": "dist/main.cjs.js", |
@@ -141,5 +141,7 @@ "use strict"; | ||
let dist_and_segment = []; | ||
dist_and_segment.push(Distance.point2segment(seg2.start, seg1)); | ||
dist_and_segment.push(Distance.point2segment(seg2.end, seg1)); | ||
let dist_tmp, shortest_segment_tmp | ||
[dist_tmp, shortest_segment_tmp] = Distance.point2segment(seg2.start, seg1); | ||
dist_and_segment.push([dist_tmp, shortest_segment_tmp.reverse()]); | ||
[dist_tmp, shortest_segment_tmp] = Distance.point2segment(seg2.end, seg1); | ||
dist_and_segment.push([dist_tmp, shortest_segment_tmp.reverse()]); | ||
dist_and_segment.push(Distance.point2segment(seg1.start, seg2)); | ||
@@ -146,0 +148,0 @@ dist_and_segment.push(Distance.point2segment(seg1.end, seg2)); |
@@ -310,2 +310,16 @@ /** | ||
}); | ||
it('distanceTo between Polygons: First point of segment is not always on the this polygon #57', function () { | ||
"use strict"; | ||
let rec1 = new Box(0, 0, 200, 50); | ||
let rec2 = new Box(0, 500, 200, 550); | ||
const p1 = new Polygon(rec1); | ||
const p2 = new Polygon(rec2); | ||
let [dist, shortest_segment] = p1.distanceTo(p2); | ||
expect(dist).to.equal(450); | ||
expect(shortest_segment.ps).to.deep.equal({"x": 200, "y": 50}); | ||
expect(shortest_segment.pe).to.deep.equal({"x": 200, "y": 500}); | ||
}); | ||
it('Can add new vertex to face and split edge of polygon (segment)', function () { | ||
@@ -312,0 +326,0 @@ "use strict"; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5293848
33189