使对象边缘变圆的方法 opensCAD

Way to round edges of objects opensCAD

是否有简单的 way/function 为 openscad 对象圆边?

e.g. round the edges of the cylinders

minkowski() 是您对几何体的所有边进行四舍五入的朋友。 minkowski() 也非常慢,应该只用于最终渲染。您还可以使用其他构造更有效地实现具有圆角边缘的图元。

$fn=60;

module drawLedgeRing()
{
    difference()
    {
        cylinder(4,10,10);

        translate([0,0,-1])
        cylinder(4,6,6);

        translate([0,0,2])
        cylinder(4,8,8);
    }
}

minkowski()
{
    drawLedgeRing();
    sphere(.25);
}

//drawLedgeRing();

要使圆柱体变圆,您应该对两个球体使用类似 HULL 命令的命令。

它将制作一个管子,其中每个球体都是管子的盖子,方法是将它们包裹到一个新对象中。

你可以用它来用 minkowski 把你的圆柱体弄圆。

minkowski 在圆柱体和圆管之间。如果将球体与立方体合并,它也会使长管区域变圆并使其怀孕。 Hull 非常有用,例如,您可以执行 100ds 的 hull 命令,而不是对复杂的东西进行挤压。

还要检查 thingiverse 中的斐波那契球体是否有一个有趣的球体,虽然它不是对称的,但在管子上最好。

我今天也需要同样的东西,这里的答案只是半有用的,所以我实现了自己的模块。随意 use/share :)

module roundedcube(xx, yy, height, radius) {

difference(){

    cube([xx,yy,height]);

    difference(){
        translate([-.5,-.5,-.2])
        cube([radius+.5,radius+.5,height+.5]);

        translate([radius,radius,height/2])
        cylinder(height,radius,radius,true);
    }
    translate([xx,0,0])
    rotate(90)
    difference(){
        translate([-.5,-.5,-.2])
        cube([radius+.5,radius+.5,height+.5]);

        translate([radius,radius,height/2])
        cylinder(height,radius,radius,true);
    }

    translate([xx,yy,0])
    rotate(180)
    difference(){
        translate([-.5,-.5,-.2])
        cube([radius+.5,radius+.5,height+.5]);

        translate([radius,radius,height/2])
        cylinder(height,radius,radius,true);
    }

    translate([0,yy,0])
    rotate(270)
    difference(){
        translate([-.5,-.5,-.2])
        cube([radius+.5,radius+.5,height+.5]);

        translate([radius,radius,height/2])
        cylinder(height,radius,radius,true);
    }
}
}

制作圆形圆柱体的方法可能有很多种。一种方法是制作 2 个甜甜圈形状的物体并将它们去壳

hull(){
rotate_extrude() translate([r1,0,0]) circle(r2);
rotate_extrude() translate([r1,0,h1]) circle(r2);
}

我正在寻找一个圆角块来 3d 打印仪器箱。 在阅读了较早的答案后,我调查了船体(不是城镇!:-) 在一个方块的角上制作 8 个相同的球体并将它们去壳看起来不错。

module radiusedblock(xlen,ylen,zlen,radius){
hull(){
translate([radius,radius,radius]) sphere(r=radius);
translate([xlen + radius , radius , radius]) sphere(r=radius);
translate([radius , ylen + radius , radius]) sphere(r=radius);    
translate([xlen + radius , ylen + radius , radius]) sphere(r=radius);
translate([radius , radius , zlen + radius]) sphere(r=radius);
translate([xlen + radius , radius , zlen + radius]) sphere(r=radius);
translate([radius,ylen + radius,zlen + radius]) sphere(r=radius);
translate([xlen + radius,ylen + radius,zlen + radius]) sphere(r=radius);
       }
}
radiusedblock(30,40,50,5);

试试这个圆角的立方体:

    $fn=32;
    border=5;
    minkowski(){
        cube([10,20,5],center=false);
        rotate([90,0,90]) cylinder(h=10,r=border);
        cylinder(h=0.1,r=border);
    }