shape_cyclicpolygon


傳回外接圓正多邊形的座標點,可以與我的 xxx_extrude 或內建的 polygon 模組一同使用。

參數

  • sides : 多邊形邊數。
  • circle_r : 外接圓半徑。
  • $fa, $fs, $fn : 詳見 circle 模組內容。

範例

include <shape_cyclicpolygon.scad>;

circle_r = 10;
corner_r = 3;

$fn = 24;

for(i = [0:2]) {
    translate([i * circle_r * 2, 0, 0]) 
        polygon(
            shape_cyclicpolygon(
                sides = 3 + i, 
                circle_r = circle_r, 
                corner_r = corner_r
            )
        );
}

for(i = [0:2]) {
    translate([i * circle_r * 2, -circle_r * 2, 0]) 
        polygon(
            shape_cyclicpolygon(
                sides = 4 + i, 
                circle_r = circle_r , 
                corner_r = corner_r
            )
        );
}

shape_cyclicpolygon

include <shape_cyclicpolygon.scad>;
include <rotate_p.scad>;
include <cross_sections.scad>;
include <polysections.scad>;
include <ring_extrude.scad>;

shape_pts = shape_cyclicpolygon(
    sides = 5, 
    circle_r = 10, 
    corner_r = 3
);

ring_extrude(shape_pts, radius = 20, angle = 180, twist = 90);

shape_cyclicpolygon