Skip to content

Commit

Permalink
Change signature of relations in typescript definition file
Browse files Browse the repository at this point in the history
Issue #149
  • Loading branch information
alexbol99 committed Aug 29, 2023
1 parent 4b339ea commit b745c2f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
16 changes: 8 additions & 8 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -609,14 +609,14 @@ declare namespace Flatten.BooleanOperations {
}

declare namespace Flatten.Relations {
function relate(shape1: Shape, shape2: Shape): DE9IM;
function equal(shape1: Shape, shape2: Shape): boolean;
function intersect(shape1: Shape, shape2: Shape): boolean;
function touch(shape1: Shape, shape2: Shape): boolean;
function disjoint(shape1: Shape, shape2: Shape): boolean;
function inside(shape1: Shape, shape2: Shape): boolean;
function covered(shape1: Shape, shape2: Shape): boolean;
function cover(shape1: Shape, shape2: Shape): boolean;
function relate(shape1: AnyShape, shape2: AnyShape): DE9IM;
function equal(shape1: AnyShape, shape2: AnyShape): boolean;
function intersect(shape1: AnyShape, shape2: AnyShape): boolean;
function touch(shape1: AnyShape, shape2: AnyShape): boolean;
function disjoint(shape1: AnyShape, shape2: AnyShape): boolean;
function inside(shape1: AnyShape, shape2: AnyShape): boolean;
function covered(shape1: AnyShape, shape2: AnyShape): boolean;
function cover(shape1: AnyShape, shape2: AnyShape): boolean;
}

export default Flatten;
6 changes: 6 additions & 0 deletions test/algorithms/relation.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ describe('#Algorithms.Relation', function() {
expect(intersect).to.be.a('function');
expect(touch).to.be.a('function');
});
it('v1.4 Relations.intersect() doesnt allow Polygon argument #149', () => {
const polygon = new Flatten.Polygon(new Flatten.Box(2, 2, 3, 3));
const box = new Flatten.Box(1, 1, 10, 10);
const bIntersect = Flatten.Relations.intersect(polygon, box);
expect(bIntersect).to.be.true;
})
describe('#Algorithms.Relation.Line2Line', function() {
it ('Parallel case (disjoint)', () => {
let l1 = line( point(10,10), vector(1,1) );
Expand Down

0 comments on commit b745c2f

Please sign in to comment.