polyline3d


使用一組 [x, y, z] 座標建立連續多個線段。這個模組相依於 line3d,記得含括 line3d.scad。

參數

  • points : 一組 [x, y, z] 座標點。
  • thickness : 線的粗細。
  • startingStyle : 起點風格。可以設定為 "CAP_BUTT""CAP_CIRCLE""CAP_SPHERE"。預設值為 "CAP_CIRCL"
  • endingStyle : 終點風格。可以設定為 "CAP_BUTT""CAP_CIRCLE""CAP_SPHERE"。預設值為 "CAP_CIRCL"
  • $fa, $fs, $fn : 可用來控制端點的圓或球。詳見 circlesphere 模組說明。為了對齊,實際的邊數或面會計算為四的倍數。

範例

include <line3d.scad>;
include <polyline3d.scad>;

polyline3d(
    points = [
        [1, 2, 1], 
        [-5, -4, 2], 
        [-5, 3, 3], 
        [5, 5, 4]
    ], 
    thickness = 1,
    $fn = 24
);

polyline3d

include <line3d.scad>;
include <polyline3d.scad>;

polyline3d(
    points = [
        [1, 2, 1], 
        [-5, -4, 2], 
        [-5, 3, 3], 
        [5, 5, 4]
    ], 
    thickness = 1,
    endingStyle = "CAP_SPHERE",
    $fn = 24
);

polyline3d

include <line3d.scad>;
include <polyline3d.scad>;

polyline3d(
    points = [
        [1, 2, 1], 
        [-5, -4, 2], 
        [-5, 3, 3], 
        [5, 5, 4]
    ], 
    thickness = 1,
    startingStyle = "CAP_SPHERE",
    endingStyle = "CAP_SPHERE",
    $fn = 24
);

polyline3d

include <line3d.scad>;
include <polyline3d.scad>;

r = 20;
h = 5;
fa = 15;
circles = 10;

points = [
    for(a = [0:fa:360 * circles]) 
        [r * cos(a), r * sin(a), h / (360 / fa) * (a / fa)]
];
polyline3d(points, thickness = 1, $fn = 24);

polyline3d