shape_square


傳回圓角矩形的座標點,可以與我的 xxx_extrude 模組或者內建的 polygon 模組結合使用。

參數

  • size : 可以是單一值,這會建立正方形,也可以是 [x, y],作為矩形的 xy 維度。
  • corner_r : 角落其實是四分之一圓,corner_r 用來決定圓的半徑。
  • center : false (預設) 表示置於第一象限。如果是 true,矩形會置中於原點。
  • $fa, $fs, $fn : 用來控制四個圓角。詳見 circle 說明。為了對齊邊緣,圓的邊數會計算為四的倍數。

範例

include <shape_square.scad>;

polygon(
    shape_square(size = 50, corner_r = 5)
);

shape_square

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

$fn = 36;

shape_pts = shape_square(
    size = [20, 10],
    corner_r = 2
);

ring_extrude(
    shape_pts, 
    radius = 50, angle = 180, twist = 180, scale = 2
);

shape_square