【问题标题】:why difference function does not work (openSCAD)?为什么差分功能不起作用(openSCAD)?
【发布时间】:2014-09-13 18:22:44
【问题描述】:

我尝试学习如何使用 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]]);}

【问题讨论】:

    标签: openscad


    【解决方案1】:

    您的顶级对象是 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]]);
    

    }

    【讨论】:

    • 现在可以了。多亏了你,我设法完成了我的项目。多谢兄弟。 :)。
    猜你喜欢
    • 2017-03-24
    • 2023-04-07
    • 2015-10-09
    • 2015-07-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多