# path_extrude

## 參數

• `shape_pts` : 代表 2D 圖形的座標點，詳見底下範例。
• `path_pts` : 代表路徑的座標點。
• `triangles` : `"SOLID"`（預設）、`"HOLLOW"` 或自定義索引。詳見底下範例。
• `twist` : 沿路徑推移時扭轉的角度。
• `scale` : 沿路徑推移的縮放，可以單一值或者是 `[x, y]` 形式。
• `closed` : 如果路徑的第一個點與最後一個點重合，將 `closed` 設為 `true` 可以自動閉合。

## 範例

``````include <rotate_p.scad>;
include <polysections.scad>;
include <path_extrude.scad>;
include <bezier_curve.scad>;

t_step = 0.05;
width = 2;

p0 = [0, 0, 0];
p1 = [40, 60, 35];
p2 = [-50, 70, 0];
p3 = [20, 150, -35];
p4 = [30, 50, -3];

shape_pts = [
[5, -5],
[3, 4],
[0, 5],
[-5, -5]
];

path_pts = bezier_curve(t_step,
[p0, p1, p2, p3, p4]
);

path_extrude(shape_pts, path_pts);
``````

``````include <rotate_p.scad>;
include <polysections.scad>;
include <path_extrude.scad>;
include <bezier_curve.scad>;

t_step = 0.05;

p0 = [0, 0, 0];
p1 = [40, 60, 35];
p2 = [-50, 70, 0];
p3 = [20, 150, -35];
p4 = [30, 50, -3];

shape_pts = [
// 外輪廓
[5, 0],
[3, 9],
[0, 10],
[-5, 0],
// 內輪廓
[3, 2],
[2, 7],
[0, 7],
[-3, 2]
];

path_pts = bezier_curve(t_step,
[p0, p1, p2, p3, p4]
);

path_extrude(shape_pts, path_pts, triangles = "HOLLOW");
``````

``````include <rotate_p.scad>;
include <polysections.scad>;
include <path_extrude.scad>;
include <bezier_curve.scad>;

t_step = 0.05;

p0 = [0, 0, 0];
p1 = [40, 60, 35];
p2 = [-50, 70, 0];
p3 = [20, 150, -5];
p4 = [50, 50, -3];

shape_pts = [
// 外輪廓
[10, 0],
[-5, 10],
[-10, 0],
// 內輪廓
[7, 1],
[-4, 8],
[-7, 1]
];

path_pts = bezier_curve(t_step,
[p0, p1, p2, p3, p4]
);

path_extrude(
shape_pts,
path_pts,
triangles = [
[0, 4, 3],
[0, 1, 4],
[1, 5, 4],
[1, 2, 5],
[2, 3, 5],
[2, 0, 3]
]
);
``````