2022-06-19 11:47:54 +08:00
|
|
|
# pp_sphere
|
2022-06-14 08:56:43 +08:00
|
|
|
|
|
|
|
Pick random points on the surface of a sphere.
|
|
|
|
|
|
|
|
**Since:** 3.3
|
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
|
|
|
- `radius` : The radius of the sphere.
|
|
|
|
- `value_count` : Number of random numbers to return as a vector.
|
2022-07-02 16:50:28 +08:00
|
|
|
- `seed` : Optional. Seed value for random number generator for repeatable results.
|
2022-06-14 08:56:43 +08:00
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
2022-06-19 11:47:54 +08:00
|
|
|
use <pp/pp_sphere.scad>
|
2022-06-14 08:56:43 +08:00
|
|
|
|
|
|
|
number = 1000;
|
|
|
|
radius = 2;
|
|
|
|
|
2022-06-19 11:47:54 +08:00
|
|
|
points = pp_sphere(radius, number);
|
2022-06-14 08:56:43 +08:00
|
|
|
|
|
|
|
|
|
|
|
for(p = points) {
|
|
|
|
translate(p)
|
|
|
|
sphere(.05);
|
|
|
|
}
|
|
|
|
|
|
|
|
%sphere(radius, $fn = 48);
|
|
|
|
|
2022-06-19 11:47:54 +08:00
|
|
|
![rands_sphere](images/lib3x-pp_sphere-1.JPG)
|