1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 22:28:16 +01:00
dotSCAD/docs/lib3x-shape_square.md

37 lines
1.1 KiB
Markdown
Raw Normal View History

2017-05-06 15:41:25 +08:00
# shape_square
2017-05-10 16:54:20 +08:00
Returns shape points of a rounded square or rectangle. 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-06 15:41:25 +08:00
## Parameters
- `size` : Accepts single value, square with both sides this length. It also accepts 2 value array `[x, y]`, rectangle with dimensions `x` and `y`.
- `corner_r` : The corner is one-quarter of a circle (quadrant). The `corner_r` parameter determines the circle radius.
- `$fa`, `$fs`, `$fn` : Used to control the four quadrants. Check [the circle module](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_the_2D_Subsystem#circle) for more details. The final fragments of a circle will be a multiple of 4 to fit edges.
## Examples
2022-06-06 13:11:46 +08:00
use <shape_square.scad>
2017-05-06 15:41:25 +08:00
polygon(
2017-05-10 16:54:20 +08:00
shape_square(size = 50, corner_r = 5)
2017-05-06 15:41:25 +08:00
);
2021-02-24 21:09:54 +08:00
![shape_square](images/lib3x-shape_square-1.JPG)
2017-05-06 15:41:25 +08:00
2022-06-06 13:11:46 +08:00
use <shape_square.scad>
use <ring_extrude.scad>
2017-05-06 15:41:25 +08:00
$fn = 36;
2017-05-10 16:54:20 +08:00
shape_pts = shape_square(
2017-05-06 15:41:25 +08:00
size = [20, 10],
corner_r = 2
);
ring_extrude(
2017-05-10 16:54:20 +08:00
shape_pts,
radius = 50, angle = 180, twist = 180, scale = 2
2017-05-06 15:41:25 +08:00
);
2021-02-24 21:09:54 +08:00
![shape_square](images/lib3x-shape_square-2.JPG)