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:
parent
d7e69dc591
commit
f62513bbd7
11
src/experimental/px_intersection.scad
Normal file
11
src/experimental/px_intersection.scad
Normal 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];
|
Loading…
x
Reference in New Issue
Block a user