line3d


使用兩點座標建立 3D 線段。

參數

  • p1 : 起點 [x, y, z] 座標。
  • p2 : 終點 [x, y, z] 座標。
  • thickness : 線的粗細。
  • p1Style : 點 p1 的風格。值可以是 "CAP_BUTT""CAP_CIRCLE""CAP_SPHERE"。預設值是 "CAP_CIRCLE"
  • p2Style : 點 p2 的風格。值可以是 "CAP_BUTT""CAP_CIRCLE""CAP_SPHERE"。預設值是 "CAP_CIRCLE"
  • $fa, $fs, $fn : 用來控制端點的圓或球。詳見 circlesphere 說明。為了要對齊邊緣,圓的邊數或球的面數會計算為四的倍數。

範例

include <line3d.scad>;

line3d(
    p1 = [0, 0, 0], 
    p2 = [10, 2, 10], 
    thickness = 1,
    $fn = 24
);   

line3d

include <line3d.scad>;

line3d(
    p1 = [0, 0, 0], 
    p2 = [10, 2, 10], 
    thickness = 1, 
    p1Style = "CAP_BUTT", 
    p2Style = "CAP_BUTT",
    $fn = 24
);   

line3d

include <line3d.scad>;

line3d(
    p1 = [0, 0, 0], 
    p2 = [10, 2, 10], 
    thickness = 1, 
    p1Style = "CAP_SPHERE", 
    p2Style = "CAP_SPHERE",
    $fn = 24
);   

line3d