我正在尝试在 openscad 中创建一个风扇管道,将管道从圆形展平为椭圆形。有没有办法在openscad中做到这一点?如果没有,是否还有其他编程方式来生成这种类型的 3d 模型?
谢谢
丹尼斯
最佳答案
假设“椭圆”是指椭圆,那么以下内容会创建一个从圆到椭圆的实心渐变:
Delta=0.01;
module connector (height,radius,eccentricity) {
hull() {
linear_extrude(height=Delta)
circle(r=radius);
translate([0,0,height - Delta])
linear_extrude(height=Delta)
scale([1,eccentricity])
circle(r=radius);
}
}
connector(20,6,0.6);
您可以通过减去较小的版本来制作管子:
module tube(height, radius, eccentricity=1, thickness) {
difference() {
connector(height,radius,eccentricity);
translate([0,0,-(Delta+thickness)])
connector(height + 2* (Delta +thickness) ,radius-thickness, eccentricity);
}
}
tube(20,8,0.6,2);
但壁厚不会均匀。要制作统一的墙,请使用 minkowski 添加墙:
module tube(height, radius, eccentricity=1, thickness) {
difference() {
minkowski() {
connector(height,radius,eccentricity);
cylinder(height=height,r=thickness);
}
translate([0,0,-(Delta+thickness)])
connector(height + 2* (Delta +thickness) ,radius, eccentricity);
}
}
tube(20,8,0.6,2);
关于polygon - 在openscad中将圆形变形为椭圆形,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19527948/