From 4026a206b6550e78a4475135275f94c6cea3a137 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Sat, 22 Feb 2020 09:58:19 +0800 Subject: [PATCH] add intersection_p --- src/experimental/intersection_p.scad | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/experimental/intersection_p.scad diff --git a/src/experimental/intersection_p.scad b/src/experimental/intersection_p.scad new file mode 100644 index 00000000..563a9218 --- /dev/null +++ b/src/experimental/intersection_p.scad @@ -0,0 +1,9 @@ +use <__comm__/__line_intersection.scad>; +use <__comm__/__in_line.scad>; + +function intersection_p(line_pts1, line_pts2, ext = false, epsilon = 0.0001) = + let( + pt = __line_intersection(line_pts1, line_pts2, epsilon) + ) + ext ? pt : + pt != [] && __in_line(line_pts1, pt, epsilon) && __in_line(line_pts2, pt, epsilon) ? pt : []; \ No newline at end of file