1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 14:18:13 +01:00
dotSCAD/docs/lib3x-shape_superformula.md

64 lines
1.7 KiB
Markdown
Raw Normal View History

2017-05-10 13:23:57 +08:00
# shape_superformula
2017-05-10 16:59:41 +08:00
Returns shape points of a [Superformula](https://en.wikipedia.org/wiki/Superformula) shape. They can be used with xxx_extrude modules of dotSCAD. The shape points can be also used with the built-in polygon module.
2017-05-10 13:23:57 +08:00
## Parameters
2017-06-02 09:21:14 +08:00
- `phi_step` : The phi step of Superformula.
2017-05-10 13:23:57 +08:00
- `m1`, `m2`, `n1`, `n2`, `n3`, `a`, `b` : The parameters of [Superformula](https://en.wikipedia.org/wiki/Superformula). The default value of `n2`, `n3`, `a`, and `b` is 1.
## Examples
2022-06-06 13:11:46 +08:00
use <shape_superformula.scad>
2017-05-10 13:23:57 +08:00
phi_step = 0.05;
2017-05-10 16:59:41 +08:00
polygon(shape_superformula(phi_step, 3, 3, 4.5, 10, 10));
2022-04-06 17:44:11 +08:00
2017-05-10 13:23:57 +08:00
translate([3, 0])
2017-05-10 16:59:41 +08:00
polygon(shape_superformula(phi_step, 4, 4, 12, 15, 15));
2022-04-06 17:44:11 +08:00
2017-05-10 13:23:57 +08:00
translate([6, 0])
2017-05-10 16:59:41 +08:00
polygon(shape_superformula(phi_step, 7, 7, 10, 6, 6));
2022-04-06 17:44:11 +08:00
2017-05-10 13:23:57 +08:00
translate([9, 0])
2017-05-10 16:59:41 +08:00
polygon(shape_superformula(phi_step, 5, 5, 4, 4, 4));
2017-05-10 13:23:57 +08:00
translate([0, -4])
2022-04-06 17:44:11 +08:00
scale(0.8)
polygon(shape_superformula(phi_step, 5, 5, 2, 7, 7));
2017-05-10 13:23:57 +08:00
translate([3, -4])
2022-04-06 17:44:11 +08:00
scale(0.25)
polygon(shape_superformula(phi_step, 5, 5, 2, 13, 13));
2017-05-10 13:23:57 +08:00
translate([6, -4])
2017-05-10 16:59:41 +08:00
polygon(shape_superformula(phi_step, 4, 4, 1, 1, 1));
2022-04-06 17:44:11 +08:00
2017-05-10 13:23:57 +08:00
translate([9, -4])
2022-04-06 17:44:11 +08:00
scale(0.3)
polygon(shape_superformula(phi_step, 4, 4, 1, 7, 8));
2017-05-10 13:23:57 +08:00
2021-02-24 21:09:54 +08:00
![shape_superformula](images/lib3x-shape_superformula-1.JPG)
2017-05-10 13:23:57 +08:00
2022-06-06 13:11:46 +08:00
use <shape_superformula.scad>
use <golden_spiral_extrude.scad>
2017-05-10 13:23:57 +08:00
phi_step = 0.05;
m = 16;
n = 0.5;
n3 = 16;
2017-05-10 16:59:41 +08:00
shape_pts = shape_superformula(phi_step, m, m, n, n, n3);
2017-05-10 13:23:57 +08:00
golden_spiral_extrude(
2017-05-10 16:59:41 +08:00
shape_pts,
2017-05-10 13:23:57 +08:00
from = 5,
to = 10,
point_distance = 2,
2017-05-10 16:59:41 +08:00
scale = 10
2017-05-10 13:23:57 +08:00
);
2021-02-24 21:09:54 +08:00
![shape_superformula](images/lib3x-shape_superformula-2.JPG)