1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-07-31 20:10:36 +02:00
This commit is contained in:
Justin Lin
2022-04-16 14:16:00 +08:00
parent 17969d9a7a
commit 9ea8812d0f
2 changed files with 19 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ include <test_midpt_smooth.scad>;
include <test_angle_between.scad>;
include <test_contours.scad>;
include <test_in_shape.scad>;
include <test_lines_intersection.scad>;
// Path
include <test_bezier_curve.scad>;

View File

@@ -0,0 +1,18 @@
use <lines_intersection.scad>;
module test_lines_intersection() {
echo("==== test_lines_intersection ====");
line1 = [[0, 0], [0, 10]];
line2 = [[5, 0], [-5, 5]];
line3 = [[5, 0], [2.5, 5]];
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]);
}
test_lines_intersection();