我正在尝试为平版画制作一个框架,我计划在母亲节为我的妻子 3D 打印它。我通常会让我的差异恰好是正确的大小(而不是为了预览而放大它)因为它让我对我的数学有多准确有一个很好的感觉(特别是当我考虑到由从喷嘴出来的压缩长丝)。
然而,在这种情况下,它又回来咬我了。我调试了这个问题很长一段时间,假设我计算错误或者我以某种方式混淆了我的旋转顺序。
最终,我加大了我的切口,果然,孔正确地出现了。在戳它之后,我意识到我只需要0.000005 mm
在我的切口的两侧才能正确渲染!
我在这里创建了我的问题的最小可重现示例:
outerRadius = 100;
height = 40;
wallWidth = 2;
innerRadius = outerRadius - wallWidth / sin(60);
apothem = innerRadius * cos(180 / 6);
// change this to 0 and see what happens!!
holeSizeCorrection = 0.00001;
module holes() {
for (face = [0:5]) {
rotate([0, 0, face * 60 + 30])
translate([apothem - holeSizeCorrection / 2, 0, height / 2])
rotate([0, 90, 0])
cylinder(h = wallWidth + holeSizeCorrection, r = height / 4, $fn = 4);
}
}
color("orange") difference() {
$fn = 6;
cylinder(h = height, r = outerRadius);
translate([0, 0, -height/4]) // because if it's exactly right, you can't see inside
cylinder(h = height * 2, r = innerRadius);
color("blue") holes();
}
当我试图在多边形中切出的孔正好是墙的宽度时,它会正确呈现预览但呈现的输出不正确。为了验证形状是否正确,我将孔从差异中移出,它看起来像这样:
预览(除了通常发生的奇怪的精确切割问题)也是正确的。但是,当我渲染它时,它看起来像这样:
但是,如果我0.000005 mm
在两边都有孔形状,它会呈现得很好!
既然我知道要寻找这种东西,将来可能会节省我的调试时间。:) 但是,很高兴知道我是否也做错了什么。