mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-14 02:34:12 +02:00
add doc
This commit is contained in:
@@ -236,7 +236,7 @@ These examples incubate dotSCAD and dotSCAD refactors these examples. See [examp
|
|||||||
### Path
|
### Path
|
||||||
|
|
||||||
- [curve](https://openhome.cc/eGossip/OpenSCAD/lib2x-curve.html)
|
- [curve](https://openhome.cc/eGossip/OpenSCAD/lib2x-curve.html)
|
||||||
- bauer_spiral
|
- [bauer_spiral](https://openhome.cc/eGossip/OpenSCAD/lib2x-bauer_spiral.html)
|
||||||
- fibonacci_lattice
|
- fibonacci_lattice
|
||||||
|
|
||||||
### Voxel
|
### Voxel
|
||||||
|
BIN
docs/images/lib2x-bauer_spiral-1.JPG
Normal file
BIN
docs/images/lib2x-bauer_spiral-1.JPG
Normal file
Binary file not shown.
After Width: | Height: | Size: 62 KiB |
BIN
docs/images/lib2x-bauer_spiral-2.JPG
Normal file
BIN
docs/images/lib2x-bauer_spiral-2.JPG
Normal file
Binary file not shown.
After Width: | Height: | Size: 115 KiB |
33
docs/lib2x-bauer_spiral.md
Normal file
33
docs/lib2x-bauer_spiral.md
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
# bauer_spiral
|
||||||
|
|
||||||
|
Creates visually even spacing of n points on the surface of the sphere. Successive points will all be approximately the same distance apart.
|
||||||
|
|
||||||
|
(It's called "visually even spacing" because only the vertices of the 5 [Platonic solids](https://en.wikipedia.org/wiki/Platonic_solid) can be said to be truly evenly spaced around the surface of a sphere.)
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
- `n` : The number of points.
|
||||||
|
- `radius` : The sphere radius. Default to 1.
|
||||||
|
- `rt_dir` : `"CT_CLK"` for counterclockwise. `"CLK"` for clockwise. The default value is `"CT_CLK"`.
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
use <bauer_spiral.scad>;
|
||||||
|
use <hull_polyline3d.scad>;
|
||||||
|
|
||||||
|
n = 200;
|
||||||
|
radius = 20;
|
||||||
|
pts = bauer_spiral(n, radius);
|
||||||
|
|
||||||
|
for(p = pts) {
|
||||||
|
translate(p)
|
||||||
|
sphere(1, $fn = 24);
|
||||||
|
}
|
||||||
|
|
||||||
|
hull_polyline3d(pts, 1);
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
You can use it to create [Text sphere](https://cults3d.com/en/3d-model/art/bauer-text-sphere).
|
||||||
|
|
||||||
|

|
@@ -1,9 +1,19 @@
|
|||||||
function bauer_spiral(n, radius = 1, dir = "CT_CLK") =
|
/**
|
||||||
|
* bauer_spiral.scad
|
||||||
|
*
|
||||||
|
* @copyright Justin Lin, 2019
|
||||||
|
* @license https://opensource.org/licenses/lgpl-3.0.html
|
||||||
|
*
|
||||||
|
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-bauer_spiral.html
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
|
||||||
|
function bauer_spiral(n, radius = 1, rt_dir = "CT_CLK") =
|
||||||
let(
|
let(
|
||||||
L = sqrt(n * PI),
|
L = sqrt(n * PI),
|
||||||
toRadians = PI / 180,
|
toRadians = PI / 180,
|
||||||
toDegrees = 180 / PI,
|
toDegrees = 180 / PI,
|
||||||
clk = dir == "CT_CLK" ? 1 : -1
|
clk = rt_dir == "CT_CLK" ? 1 : -1
|
||||||
)
|
)
|
||||||
[
|
[
|
||||||
for(k = 1; k <= n; k = k + 1)
|
for(k = 1; k <= n; k = k + 1)
|
||||||
|
Reference in New Issue
Block a user