1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 06:08:31 +01:00

update doc

This commit is contained in:
Justin Lin 2020-03-19 17:02:07 +08:00
parent 2bbb157a46
commit 013c58f216
2 changed files with 4 additions and 6 deletions

View File

@ -7,7 +7,7 @@ Eliminating duplicate copies of repeating vectors. If `lt` has many elements, so
## Parameters
- `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
@ -33,8 +33,7 @@ Eliminating duplicate copies of repeating vectors. If `lt` has many elements, so
pts1 = px_circle(20, filled = true);
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(sort(concat(pts1, pts2), by = "x"), by = "y");
sorted_pts = sort(concat(pts1, pts2), by = "vt");
// simple union
pts3 = dedup(sorted_pts, sorted = true);

View File

@ -8,7 +8,7 @@ If `lt` contains `elem`, this function returns `true`. If you want to test eleme
- `lt` : A list of vectors.
- `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
@ -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, [0, 0]));
// From dotSCAD 2.3, you can use sort(pts, by = "vt") instead.
sorted_pts = sort(sort(pts, by = "x"), by = "y");
sorted_pts = sort(pts, by = "vt");
assert(has(sorted_pts, [2, -10]));
assert(!has(sorted_pts, [0, 0]));