1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-20 05:21:38 +02:00
This commit is contained in:
Justin Lin
2022-07-02 17:32:01 +08:00
parent 2fab2309fe
commit 10b99289c6
5 changed files with 55 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

26
docs/lib3x-pp_poisson2.md Normal file
View File

@@ -0,0 +1,26 @@
# pp_poisson2
Perform poisson sampling over a rectangle area. An implementation of [Fast Poisson Disk Sampling in Arbitrary Dimensions](https://www.cs.ubc.ca/~rbridson/docs/bridson-siggraph07-poissondisk.pdf).
**Since:** 3.3
## Parameters
- `size` : The size `[x, y]` of the rectangle.
- `r` : The minimum distance between samples.
- `start` : Optional. The first start point.
- `k` : Default to 30. The `k` constant of [Fast Poisson Disk Sampling in Arbitrary Dimensions](https://www.cs.ubc.ca/~rbridson/docs/bridson-siggraph07-poissondisk.pdf).
- `seed` : Optional. Seed value for random number generator for repeatable results.
## Examples
use <pp/pp_poisson2.scad>
use <polyline_join.scad>
points = pp_poisson2([100, 100], 5);
for(p = points) {
translate(p)
circle(1);
}
![pp_poisson2](images/lib3x-pp_poisson2-1.JPG)

26
docs/lib3x-pp_poisson3.md Normal file
View File

@@ -0,0 +1,26 @@
# pp_poisson3
Perform poisson sampling over a cube space. An 3D implementation of [Fast Poisson Disk Sampling in Arbitrary Dimensions](https://www.cs.ubc.ca/~rbridson/docs/bridson-siggraph07-poissondisk.pdf).
**Since:** 3.3
## Parameters
- `size` : The size `[x, y]` of the rectangle.
- `r` : The minimum distance between samples.
- `start` : Optional. The first start point.
- `k` : Default to 30. The `k` constant of [Fast Poisson Disk Sampling in Arbitrary Dimensions](https://www.cs.ubc.ca/~rbridson/docs/bridson-siggraph07-poissondisk.pdf).
- `seed` : Optional. Seed value for random number generator for repeatable results.
## Examples
use <pp/pp_poisson3.scad>
use <polyline_join.scad>
points = pp_poisson3([50, 50, 50], 10);
for(p = points) {
translate(p)
sphere(5, $fn = 48);
}
![pp_poisson3](images/lib3x-pp_poisson3-1.JPG)