2016-11-23 241 views
1

我不確定要搜索什麼或如何提問,因爲我無法繪製。請多多包涵。OpenSCAD:2個圓圈之間的內部彎曲邊緣

如果我有一個帶圓形端蓋的矩形。我想刪除矩形的一些邊緣,這樣就可以四處走動。有點像你是伸展結束,中間變得更薄。

我試圖找出一個更大的外圈的和絃,直到我試圖找出圈子應該碰到的地方爲止。

我可以看到一些三角學的關係,但我的大腦不會走多餘的路。

任何人都可以請幫助指出我在正確的方向。

謝謝。

回答

1

下面是答案:

// Small value for CSG 
Delta = 0.01; 
2Delta = 2 * Delta; 
$fa=1; $fs=$fa; 

module roudedArm(xl=50, yt=10, zh=5, in=2, bh=0.8) { 
    EndRadius = yt/2; // size of outer ends 
    EndSpacing = xl-yt; // distance between end point radii 
    ArmConcavity = in; // how much in does it go in on each side 
    ArmThickness = zh; // height in z 

    // Negative curve to narrow the Arm (calculated by pythagoras) 
    ArmCurveRadius = (pow((EndSpacing/2), 2) - 2 * EndRadius * ArmConcavity + pow(ArmConcavity, 2))/(2 * ArmConcavity); 

    // The orthogonal distance between the middle of the Arm the point it touches the round pillar sections 
    ArmSectionLength = (EndSpacing/2) * ArmCurveRadius/(ArmCurveRadius + EndRadius); 

    // end points 
    lbxcylinder(r=EndRadius, h=ArmThickness); 
    translate([EndSpacing, 0, 0]) lbxcylinder(r=EndRadius, h=ArmThickness); 

    // inner curve 
    difference() 
    { 
     translate([EndSpacing/2 - ArmSectionLength, -EndRadius -ArmThickness, 0]) 
      translate([ArmSectionLength, (EndRadius + ArmThickness),0]) 
       lbxcube([ArmSectionLength * 2, 2 * (EndRadius + ArmThickness), ArmThickness], bh=bh); 

      // Cut out Arm curve 
      translate([EndSpacing/2, ArmCurveRadius + EndRadius - ArmConcavity, -Delta]) 
       lbxcylinder(r = ArmCurveRadius, h = ArmThickness + 2Delta, bh=-bh); 
      translate([EndSpacing/2, -(ArmCurveRadius + EndRadius - ArmConcavity), -Delta]) 
       lbxcylinder(r = ArmCurveRadius, h = ArmThickness + 2Delta, bh=-bh); 
    } 
} 

module lbxcube(size, bh=0.8) { 
    // don't support bevelling in demo 
    translate([-size[0]/2, -size[1]/2, 0]) cube(size); 
} 

module lbxcylinder(r, h, bh=0.8) { 
    // don't support bevelling in demo 
    cylinder(r=r, h=h); 
} 

roudedArm(xl=50, yt=10, zh=5, in=2, bh=0.8); 

由於魯珀特和他Curvy Door Handle在Thingiverse。