1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-16 21:58:26 +01:00
dotSCAD/docs/lib3x-shape_cyclicpolygon.md

57 lines
1.5 KiB
Markdown
Raw Permalink Normal View History

2017-05-15 08:31:54 +08:00
# shape_cyclicpolygon
Returns shape points of a regular cyclic polygon. They can be used with xxx_extrude modules of dotSCAD. The shape points can be also used with the built-in polygon module.
## Parameters
2020-02-25 10:17:57 +08:00
- `sides` : The sides of the circle.
2017-05-15 08:31:54 +08:00
- `circle_r` : The radius of the circumcircle.
2019-05-08 13:57:46 +08:00
- `corner_r` : The radius of the circle at a corner.
2017-05-15 08:31:54 +08:00
- `$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_cyclicpolygon.scad>
2017-05-15 08:31:54 +08:00
circle_r = 10;
corner_r = 3;
$fn = 24;
for(i = [0:2]) {
translate([i * circle_r * 2, 0, 0])
polygon(
shape_cyclicpolygon(
sides = 3 + i,
circle_r = circle_r,
corner_r = corner_r
)
);
}
for(i = [0:2]) {
translate([i * circle_r * 2, -circle_r * 2, 0])
polygon(
shape_cyclicpolygon(
sides = 4 + i,
circle_r = circle_r ,
corner_r = corner_r
)
);
}
2021-02-24 21:09:54 +08:00
![shape_cyclicpolygon](images/lib3x-shape_cyclicpolygon-1.JPG)
2017-05-15 08:31:54 +08:00
2022-06-06 13:11:46 +08:00
use <shape_cyclicpolygon.scad>
use <ring_extrude.scad>
2017-05-15 08:31:54 +08:00
shape_pts = shape_cyclicpolygon(
sides = 5,
circle_r = 10,
corner_r = 3
);
ring_extrude(shape_pts, radius = 20, angle = 180, twist = 90);
2021-02-24 21:09:54 +08:00
![shape_cyclicpolygon](images/lib3x-shape_cyclicpolygon-2.JPG)