mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-07-31 20:10:36 +02:00
add test
This commit is contained in:
@@ -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>;
|
||||
|
18
test/test_lines_intersection.scad
Normal file
18
test/test_lines_intersection.scad
Normal 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();
|
Reference in New Issue
Block a user