shape_glued2circles


傳回兩個膠合圓的座標點,可以與我的 xxx_extrude 或者是內建的 polygon 模組結合使用。

相依:rotate_p, bezier_curve, shape_pie.

參數

  • radius : 兩個圓的半徑。
  • centre_dist : 兩個圓的中心點距離。
  • tangent_angle : 切線角,預設為 30 度,詳見底下範例。
  • t_step : 預設為 0.1。詳見 bezier_curve 說明。
  • $fa, $fs, $fn : 說見 circle 模組說明。

範例

include <rotate_p.scad>;
include <bezier_curve.scad>;
include <shape_pie.scad>;
include <shape_glued2circles.scad>;

$fn = 36;

radius = 10;
centre_dist = 30;

shape_pts = shape_glued2circles(radius, centre_dist);
polygon(shape_pts); 

shape_glued2circles

include <rotate_p.scad>;
include <bezier_curve.scad>;
include <shape_pie.scad>;
include <shape_glued2circles.scad>;

$fn = 36;

radius = 10;
centre_dist = 30;

shape_pts = shape_glued2circles(radius, centre_dist);
width = centre_dist / 2 + radius;

rotate_extrude() difference() {    
    polygon(shape_pts);    

    translate([-width, -radius]) 
        square([width, radius * 2]);
}

shape_glued2circles

include <rotate_p.scad>;
include <bezier_curve.scad>;
include <shape_pie.scad>;
include <shape_glued2circles.scad>;

$fn = 36;

radius = 10;
centre_dist = 30;

shape_pts = shape_glued2circles(radius, centre_dist);
width = centre_dist + radius * 2;

rotate_extrude() 
    intersection() { 
        rotate(-90) polygon(shape_pts);    

        translate([radius / 2, 0]) 
            square([radius, width], center = true);
    }

shape_glued2circles