1

我不知道要搜索什么或如何提问,因为我不会画画。请多多包涵。

如果我有一个带有圆形端盖的矩形。我想删除矩形的一些边缘,以便周围有一条平滑的路径。有点像你把两端拉长,中间变薄。

我试图计算出一个更大的外圆的和弦,直到我在试图计算出圆应该接触的位置时卡住了。

我可以看到三角学的一些关系,但我的大脑不会加倍努力。

谁能帮我指出正确的方向。

谢谢。

4

1 回答 1

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);

感谢 Rupert 和他在 Thingiverse 上的弯曲门把手。

于 2016-11-29T12:53:28.893 回答