1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-16 13:50:05 +01:00

check if coplanar

This commit is contained in:
Justin Lin 2022-08-22 23:38:18 +08:00
parent 824168a006
commit d29ab4eb8a

View File

@ -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