mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-09 08:16:50 +02:00
update doc
This commit is contained in:
@@ -7,7 +7,7 @@ Eliminating duplicate copies of repeating vectors. If `lt` has many elements, so
|
|||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
- `lt` : A list of vectors.
|
- `lt` : A list of vectors.
|
||||||
- `sorted` : If `false` (default), use native `search`. If `true`, `lt` must be sorted by zyx (from the last idx to first) and `dedup` will use binary search internally.
|
- `sorted` : If `false` (default), use native `search`. If `true`, `lt` must be sorted by zyx (from the last index to the first one) and `dedup` will use binary search internally.
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
@@ -33,8 +33,7 @@ Eliminating duplicate copies of repeating vectors. If `lt` has many elements, so
|
|||||||
pts1 = px_circle(20, filled = true);
|
pts1 = px_circle(20, filled = true);
|
||||||
pts2 = [for(p = px_circle(10, filled = true)) p + [20, 0]];
|
pts2 = [for(p = px_circle(10, filled = true)) p + [20, 0]];
|
||||||
|
|
||||||
// From dotSCAD 2.3, you can use sort(concat(pts1, pts2), by = "vt") instead.
|
sorted_pts = sort(concat(pts1, pts2), by = "vt");
|
||||||
sorted_pts = sort(sort(concat(pts1, pts2), by = "x"), by = "y");
|
|
||||||
|
|
||||||
// simple union
|
// simple union
|
||||||
pts3 = dedup(sorted_pts, sorted = true);
|
pts3 = dedup(sorted_pts, sorted = true);
|
||||||
|
@@ -8,7 +8,7 @@ If `lt` contains `elem`, this function returns `true`. If you want to test eleme
|
|||||||
|
|
||||||
- `lt` : A list of vectors.
|
- `lt` : A list of vectors.
|
||||||
- `elem` : A vector.
|
- `elem` : A vector.
|
||||||
- `sorted` : If `false` (default), use native `search`. If `true`, `lt` must be sorted by zyx (from the last idx to first) and `has` will use binary search internally.
|
- `sorted` : If `false` (default), use native `search`. If `true`, `lt` must be sorted by zyx (from the last index to the first one) and `has` will use binary search internally.
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
@@ -20,7 +20,6 @@ If `lt` contains `elem`, this function returns `true`. If you want to test eleme
|
|||||||
assert(has(pts, [2, -10]));
|
assert(has(pts, [2, -10]));
|
||||||
assert(!has(pts, [0, 0]));
|
assert(!has(pts, [0, 0]));
|
||||||
|
|
||||||
// From dotSCAD 2.3, you can use sort(pts, by = "vt") instead.
|
sorted_pts = sort(pts, by = "vt");
|
||||||
sorted_pts = sort(sort(pts, by = "x"), by = "y");
|
|
||||||
assert(has(sorted_pts, [2, -10]));
|
assert(has(sorted_pts, [2, -10]));
|
||||||
assert(!has(sorted_pts, [0, 0]));
|
assert(!has(sorted_pts, [0, 0]));
|
Reference in New Issue
Block a user