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

43 lines
1.4 KiB
Markdown
Raw Normal View History

2017-05-09 17:18:09 +08:00
# shape_arc
2017-05-10 16:49:14 +08:00
Returns shape points of an arc 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-09 17:18:09 +08:00
## Parameters
- `radius` : The radius of the circle.
2017-05-22 09:32:22 +08:00
- `angle` : A single value or a 2 element vector which defines the central angle. The first element of the vector is the beginning angle in degrees, and the second element is the ending angle.
2017-05-09 17:18:09 +08:00
- `width_mode` : The default value is `"LINE_CROSS"`. The arc line will move outward by `width / 2` and inward by `width / 2`. If it's `"LINE_OUTWARD"`, The arc line moves outward by `width`. The `"LINE_INWARD"` moves the arc line inward by `width`.
- `$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_arc.scad>
2017-05-09 17:18:09 +08:00
2017-05-22 09:32:22 +08:00
shape_pts = shape_arc(radius = 10, angle = [-90, 90], width = 5);
2017-05-10 16:48:17 +08:00
polygon(shape_pts);
2017-05-09 17:18:09 +08:00
2021-02-24 21:09:54 +08:00
![shape_arc](images/lib3x-shape_arc-1.JPG)
2017-05-09 17:18:09 +08:00
2022-06-06 13:11:46 +08:00
use <shape_arc.scad>
use <path_extrude.scad>
use <bezier_curve.scad>
2017-05-09 17:18:09 +08:00
t_step = 0.05;
width = 2;
2017-05-22 09:32:22 +08:00
shape_pts = shape_arc(radius = 10, angle = [180, 360], width = 5);
2017-05-09 17:18:09 +08:00
p0 = [0, 0, 0];
p1 = [40, 60, 35];
p2 = [-50, 70, 45];
p3 = [20, 150, 55];
p4 = [80, 50, 60];
path_pts = bezier_curve(t_step,
[p0, p1, p2, p3, p4]
);
2017-05-10 16:48:17 +08:00
path_extrude(shape_pts, path_pts);
2017-05-09 17:18:09 +08:00
2021-02-24 21:09:54 +08:00
![shape_arc](images/lib3x-shape_arc-2.JPG)