mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-21 14:04:53 +02:00
refactor
This commit is contained in:
@@ -38,9 +38,3 @@ function hashset_del(set, elem, eq = df_eq, hash = df_hash) =
|
||||
[concat(slice(bucket, 0, i), slice(bucket, i + 1))],
|
||||
slice(set, bidx + 1)
|
||||
);
|
||||
|
||||
function hashset_list(set) = [
|
||||
for(bucket = set)
|
||||
for(elem = bucket)
|
||||
elem
|
||||
];
|
5
src/collection/hashset_list.scad
Normal file
5
src/collection/hashset_list.scad
Normal file
@@ -0,0 +1,5 @@
|
||||
function hashset_list(set) = [
|
||||
for(bucket = set)
|
||||
for(elem = bucket)
|
||||
elem
|
||||
];
|
@@ -12,6 +12,7 @@ use <__comm__/__to2d.scad>;
|
||||
use <__comm__/__to3d.scad>;
|
||||
use <_impl/_vx_bezier_impl.scad>;
|
||||
use <collection/hashset.scad>;
|
||||
use <collection/hashset_list.scad>;
|
||||
|
||||
function vx_bezier(p1, p2, p3, p4) =
|
||||
let(
|
||||
|
@@ -10,6 +10,7 @@
|
||||
|
||||
use <_impl/_vx_circle_impl.scad>;
|
||||
use <collection/hashset.scad>;
|
||||
use <collection/hashset_list.scad>;
|
||||
|
||||
function vx_circle(radius, filled = false) =
|
||||
let(all = _vx_circle_impl(radius, filled))
|
||||
|
@@ -2,6 +2,7 @@ use <../in_shape.scad>;
|
||||
use <../util/sort.scad>;
|
||||
use <vx_polyline.scad>;
|
||||
use <collection/hashset.scad>;
|
||||
use <collection/hashset_list.scad>;
|
||||
|
||||
function vx_polygon(points, filled = false) =
|
||||
let(contour = vx_polyline(concat(points, [points[0]])))
|
||||
|
@@ -9,6 +9,7 @@
|
||||
**/
|
||||
|
||||
use <collection/hashset.scad>;
|
||||
use <collection/hashset_list.scad>;
|
||||
|
||||
function vx_union(points1, points2) =
|
||||
hashset_list(
|
||||
|
@@ -1,5 +1,6 @@
|
||||
use <unittest.scad>;
|
||||
use <collection/hashset.scad>;
|
||||
use <collection/hashset_list.scad>;
|
||||
|
||||
module test_hashset() {
|
||||
echo("==== test_hashset ====");
|
||||
|
Reference in New Issue
Block a user