1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-11 01:04:07 +02:00

update doc

This commit is contained in:
Justin Lin
2020-03-19 16:59:41 +08:00
parent 007f7c618c
commit 2bbb157a46

View File

@@ -2,12 +2,14 @@
Sorts the elements of a list in ascending order. The list is a list-of-list construct, such as `[[a0, a1, a2...], [b0, b1, b2,...], [c0, c1, c2,...],...]`. When sorting, the function looks only at one index position of each sublist. Sorts the elements of a list in ascending order. The list is a list-of-list construct, such as `[[a0, a1, a2...], [b0, b1, b2,...], [c0, c1, c2,...],...]`. When sorting, the function looks only at one index position of each sublist.
From dotSCAD 2.3, when `by` is `"vt"`, it will sort points by zyx (from the last index to the first one).
**Since:** 2.0 **Since:** 2.0
## Parameters ## Parameters
- `lt` : The original list. - `lt` : The original list.
- `by` : Can be `"x"``"y"``"z"`, or `"idx"` (Default). - `by` : Can be `"x"``"y"``"z"`, `"idx"` (Default) or `"vt"`.
- `idx` : When `by` is `"idx"`, the value of `idx` is used. The Default value is 0. - `idx` : When `by` is `"idx"`, the value of `idx` is used. The Default value is 0.
## Examples ## Examples
@@ -27,6 +29,4 @@ Sorts the elements of a list in ascending order. The list is a list-of-list cons
assert( assert(
[[0, 2, 0], [0, 5, 0], [0, 7, 0], [0, 9, 0], [0, 10, 0]] == [[0, 2, 0], [0, 5, 0], [0, 7, 0], [0, 9, 0], [0, 10, 0]] ==
sort([[0, 10, 0], [0, 5, 0], [0, 7, 0], [0, 2, 0], [0, 9, 0]], by = "idx", idx = 1) sort([[0, 10, 0], [0, 5, 0], [0, 7, 0], [0, 2, 0], [0, 9, 0]], by = "idx", idx = 1)
); );