helix_extrude


將 2D 圖形沿著柱狀螺旋拉伸。

使用此模組時,要使用座標點來表示 2D 圖形。如果 2D 圖案不是實心的話,必須指定 triangles 參數,詳見 polysections 說明。

相依:helixrotate_pcross_sectionspolysections

參數

  • shape_pts : 代表 2D 圖形的座標點,詳見底下範例。
  • radius : 圓柱半徑。
  • levels : 層數(每轉 360 度算一層)。
  • level_dist : 層高。
  • vt_dir : "SPI_DOWN" 往下盤旋,"SPI_UP" 往上盤旋。預設值是 "SPI_DOWN"
  • rt_dir : "CT_CLK" 逆時針,"CLK" 順時針。預設值為 "CT_CLK"
  • twist : 沿路徑推移時扭轉的角度。
  • scale : 沿路徑推移的縮放,可以單一值或者是 [x, y] 形式。
  • triangles : "SOLID"(預設)、"HOLLOW" 或自定義索引。詳見 polysections 說明。
  • $fa, $fs, $fn : 詳見 cylinder 模組說明。

範例

include <helix.scad>;
include <rotate_p.scad>;
include <cross_sections.scad>;
include <polysections.scad>;
include <helix_extrude.scad>;

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

helix_extrude(shape_pts, 
    radius = 40, 
    levels = 5, 
    level_dist = 10,
    vt_dir = "SPI_UP"
);

helix_extrude

include <helix.scad>;
include <rotate_p.scad>;
include <cross_sections.scad>;
include <polysections.scad>;
include <helix_extrude.scad>;

r1 = 40;
r2 = 20;
levels = 5;
level_dist = 10;

shape_pts = [
    [10, -2],
    [10, 2],
    [9, 2],
    [9, 0],
    [1, 0],
    [1, 2],
    [0, 2],
    [0, -2],
];

helix_extrude(shape_pts, 
    radius = [r1, r2], 
    levels = levels, 
    level_dist = level_dist,
    vt_dir = "SPI_UP"
);

%cylinder(h = levels * level_dist, r1 = r1, r2 = r2);

helix_extrude