Intersection
Defined in: src/Intersection.ts:8
Constructors
new Intersection()
new Intersection(
status
?):Intersection
Defined in: src/Intersection.ts:13
Parameters
status?
Returns
Properties
points
points:
Point
[]
Defined in: src/Intersection.ts:9
status?
optional
status:IntersectionType
Defined in: src/Intersection.ts:11
Methods
intersectLineLine()
static
intersectLineLine(a1
,a2
,b1
,b2
,aInfinite
?,bInfinite
?):Intersection
Defined in: src/Intersection.ts:127
Checks if a line intersects another
Parameters
a1
a2
b1
b2
aInfinite?
boolean
= true
check segment intersection by passing false
bInfinite?
boolean
= true
check segment intersection by passing false
Returns
See
Static
intersectLinePolygon()
static
intersectLinePolygon(a1
,a2
,points
,infinite
?):Intersection
Defined in: src/Intersection.ts:224
Checks if line intersects polygon
Parameters
a1
point on line
a2
other point on line
points
Point
[]
polygon points
infinite?
boolean
= true
check segment intersection by passing false
Returns
Todo
account for stroke
Static
See
intersectSegmentPolygon for segment intersection
intersectPolygonPolygon()
static
intersectPolygonPolygon(points1
,points2
):Intersection
Defined in: src/Intersection.ts:277
Checks if polygon intersects another polygon
Parameters
points1
Point
[]
points2
Point
[]
Returns
Todo
account for stroke
Static
intersectPolygonRectangle()
static
intersectPolygonRectangle(points
,r1
,r2
):Intersection
Defined in: src/Intersection.ts:315
Checks if polygon intersects rectangle
Parameters
points
Point
[]
polygon points
r1
top left point of rect
r2
bottom right point of rect
Returns
Static
See
intersectPolygonPolygon for polygon intersection
intersectSegmentLine()
static
intersectSegmentLine(s1
,s2
,l1
,l2
):Intersection
Defined in: src/Intersection.ts:183
Checks if a segment intersects a line
Parameters
s1
boundary point of segment
s2
other boundary point of segment
l1
point on line
l2
other point on line
Returns
See
intersectLineLine for line intersection
Static
intersectSegmentPolygon()
static
intersectSegmentPolygon(a1
,a2
,points
):Intersection
Defined in: src/Intersection.ts:259
Checks if segment intersects polygon
Parameters
a1
boundary point of segment
a2
other boundary point of segment
points
Point
[]
polygon points
Returns
Static
See
intersectLinePolygon for line intersection
intersectSegmentSegment()
static
intersectSegmentSegment(a1
,a2
,b1
,b2
):Intersection
Defined in: src/Intersection.ts:202
Checks if a segment intersects another
Parameters
a1
boundary point of segment
a2
other boundary point of segment
b1
boundary point of segment
b2
other boundary point of segment
Returns
See
intersectLineLine for line intersection
Static
isPointContained()
static
isPointContained(T
,A
,B
,infinite
?):boolean
Defined in: src/Intersection.ts:51
check if point T is on the segment or line defined between A and B
Parameters
T
the point we are checking for
A
one extremity of the segment
B
the other extremity of the segment
infinite?
boolean
= false
if true checks if T
is on the line defined by A
and B
Returns
boolean
true if T
is contained
isPointInPolygon()
static
isPointInPolygon(point
,points
):boolean
Defined in: src/Intersection.ts:91
Use the ray casting algorithm to determine if point is in the polygon defined by points
Parameters
point
points
Point
[]
polygon points
Returns
boolean