@flatten-js/core
Advanced tools
Comparing version 1.4.2 to 1.4.3
@@ -155,2 +155,5 @@ // Type definitions for flatten-js library | ||
reverse(): Arc; | ||
translate(vec: Vector): Arc; | ||
translate(x:number, y:number): Arc; | ||
rotate(angle: number, center?: Point): Arc; | ||
scale(scaleX: number, scaleY: number) : Arc; | ||
@@ -190,2 +193,6 @@ transform(matrix: Matrix): Arc; | ||
toSegments() : Array<Segment>; | ||
translate(vec: Vector): Box; | ||
translate(x:number, y:number): Box; | ||
rotate(angle: number, center?: Point): never; | ||
scale(scaleX: number, scaleY: number) : Box; | ||
transform(matrix: Matrix): Box; | ||
@@ -216,2 +223,6 @@ output(): Box; // required by base type Interval | ||
distanceTo(geom: AnyShape | PlanarSet): [number, Segment]; | ||
translate(vec: Vector): Circle; | ||
translate(x:number, y:number): Circle; | ||
rotate(angle: number, center?: Point): Circle; | ||
scale(scaleX: number, scaleY: number) : Circle | never; | ||
transform(matrix: Matrix): Circle; | ||
@@ -249,2 +260,6 @@ toJSON() : Object; | ||
sortPoints(points: Point[]): Point[]; | ||
translate(vec: Vector): Line; | ||
translate(x:number, y:number): Line; | ||
rotate(angle: number, center?: Point): Line; | ||
scale(scaleX: number, scaleY: number) : Line; | ||
transform(matrix: Matrix): Line; | ||
@@ -271,2 +286,6 @@ toJSON() : Object; | ||
lessThan(pt: Point): boolean; | ||
translate(vec: Vector): Point; | ||
translate(x: number, y: number): Point; | ||
rotate(angle: number, center?: Point): Point; | ||
scale(scaleX: number, scaleY: number) : Point; | ||
transform(matrix: Matrix): Point; | ||
@@ -298,2 +317,6 @@ projectionOn(line: Line): Point; | ||
intersect(shape: AnyShape): Point[]; | ||
translate(vec: Vector): Ray; | ||
translate(x:number, y:number): Ray; | ||
rotate(angle: number, center?: Point): Ray; | ||
scale(scaleX: number, scaleY: number) : Ray; | ||
transform(matrix: Matrix): Ray; | ||
@@ -330,2 +353,6 @@ svg(box: Box, attrs?: SVGAttributes): string; | ||
pointAtLength(length: number): Point|null; | ||
translate(vec: Vector): Segment; | ||
translate(x:number, y:number): Segment; | ||
rotate(angle: number, center?: Point): Segment; | ||
scale(scaleX: number, scaleY: number) : Segment; | ||
transform(matrix: Matrix): Segment; | ||
@@ -360,2 +387,6 @@ isZeroLength(): boolean; | ||
rotate90CW(): Vector; | ||
translate(vec: Vector): Vector; | ||
translate(x:number, y:number): Vector; | ||
rotate(angle: number, center?: Point): Vector; | ||
scale(scaleX: number, scaleY: number) : Vector; | ||
transform(matrix: Matrix): Vector; | ||
@@ -620,12 +651,12 @@ invert(): Vector; | ||
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; |
{ | ||
"name": "@flatten-js/core", | ||
"version": "1.4.2", | ||
"version": "1.4.3", | ||
"description": "Javascript library for 2d geometry", | ||
@@ -5,0 +5,0 @@ "main": "dist/main.cjs.js", |
'use strict'; | ||
import { expect } from 'chai'; | ||
import Flatten, {multiline} from '../../index'; | ||
// import {relate, disjoint, equal, intersect, touch, inside, contain, covered, cover} from '../../src/algorithms/relation'; | ||
import {intersectLine2Polygon} from "../../src/algorithms/intersection"; | ||
import Flatten from '../../index'; | ||
let {Point, Vector, Circle, Line, Segment, Arc, Box, Polygon, Edge, Face, Ray} = Flatten; | ||
let {point, vector, circle, line, segment, arc, ray, box} = Flatten; | ||
let {Polygon} = Flatten; | ||
let {point, vector, circle, line, box} = Flatten; | ||
let {relate, disjoint, equal, intersect, touch, inside, contain, covered, cover} = Flatten.Relations; | ||
@@ -37,2 +34,8 @@ | ||
}); | ||
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() { | ||
@@ -268,4 +271,2 @@ it ('Parallel case (disjoint)', () => { | ||
let de9im = relate(p1, p2); | ||
expect(disjoint(p1, p2)).to.be.false; | ||
@@ -284,4 +285,2 @@ expect(equal(p1, p2)).to.be.false; | ||
let de9im = relate(p1, p2); | ||
expect(disjoint(p1, p2)).to.be.false; | ||
@@ -300,4 +299,2 @@ expect(equal(p1, p2)).to.be.false; | ||
let de9im = relate(p1, p2); | ||
expect(disjoint(p1, p2)).to.be.false; | ||
@@ -304,0 +301,0 @@ expect(equal(p1, p2)).to.be.false; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
5765844
168
36844