-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chore(TS): migrate Intersection #8121
Merged
Merged
Changes from 2 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
d4bcf4e
Update point.class.ts
ShaMan123 5a19804
import point
ShaMan123 20d3e77
migrate
ShaMan123 59a6107
iports
ShaMan123 8f492ae
rename
ShaMan123 7c17d24
Update intersection.class.ts
ShaMan123 7cec891
rename
ShaMan123 3b5f60d
Merge branch 'master' into ts-intersection
ShaMan123 7aa20fa
intersectLineLine
ShaMan123 91fb5eb
fix(): polygon line coincident
ShaMan123 d3ac3f3
Update intersection.js
ShaMan123 578717e
fixed!
ShaMan123 5574cb2
more work
ShaMan123 4ff2483
fix intersectLinePolygon
ShaMan123 46182f2
move unique points logic to appendPoint
ShaMan123 6c1120c
Update intersection.class.ts
ShaMan123 3a3e902
Update intersection.class.ts
ShaMan123 627c73d
dep(): `appendPoint` `appendPoints` => `append`
ShaMan123 26fb94a
fix polygon coincident edge case
ShaMan123 89f13c4
Update intersection.js
ShaMan123 e94d62e
JSDOC
ShaMan123 1df3ec2
Update object_geometry.mixin.ts
ShaMan123 ecdb285
Update intersection.class.ts
ShaMan123 dd5ce7d
Merge branch 'master' into ts-intersection
ShaMan123 4fb0413
Merge branch 'master' into ts-intersection
ShaMan123 b1a8bef
Merge branch 'master' into ts-intersection
ShaMan123 e1fa4a8
Merge branch 'master' into ts-intersection
ShaMan123 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,8 +60,8 @@ export class Intersection { | |
* @param {Point} a2 | ||
* @param {Point} b1 | ||
* @param {Point} b2 | ||
* @param {boolean} [aIinfinite=true] check intersection by passing `false` | ||
* @param {boolean} [bIinfinite=true] check intersection by passing `false` | ||
* @param {boolean} [aIinfinite=true] check segment intersection by passing `false` | ||
* @param {boolean} [bIinfinite=true] check segment intersection by passing `false` | ||
* @return {Intersection} | ||
*/ | ||
static intersectLineLine(a1, a2, b1, b2, aIinfinite = true, bIinfinite = true) { | ||
|
@@ -95,13 +95,13 @@ export class Intersection { | |
} | ||
|
||
/** | ||
* Checks if a segment intersects another | ||
* Checks if a segment intersects a line | ||
* @see {@link intersectLineLine} for line intersection | ||
* @static | ||
* @param {Point} s1 | ||
* @param {Point} s2 | ||
* @param {Point} l1 | ||
* @param {Point} l2 | ||
* @param {Point} s1 boundary point of segment | ||
* @param {Point} s2 other boundary point of segment | ||
* @param {Point} l1 point on line | ||
* @param {Point} l2 other point on line | ||
* @return {Intersection} | ||
*/ | ||
static intersectSegmentLine(s1, s2, l1, l2) { | ||
|
@@ -112,10 +112,10 @@ export class Intersection { | |
* Checks if a segment intersects another | ||
* @see {@link intersectLineLine} for line intersection | ||
* @static | ||
* @param {Point} a1 | ||
* @param {Point} a2 | ||
* @param {Point} b1 | ||
* @param {Point} b2 | ||
* @param {Point} a1 boundary point of segment | ||
* @param {Point} a2 other boundary point of segment | ||
* @param {Point} b1 boundary point of segment | ||
* @param {Point} b2 other boundary point of segment | ||
* @return {Intersection} | ||
*/ | ||
static intersectSegmentSegment(a1, a2, b1, b2) { | ||
|
@@ -124,10 +124,14 @@ export class Intersection { | |
|
||
/** | ||
* Checks if line intersects polygon | ||
* | ||
* @todo account for stroke | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
* | ||
* @static | ||
* @param {Point} a1 | ||
* @param {Point} a2 | ||
* @param {Point[]} points | ||
* @see {@link intersectSegmentPolygon} for segment intersection | ||
* @param {Point} a1 point on line | ||
* @param {Point} a2 other point on line | ||
* @param {Point[]} points polygon points | ||
* @param {boolean} [infinite=true] check segment intersection by passing `false` | ||
* @return {Intersection} | ||
*/ | ||
|
@@ -154,10 +158,14 @@ export class Intersection { | |
|
||
/** | ||
* Checks if segment intersects polygon | ||
* | ||
* @todo account for stroke | ||
* | ||
* @static | ||
* @param {Point} a1 | ||
* @param {Point} a2 | ||
* @param {Point[]} points | ||
* @see {@link intersectLinePolygon} for line intersection | ||
* @param {Point} a1 boundary point of segment | ||
* @param {Point} a2 other boundary point of segment | ||
* @param {Point[]} points polygon points | ||
* @return {Intersection} | ||
*/ | ||
static intersectSegmentPolygon(a1, a2, points) { | ||
|
@@ -166,6 +174,9 @@ export class Intersection { | |
|
||
/** | ||
* Checks if polygon intersects another polygon | ||
* | ||
* @todo account for stroke | ||
* | ||
* @static | ||
* @param {Point[]} points1 | ||
* @param {Point[]} points2 | ||
|
@@ -202,9 +213,10 @@ export class Intersection { | |
/** | ||
* Checks if polygon intersects rectangle | ||
* @static | ||
* @param {Point[]} points | ||
* @param {Point} r1 | ||
* @param {Point} r2 | ||
* @see {@link intersectPolygonPolygon} for polygon intersection | ||
* @param {Point[]} points polygon points | ||
* @param {Point} r1 top left point of rect | ||
* @param {Point} r2 bottom right point of rect | ||
* @return {Intersection} | ||
*/ | ||
static intersectPolygonRectangle(points, r1, r2) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added option for infinite line check