2

我尝试学习如何使用 openSCAD。我正在阅读(也在观看)很多教程,但我不明白为什么以下代码不起作用。请你帮助我好吗?

difference() {

     polygon(
             points=[[2,0],[1.6,2.6],[2.2,3.4],[5.6,4],[11.4,3.4],[11.4,0.6],[10,-1.6],[7.6,-2.4],[4.4,-1.8]]);

     polygon(// right len holder in

             points=[[2.4,0],[2,2.6],[2.5,3.1],[5.6,3.6],[11,3],[11,0.6],[9.8,-1.2],[7.6,-2],[4.4,-1.45]]);}
4

1 回答 1

2

您的顶级对象是 2D 对象,使用 linear_extrude 获取 3D 对象:

h = 10;
difference() {
    linear_extrude(height=h) polygon(
         points=[[2,0],[1.6,2.6],[2.2,3.4],[5.6,4],[11.4,3.4],[11.4,0.6],[10,-1.6],[7.6,-2.4],[4.4,-1.8]]);

     linear_extrude(height=h) polygon(// right len holder in

         points=[[2.4,0],[2,2.6],[2.5,3.1],[5.6,3.6],[11,3],[11,0.6],[9.8,-1.2],[7.6,-2],[4.4,-1.45]]);

}

于 2014-09-13T10:22:44.813 回答