From d29ab4eb8a0d23dee3919a00e6eec0bbb5436889 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Mon, 22 Aug 2022 23:38:18 +0800 Subject: [PATCH] check if coplanar --- src/__comm__/__line_intersection.scad | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/__comm__/__line_intersection.scad b/src/__comm__/__line_intersection.scad index 7f3d77d1..0b39d983 100644 --- a/src/__comm__/__line_intersection.scad +++ b/src/__comm__/__line_intersection.scad @@ -31,7 +31,8 @@ function __line_intersection3(line_pts1, line_pts2, ext, epsilon = 0.0001) = b = b2 - b1, c = cross(a, b) ) - norm(c) < epsilon ? [] : // they are parallel or conincident edges + cross(a, b1 - a1) * (b2 - a1) != 0 || // they aren't coplanar + norm(c) < epsilon ? [] : // they are parallel or conincident edges let( t = v_scalar(cross(b1 - a1, b), c), p = a1 + a * t