如何在OpenSCAD中制作弯曲的图纸(立方体)?

R O*_*OMS 4 curve openscad

如何弯曲图纸(立方体)?我想控制弯曲/曲线的角度。

曲线

例如

立方([50,50,2]);

a_m*_*_67 5

您可以rotate_extrude()使用参数angle的矩形。这需要opencad版本2016.xx或更高版本,请参阅文档。有必要安装开发快照,请参见下载openscad

$fn= 360;

width = 10;   // width of rectangle
height = 2;   // height of rectangle
r = 50;       // radius of the curve
a = 30;       // angle of the curve

rotate_extrude(angle = a) translate([r, 0, 0]) square(size = [height, width], center = true);
Run Code Online (Sandbox Code Playgroud)

看起来像这样:

在此处输入图片说明

曲线由半径和角度定义。我认为在此草图中使用长度或dh等其他尺寸更为现实

在此处输入图片说明

并计算半径和角度

$fn= 360;

w = 10;       // width of rectangle
h = 2;       // height of rectangle
l = 25;      // length of chord of the curve
dh = 2;           // delta height of the curve

module curve(width, height, length, dh) {
    // calculate radius and angle
    r = ((length/2)*(length/2) - dh*dh)/(2*dh);
    a = asin((length/2)/r);
    rotate_extrude(angle = a) translate([r, 0, 0]) square(size = [height, width], center = true);
}

curve(w, h, l, dh);
Run Code Online (Sandbox Code Playgroud)

编辑30.09.2019:考虑Cfreitas的评论,另外将结果形状移至原点,以便可以在坐标轴上看到尺寸

$fn= 360;

w = 10;       // width of rectangle
h = 2;       // height of rectangle
l = 30;      // length of chord of the curve
dh = 4;           // delta height of the curve

module curve(width, height, length, dh) {
    r = (pow(length/2, 2) + pow(dh, 2))/(2*dh);
    a = 2*asin((length/2)/r);
    translate([-(r -dh), 0, -w/2]) rotate([0, 0, -a/2])         rotate_extrude(angle = a) translate([r, 0, 0]) square(size = [height, width], center = true);
}

curve(w, h, l, dh);
Run Code Online (Sandbox Code Playgroud)

结果:

在此处输入图片说明