2016-11-23 249 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。