mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-11 17:24:20 +02:00
updated doc
This commit is contained in:
@@ -56,6 +56,7 @@ Some modules may depend on other modules. For example, the `polyline2d` module d
|
|||||||
- [bezier_curve](https://openhome.cc/eGossip/OpenSCAD/lib-bezier_curve.html)
|
- [bezier_curve](https://openhome.cc/eGossip/OpenSCAD/lib-bezier_curve.html)
|
||||||
- [bezier_surface](https://openhome.cc/eGossip/OpenSCAD/lib-bezier_surface.html)
|
- [bezier_surface](https://openhome.cc/eGossip/OpenSCAD/lib-bezier_surface.html)
|
||||||
- [helix](https://openhome.cc/eGossip/OpenSCAD/lib-helix.html)
|
- [helix](https://openhome.cc/eGossip/OpenSCAD/lib-helix.html)
|
||||||
|
- [golden_spiral](https://openhome.cc/eGossip/OpenSCAD/lib-golden_spiral.html)
|
||||||
- [archimedean_spiral](https://openhome.cc/eGossip/OpenSCAD/lib-archimedean_spiral.html)
|
- [archimedean_spiral](https://openhome.cc/eGossip/OpenSCAD/lib-archimedean_spiral.html)
|
||||||
- [sphere_spiral](https://openhome.cc/eGossip/OpenSCAD/lib-sphere_spiral.html)
|
- [sphere_spiral](https://openhome.cc/eGossip/OpenSCAD/lib-sphere_spiral.html)
|
||||||
|
|
||||||
|
BIN
docs/images/lib-golden_spiral-1.JPG
Normal file
BIN
docs/images/lib-golden_spiral-1.JPG
Normal file
Binary file not shown.
After Width: | Height: | Size: 27 KiB |
BIN
docs/images/lib-golden_spiral-2.JPG
Normal file
BIN
docs/images/lib-golden_spiral-2.JPG
Normal file
Binary file not shown.
After Width: | Height: | Size: 38 KiB |
@@ -4,6 +4,8 @@ Gets all points and angles on the path of a golden spiral. The distance between
|
|||||||
|
|
||||||
It returns a vector of `[[x, y], angle]`.
|
It returns a vector of `[[x, y], angle]`.
|
||||||
|
|
||||||
|
Because of depending on `circle_path` and `rotate_p`, remember to include "circle_path.scad" and "rotate_p.scad".
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
- `from` : The nth Fibonacci number you wanna start from.
|
- `from` : The nth Fibonacci number you wanna start from.
|
||||||
@@ -13,56 +15,38 @@ It returns a vector of `[[x, y], angle]`.
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
include <polyline2d.scad>;
|
include <circle_path.scad>;
|
||||||
include <archimedean_spiral.scad>;
|
include <rotate_p.scad>;
|
||||||
|
include <golden_spiral.scad>;
|
||||||
|
|
||||||
points_angles = archimedean_spiral(
|
pts_angles = golden_spiral(
|
||||||
arm_distance = 10,
|
from = 3,
|
||||||
init_angle = 180,
|
to = 10,
|
||||||
point_distance = 5,
|
point_distance = 1
|
||||||
num_of_points = 100
|
|
||||||
);
|
);
|
||||||
|
|
||||||
points = [for(pa = points_angles) pa[0]];
|
for(pt_angle = pts_angles) {
|
||||||
|
translate(pt_angle[0])
|
||||||
|
sphere(0.5);
|
||||||
|
}
|
||||||
|
|
||||||
polyline2d(points, width = 1);
|

|
||||||
|
|
||||||
|
include <circle_path.scad>;
|
||||||
|
include <rotate_p.scad>;
|
||||||
|
include <golden_spiral.scad>;
|
||||||
|
|
||||||

|
pts_angles = golden_spiral(
|
||||||
|
from = 5,
|
||||||
include <archimedean_spiral.scad>;
|
to = 11,
|
||||||
|
point_distance = 4
|
||||||
points_angles = archimedean_spiral(
|
|
||||||
arm_distance = 10,
|
|
||||||
init_angle = 180,
|
|
||||||
point_distance = 5,
|
|
||||||
num_of_points = 100
|
|
||||||
);
|
);
|
||||||
|
|
||||||
for(pa = points_angles) {
|
for(pt_angle = pts_angles) {
|
||||||
translate(pa[0])
|
translate(pt_angle[0])
|
||||||
circle(2);
|
rotate([90, 0, pt_angle[1]])
|
||||||
|
linear_extrude(1, center = true)
|
||||||
|
text("A", valign = "center", halign = "center");
|
||||||
}
|
}
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
include <archimedean_spiral.scad>;
|
|
||||||
|
|
||||||
t = "3.141592653589793238462643383279502884197169399375105820974944592307816406286";
|
|
||||||
|
|
||||||
points = archimedean_spiral(
|
|
||||||
arm_distance = 15,
|
|
||||||
init_angle = 450,
|
|
||||||
point_distance = 12,
|
|
||||||
num_of_points = len(t)
|
|
||||||
);
|
|
||||||
|
|
||||||
for(i = [0: len(points) - 1]) {
|
|
||||||
translate(points[i][0])
|
|
||||||
rotate(points[i][1] + 90)
|
|
||||||
text(t[i], valign = "center", halign = "center");
|
|
||||||
}
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user