polyline2d


使用一組 [x, y] 座標建立連續多個線段。如果端點為 CAP_ROUND,可以使用 $fa$fs$fn 控制端點的圓。這個模組相依於 line2d,記得含括 line2d.scad。

參數

  • points : 一組 [x, y] 座標。
  • width : 線寬。
  • startingStyle : 起點風格。可以設定 "CAP_BUTT""CAP_SQUARE""CAP_ROUND"。預設值為 "CAP_SQUARE"
  • endingStyle : 終點風格。可以設定 "CAP_BUTT""CAP_SQUARE""CAP_ROUND"。預設值為 "CAP_SQUARE"
  • $fa, $fs, $fn : 詳見 circle 模組的說明。為了與邊緣對齊,實際的邊數會計算為四的倍數。

範例

include <line2d.scad>;
include <polyline2d.scad>;

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

polyline2d

include <line2d.scad>;
include <polyline2d.scad>;

$fn = 24;
polyline2d(points = [[1, 2], [-5, -4], [-5, 3], [5, 5]], width = 1,
           endingStyle = "CAP_ROUND");

polyline2d

include <line2d.scad>;
include <polyline2d.scad>;

$fn = 24;
polyline2d(points = [[1, 2], [-5, -4], [-5, 3], [5, 5]], width = 1,
           startingStyle = "CAP_ROUND", endingStyle = "CAP_ROUND");

polyline2d