mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-07-31 03:50:27 +02:00
add docs
This commit is contained in:
@@ -190,8 +190,8 @@ See [examples](examples).
|
||||
- [surface/sf_solidify](https://openhome.cc/eGossip/OpenSCAD/lib2x-sf_solidify.html)
|
||||
|
||||
### Noise (2.3 Preview)
|
||||
- noise/nz_perlin1
|
||||
- noise/nz_perlin1s
|
||||
- [noise/nz_perlin1](https://openhome.cc/eGossip/OpenSCAD/lib2x-nz_perlin1.html)
|
||||
- [noise/nz_perlin1s](https://openhome.cc/eGossip/OpenSCAD/lib2x-nz_perlin1s.html)
|
||||
- noise/nz_perlin2
|
||||
- noise/nz_perlin2s
|
||||
- noise/nz_perlin3
|
||||
|
BIN
docs/images/lib2x-nz_perlin1-1.JPG
Normal file
BIN
docs/images/lib2x-nz_perlin1-1.JPG
Normal file
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
BIN
docs/images/lib2x-nz_perlin1s-1.JPG
Normal file
BIN
docs/images/lib2x-nz_perlin1s-1.JPG
Normal file
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
23
docs/lib2x-nz_perlin1.md
Normal file
23
docs/lib2x-nz_perlin1.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# nz_perlin1
|
||||
|
||||
Returns the 1D [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise) value at the x coordinate.
|
||||
|
||||
**Since:** 2.3
|
||||
|
||||
## Parameters
|
||||
|
||||
- `x` : The x coordinate.
|
||||
- `seed` : The random seed.
|
||||
|
||||
## Examples
|
||||
|
||||
use <hull_polyline2d.scad>;
|
||||
use <util/rand.scad>;
|
||||
use <noise/nz_perlin1.scad>;
|
||||
|
||||
seed = rand();
|
||||
hull_polyline2d(
|
||||
[for(x = [0:.1:10]) [x, nz_perlin1(x, seed)]], width = .1
|
||||
);
|
||||
|
||||

|
23
docs/lib2x-nz_perlin1s.md
Normal file
23
docs/lib2x-nz_perlin1s.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# nz_perlin1s
|
||||
|
||||
Returns 1D [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise) values at x coordinates.
|
||||
|
||||
**Since:** 2.3
|
||||
|
||||
## Parameters
|
||||
|
||||
- `xs` : The x coordinate.
|
||||
- `seed` : The random seed. If it's ignored, a randomized value will be used.
|
||||
|
||||
## Examples
|
||||
|
||||
use <hull_polyline2d.scad>;
|
||||
use <noise/nz_perlin1s.scad>;
|
||||
|
||||
xs = [for(x = [0:.1:10]) x];
|
||||
ys = nz_perlin1s(xs);
|
||||
points = [for(i = [0:len(xs) - 1]) [xs[i], ys[i]]];
|
||||
|
||||
hull_polyline2d(points, width = .1);
|
||||
|
||||

|
@@ -1,4 +1,13 @@
|
||||
use <util/rand.scad>;
|
||||
/**
|
||||
* nz_perlin1.scad
|
||||
*
|
||||
* @copyright Justin Lin, 2020
|
||||
* @license https://opensource.org/licenses/lgpl-3.0.html
|
||||
*
|
||||
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-nz_perlin1.html
|
||||
*
|
||||
**/
|
||||
|
||||
use <noise/_impl/_pnoise1_impl.scad>;
|
||||
|
||||
function nz_perlin1(x, seed) = _pnoise1_impl(x, seed % 256);
|
@@ -1,3 +1,13 @@
|
||||
/**
|
||||
* nz_perlin1s.scad
|
||||
*
|
||||
* @copyright Justin Lin, 2020
|
||||
* @license https://opensource.org/licenses/lgpl-3.0.html
|
||||
*
|
||||
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-nz_perlin1s.html
|
||||
*
|
||||
**/
|
||||
|
||||
use <util/rand.scad>;
|
||||
use <noise/_impl/_pnoise1_impl.scad>;
|
||||
|
||||
|
Reference in New Issue
Block a user