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

31 lines
873 B
Markdown
Raw Normal View History

2020-03-23 16:49:50 +08:00
# shape_circle
Sometimes you need all points on the path of a circle. Here's the function. Its `$fa`, `$fs` and `$fn` parameters are consistent with the `circle` module.
2020-03-23 17:23:33 +08:00
**Since:** 2.3
2020-03-23 16:54:48 +08:00
2020-03-23 16:49:50 +08:00
## Parameters
- `radius` : The radius of the circle.
- `n` : The number of points you want. It's not greater than the fragments of the circle.
- `$fa`, `$fs`, `$fn` : Check [the circle module](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_the_2D_Subsystem#circle) for more details.
## Examples
2022-06-06 13:11:46 +08:00
use <shape_circle.scad>
2020-03-23 16:49:50 +08:00
$fn = 24;
points = shape_circle(radius = 50);
polygon(points);
leng = len(points);
step_angle = 360 / leng;
for(i = [0:leng - 1]) {
translate(points[i])
2022-04-06 17:44:11 +08:00
rotate([90, 0, 90 + i * step_angle])
linear_extrude(1, center = true)
text("A", valign = "center", halign = "center");
2020-03-23 16:49:50 +08:00
}
2021-02-24 21:09:54 +08:00
![shape_circle](images/lib3x-circle_path-1.JPG)