OpenSCAD:2个圆圈之间的内部弯曲边缘

时间:2016-11-23 11:54:40

标签: trigonometry openscad

我不知道该搜索什么或如何提出问题,因为我无法画画。请耐心等待。

如果我有一个带圆形端盖的矩形。我想删除矩形的一些边缘,以便在整个圆周上有一条平滑的路径。有点像你一样伸展两端,中间变瘦了。

我试图弄清楚一个更大的外圈的和弦,直到我试图弄清楚圆圈应该碰到的位置。

我可以看到一些关于三角学的关系,但是我的大脑刚刚赢得了额外的努力。

任何人都可以帮助我指出正确的方向。

感谢。

1 个答案:

答案 0 :(得分: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。