2017-04-08 06:48:36 +08:00
# bezier_curve
2017-03-22 10:47:09 +08:00
2017-04-26 17:24:47 +08:00
Given a set of control points, the `bezier_curve` function returns points of the Bézier path. Combined with the `polyline` , `polyline3d` or `hull_polyline3d` module defined in my library, you can create a Bézier curve.
2017-03-22 10:47:09 +08:00
## Parameters
- `t_step` : The distance between two points of the Bézier path.
2019-07-28 18:24:48 +08:00
- `points` : A list of `[x, y]` or `[x, y, z]` control points.
2017-03-22 10:47:09 +08:00
## Examples
If you have four control points and combine with the `hull_polyline3d` module:
2020-01-28 17:51:20 +08:00
use < hull_polyline3d.scad > ;
use < bezier_curve.scad > ;
2017-03-30 14:22:48 +08:00
2017-03-22 10:47:09 +08:00
t_step = 0.05;
width = 2;
p0 = [0, 0, 0];
p1 = [40, 60, 35];
p2 = [-50, 90, 0];
p3 = [0, 200, -35];
2017-04-08 06:48:36 +08:00
points = bezier_curve(t_step,
2017-03-22 10:47:09 +08:00
[p0, p1, p2, p3]
);
hull_polyline3d(points, width);
2020-03-30 20:13:47 +08:00
