傳回等腰梯形的座標點,可以與我的 xxx_extrude
模組或者是內建的 polygon
結合使用。
參數
length
: 等腰梯形的底長度,或者是[a, b]
形式,a
為下底,b
為上底。h
: 梯形的高。corner_r
: 圓角的半徑。$fa
,$fs
,$fn
: 用來控制圓角,詳見 circle 模組說明。
範例
include <shape_trapezium.scad>;
polygon(
shape_trapezium([40, 20],
h = 20,
corner_r = 2)
);
include <shape_trapezium.scad>;
include <rotate_p.scad>;
include <polysections.scad>;
include <path_extrude.scad>;
include <bezier_curve.scad>;
t_step = 0.05;
width = 2;
shape_pts = shape_trapezium(
[40, 20],
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);