所以,我做了一个棱镜:
width=30
thickness=15
polyhedron(
points=[
[width,0,0],[width,0,thickness],
[width,width,0],[width,width,thickness],
[0,width,0],[0,width,thickness]
],
faces=[
[1,3,5], [0,2,4],[1,0,2,3],[3,5,4,2],[1,5,4,0]
]
);
然后,我删除了一大块:
difference () {
<THAT PRISM>
translate([0,0,thickness-5]) cylinder(r=width-10, h=6);
}
答案 0 :(得分:1)
你的面孔是错误的,请参阅documentation。从外面看时,点的顺序必须是顺时针。这是正确的面孔:
faces=[
//[1,3,5], [0,2,4],[1,0,2,3],[3,5,4,2],[1,5,4,0]
[1,5,3],[0,2,4],[0,1,3,2],[3,5,4,2],[0,4,5,1]
// edit 27.07.2015 order of faces changed
]
编辑27.07.2015:
你的面孔应该在控制台中输出如下:
Top level object is a 3D object:
Simple: no
Vertices: 15
Halfedges: 30
Edges: 15
Halffacets: 4
Facets: 2
Volumes: 1
WARNING: Object may not be a valid 2-manifold and may need repair!
Rendering finished.
&#34;简单:没有&#34;并且警告提示,您的多面体无效。如果对象有效,那么它将是&#34;简单:是&#34;没有任何警告。
答案 1 :(得分:0)
如果多边形不太复杂,有时可以将其包裹在“外壳”中以确保其为“实体”。
保留您的代码,并调整圆柱体的样式和位置,并将多边形包裹在“船体”中,我们得到了:
width = 30;
thickness = 15;
difference() {
hull() {
polyhedron (
points = [
[width, 0, 0], [width, 0, thickness],
[width, width, 0], [width, width, thickness],
[0, width, 0], [0, width, thickness]
],
faces = [
[1,3,5], [0, 2, 4],
[1, 0, 2, 3], [3, 5, 4, 2], [1, 5, 4, 0]
]
);
}
translate([0, 0, thickness - 5]) cylinder(r = width, h = 6);
}
以:: p呈现和预览