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

49 lines
1.2 KiB
Markdown
Raw Normal View History

2017-05-14 13:38:24 +08:00
# shape_trapezium
Returns shape points of an isosceles trapezoid. They can be used with xxx_extrude modules of dotSCAD. The shape points can be also used with the built-in polygon module.
## Parameters
- `length` : The base length of an isosceles trapezium. It also accepts a vector `[a, b]`. `a` is the bottom base and `b` is the top base.
2017-06-01 16:51:56 +08:00
- `h` : The height of the isosceles trapezium.
2017-05-14 13:38:24 +08:00
- `corner_r` : The circle radius which fits the edges of the bottom and the top.
- `$fa`, `$fs`, `$fn` : Used to control the corner fragments. Check [the circle module](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_the_2D_Subsystem#circle) for more details.
## Examples
2020-01-28 17:51:20 +08:00
use <shape_trapezium.scad>;
2017-05-14 13:38:24 +08:00
polygon(
2017-05-14 13:52:48 +08:00
shape_trapezium([40, 20],
2017-05-14 13:38:24 +08:00
h = 20,
corner_r = 2)
);
2021-02-24 21:09:54 +08:00
![shape_trapezium](images/lib3x-shape_trapezium-1.JPG)
2017-05-14 13:38:24 +08:00
2020-01-28 17:51:20 +08:00
use <shape_trapezium.scad>;
use <path_extrude.scad>;
use <bezier_curve.scad>;
2017-05-14 13:38:24 +08:00
t_step = 0.05;
width = 2;
shape_pts = shape_trapezium(
2017-05-14 13:52:48 +08:00
[40, 20],
2017-05-14 13:38:24 +08:00
h = 20,
corner_r = 2
);
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]
);
path_extrude(shape_pts, path_pts);
2021-02-24 21:09:54 +08:00
![shape_trapezium](images/lib3x-shape_trapezium-2.JPG)