mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-09 00:06:42 +02:00
add px_intersection
This commit is contained in:
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];
|
Reference in New Issue
Block a user