1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-04-22 15:12:01 +02:00

add px_intersection

This commit is contained in:
Justin Lin 2020-03-14 17:00:00 +08:00
parent d7e69dc591
commit f62513bbd7

View File

@ -0,0 +1,11 @@
use <util/sort.scad>;
use <util/has.scad>;
function px_intersection(points1, points2) =
let(
leng1 = len(points1),
leng2 = len(points2),
pts_pair = leng1 > leng2 ? [points1, points2] : [points2, points1],
sorted = sort(pts_pair[1], by = "vt")
)
[for(p = pts_pair[0]) if(has(sorted, p, sorted = true)) p];