mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-11 17:24:20 +02:00
we don't have to mod nums_of_buckets
This commit is contained in:
@@ -1,2 +1 @@
|
|||||||
function _pt3_hash(number_of_buckets) =
|
function _pt3_hash(p) = floor(abs(p * [73856093, 19349669, 83492791]));
|
||||||
function(p) floor(abs(p * [73856093, 19349669, 83492791])) % number_of_buckets;
|
|
@@ -21,7 +21,7 @@ function _geom_icosahedron(icosahedron_points, icosahedron_faces, tris, radius,
|
|||||||
each [for(t = tri_subdivide(tri, detail)) each t]
|
each [for(t = tri_subdivide(tri, detail)) each t]
|
||||||
],
|
],
|
||||||
number_of_buckets = ceil(sqrt(len(points)) * 1.5),
|
number_of_buckets = ceil(sqrt(len(points)) * 1.5),
|
||||||
hash = _pt3_hash(number_of_buckets),
|
hash = function(p) _pt3_hash(p),
|
||||||
leng = len(points),
|
leng = len(points),
|
||||||
m_pts = _pimap_pts(
|
m_pts = _pimap_pts(
|
||||||
radius,
|
radius,
|
||||||
|
@@ -12,9 +12,4 @@ use <../__comm__/_pt3_hash.scad>;
|
|||||||
use <../util/dedup.scad>;
|
use <../util/dedup.scad>;
|
||||||
|
|
||||||
function vx_union(points1, points2) =
|
function vx_union(points1, points2) =
|
||||||
let(
|
dedup(concat(points1, points2), hash = function(p) _pt3_hash(p));
|
||||||
pts = concat(points1, points2),
|
|
||||||
number_of_buckets = ceil(sqrt(len(pts))),
|
|
||||||
hash = _pt3_hash(number_of_buckets)
|
|
||||||
)
|
|
||||||
dedup(pts, hash = hash, number_of_buckets = number_of_buckets);
|
|
Reference in New Issue
Block a user