paths2sections


給定一組路徑清單,這個函式可以傳回這組路徑描述的切面資訊。與 polysections 模組結合的話,就可以用來描述比較複雜的曲面模型。

路徑在編索引時,必須是逆時針方向。

參數

  • paths : 描述模型表面的路徑清單。

範例

include <paths2sections.scad>;
include <hull_polyline3d.scad>;
include <polysections.scad>;

paths = [
    [[5, 0, 5], [15, 10, 10], [25, 20, 5]],
    [[-5, 0, 5], [-15, 10, 10], [-25, 20, 5]],
    [[-5, 0, -5], [-15, 10, -10], [-25, 20, -5]],  
    [[5, 0, -5], [15, 10, -10], [25, 20, -5]]
];

sections = paths2sections(paths);

polysections(sections);

#for(path = paths) {
    hull_polyline3d(path, 0.5);
}

paths2sections

include <bezier_curve.scad>;
include <paths2sections.scad>;
include <hull_polyline3d.scad>;
include <polysections.scad>;

t_step = 0.05;

paths = [
    bezier_curve(t_step, 
        [[1.25, 0, 5], [5, 20, 5], [16, 20, -2], [18, 20, 10], [30, 15, 8]]
    ),
    bezier_curve(t_step, 
        [[-1.25, 0, 5], [0, 20, 5],  [16, 22, -2], [18, 20, 10], [30, 25, 8]]
    ),
    bezier_curve(t_step, 
        [[-1.25, 0, -5], [0, 20, -5], [16, 20, 1], [18, 27, -3], [20, 27, -5]]
    ),
    bezier_curve(t_step, 
        [[1.25, 0, -5], [5, 20, -5], [16, 20, 1], [18, 17.5, -3], [20, 17.5, -5]]
    )
];


sections = paths2sections(paths);

polysections(sections);

#for(path = paths) {
    hull_polyline3d(path, 0.5);
}

paths2sections