1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-12 09:44:16 +02:00

update to 3.0

This commit is contained in:
Justin Lin
2021-02-10 15:45:07 +08:00
parent 213d635f36
commit ac452516e8
13 changed files with 18 additions and 21 deletions

View File

@@ -139,12 +139,12 @@ These examples incubate dotSCAD and dotSCAD refactors these examples. See [examp
- [util/every](https://openhome.cc/eGossip/OpenSCAD/lib3x-every.html)
- [util/fibseq](https://openhome.cc/eGossip/OpenSCAD/lib3x-fibseq.html)
- [util/flat](https://openhome.cc/eGossip/OpenSCAD/lib3x-flat.html)
- [util/has](https://openhome.cc/eGossip/OpenSCAD/lib2x-has.html)
- [util/lerp](https://openhome.cc/eGossip/OpenSCAD/lib2x-lerp.html)
- [util/parse_number](https://openhome.cc/eGossip/OpenSCAD/lib2x-parse_number.html)
- [util/rand](https://openhome.cc/eGossip/OpenSCAD/lib2x-rand.html)
- [util/reverse](https://openhome.cc/eGossip/OpenSCAD/lib2x-reverse.html)
- [util/slice](https://openhome.cc/eGossip/OpenSCAD/lib2x-slice.html)
- [util/has](https://openhome.cc/eGossip/OpenSCAD/lib3x-has.html)
- [util/lerp](https://openhome.cc/eGossip/OpenSCAD/lib3x-lerp.html)
- [util/parse_number](https://openhome.cc/eGossip/OpenSCAD/lib3x-parse_number.html)
- [util/rand](https://openhome.cc/eGossip/OpenSCAD/lib3x-rand.html)
- [util/reverse](https://openhome.cc/eGossip/OpenSCAD/lib3x-reverse.html)
- [util/slice](https://openhome.cc/eGossip/OpenSCAD/lib3x-slice.html)
- [util/some](https://openhome.cc/eGossip/OpenSCAD/lib3x-some.html)
- [util/sort](https://openhome.cc/eGossip/OpenSCAD/lib3x-sort.html)
- [util/sub_str](https://openhome.cc/eGossip/OpenSCAD/lib2x-sub_str.html)

View File

@@ -12,5 +12,5 @@ Parses the string argument as an number.
use <util/parse_number.scad>;
echo(parse_number("10") + 1); // ECHO: 11
echo(parse_number("-1.1") + 1); // ECHO: -0.1
assert((parse_number("10") + 1) == 11);
assert((parse_number("-1.1") + 1) == -0.1);

View File

@@ -12,5 +12,5 @@ Reverse a list.
use <util/reverse.scad>;
echo(reverse([1, 2, 3])); // ECHO: [3, 2, 1]
assert(reverse([1, 2, 3]) == [3, 2, 1]);

View File

@@ -14,5 +14,5 @@ Returns a list selected from `begin` to `end`, or to the `end` of the list (`end
use <util/slice.scad>;
echo(slice([for(c = "helloworld") c], 0, 5)); // ECHO: ["h", "e", "l", "l", "o"]
echo(slice([for(c = "helloworld") c], 5)); // ECHO: ["w", "o", "r", "l", "d"]
assert(slice([for(c = "helloworld") c], 0, 5) == ["h", "e", "l", "l", "o"]);
assert(slice([for(c = "helloworld") c], 5) == ["w", "o", "r", "l", "d"]);

View File

@@ -4,7 +4,7 @@
* @copyright Justin Lin, 2020
* @license https://opensource.org/licenses/lgpl-3.0.html
*
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-has.html
* @see https://openhome.cc/eGossip/OpenSCAD/lib3x-has.html
*
**/

View File

@@ -4,13 +4,10 @@
* @copyright Justin Lin, 2020
* @license https://opensource.org/licenses/lgpl-3.0.html
*
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-lerp.html
* @see https://openhome.cc/eGossip/OpenSCAD/lib3x-lerp.html
*
**/
function lerp(v1, v2, amt) =
let(
v = v2 - v1,
leng = len(v1)
)
let(v = v2 - v1, leng = len(v1))
[for(i = 0; i < leng; i = i + 1) v1[i] + v[i] * amt];

View File

@@ -4,7 +4,7 @@
* @copyright Justin Lin, 2017
* @license https://opensource.org/licenses/lgpl-3.0.html
*
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-parse_number.html
* @see https://openhome.cc/eGossip/OpenSCAD/lib3x-parse_number.html
*
**/

View File

@@ -4,7 +4,7 @@
* @copyright Justin Lin, 2019
* @license https://opensource.org/licenses/lgpl-3.0.html
*
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-rand.html
* @see https://openhome.cc/eGossip/OpenSCAD/lib3x-rand.html
*
**/

View File

@@ -4,7 +4,7 @@
* @copyright Justin Lin, 2019
* @license https://opensource.org/licenses/lgpl-3.0.html
*
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-reverse.html
* @see https://openhome.cc/eGossip/OpenSCAD/lib3x-reverse.html
*
**/

View File

@@ -4,7 +4,7 @@
* @copyright Justin Lin, 2019
* @license https://opensource.org/licenses/lgpl-3.0.html
*
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-slice.html
* @see https://openhome.cc/eGossip/OpenSCAD/lib3x-slice.html
*
**/