我试图在openscad中创建一个风扇管道,将管道从圆形变为椭圆形。在openscad中有办法做到这一点吗?如果没有,是否有任何其他编程方法来生成这种类型的3d模型?
谢谢丹尼斯
发布于 2014-01-24 15:21:12
假设“椭圆”指的是“启示录”,那么下面的内容将创建一个从圆圈到椭圆的实体渐变:
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);发布于 2014-07-13 15:02:14
还有一种方法是使用-parameter of linear_extrude()的“比例”。它“用这个值在挤压的高度上缩放2D形状。尺度可以是标量,也可以是向量“(文件)”。使用带有x和y标度因子的向量,得到修改后,您需要:
d = 2; // height of ellipsoid, diameter of bottom circle
t = 0.25; // wall thickness
w = 4; // width of ellipsoid
l = 10; // length of extrusion
module ellipsoid(diameter, width, height) {
linear_extrude(height = height, scale = [width/diameter,1]) circle(d = diameter);
}
difference() {
ellipsoid(d,w,l);
ellipsoid(d-2*t,w-2*t,l);
}发布于 2021-06-01 07:22:09
我喜欢克里斯华莱士的答案,但在明考斯基有一个错误,应该是h=Delta。
module tube(height, radius, eccentricity=1, thickness) {
difference() {
minkowski() {
connector(height,radius,eccentricity);
cylinder(h=Delta,r=thickness);
}
translate([0,0,-(Delta+thickness)])
connector(height + 2* (Delta +thickness) ,radius, eccentricity);
}
}
tube(20,8,0.6,2);https://stackoverflow.com/questions/19527948
复制相似问题