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