1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-30 01:40:02 +02:00

lines_intersection support 3D

This commit is contained in:
Justin Lin
2021-03-04 08:33:00 +08:00
parent 5a4a89a86b
commit 835db1717e
6 changed files with 32 additions and 12 deletions

View File

@@ -6,8 +6,8 @@ Find the intersection of two line segments. Return `[]` if lines don't intersect
## Parameters
- `line1` : Two points of 2D line1.
- `line2` : Two points of 2D line2.
- `line1` : Two points of 2D or 3D line1.
- `line2` : Two points of 2D or 3D line2.
- `ext` : Default to `false`, which doesn't extend a line to an intersection with another line.
- `epsilon` : An upper bound on the relative error due to rounding in floating point arithmetic. Default to 0.0001.
@@ -21,3 +21,7 @@ Find the intersection of two line segments. Return `[]` if lines don't intersect
assert(lines_intersection(line1, line2) == [0, 2.5]);
assert(lines_intersection(line1, line3, ext = true) == [0, 10]);
line4 = [[0, 0, 0], [10, 10, 10]];
line5 = [[10, 0, 0], [0, 10, 10]];
assert(lines_intersection(line4, line5) == [5, 5, 5]);