helix


取得一個繞圓柱轉的螺線路徑上各個點。可以使用 $fa$fs$fn 來控制,作用就跟 cylinder 相同。

參數

  • radius : 圓柱半徑,或者是 [r1, r2]r1 是圓錐底部半徑,r2 是 圓錐頂部半徑。
  • levels : 層數(每轉 360 度算一層)。
  • level_dist : 層高。
  • vt_dir : "SPI_DOWN" 往下盤旋,"SPI_UP" 往上盤旋。預設值是 "SPI_DOWN"
  • rt_dir : "CT_CLK" 逆時針,"CLK" 順時針。預設值為 "CT_CLK"
  • $fa, $fs, $fn : 詳見 cylinder 模組說明。

範例

include <helix.scad>;
include <hull_polyline3d.scad>;

$fn = 12;

points = helix(
    radius = 40, 
    levels = 10, 
    level_dist = 10, 
    vt_dir = "SPI_UP", 
    rt_dir = "CLK"
);

for(p = points) {
    translate(p) sphere(5);
}

hull_polyline3d(points, 2);

helix

include <helix.scad>;
include <hull_polyline3d.scad>;

$fn = 12;

points = helix(
    radius = [40, 20], 
    levels = 10, 
    level_dist = 10, 
    vt_dir = "SPI_UP", 
    rt_dir = "CLK"
);

hull_polyline3d(points, 2);

%cylinder(h = 100, r1 = 40, r2 = 20);

helix