导致解析器错误的原因:模块的语法错误?

问题描述 投票:0回答:1

我正在尝试修复 Open Scad 中 3d 模型以及将较小模块部件放在一起的主模块中的所有错误。 另外,如果问题的显示方式有任何问题,我是使用该网站的新手。 上半场下半场

我尝试浏览所有部分以查找任何错误的内容,但找不到任何内容,并且通过查找也找不到任何内容。

这是代码:

    module tardis()
{

   scale([1.5,1.5,1.5]) translate([-8,-15,0])
    
{//tardis
    color([0,0,.6]) translate([0,40,0]) rotate([0,0,0]) cube([15,15,32.5]);
    color([0,0,.6]) translate([0,40,0]) rotate([0,0,0]) cube([13,13,30.5]);
    color([0,0,.6]) translate([-.5,39,32.5]) rotate([0,0,0]) cube([16,16,1.5]);
    color([0,0,.6]) translate([1,40.5,34]) rotate([0,0,0]) cube([13,13,1.5]);
    {//light
    color([1,.9,0]) translate([7.5,47,35.9]) rotate([0,0,0]) cylinder(1.5,1,1);
    color([0,0,.6]) translate([7.5,47,35.2]) rotate([0,0,0]) cylinder(0.7,1.05,1);
    color([0,0,.6]) translate([7.5,47,37.4]) rotate([0,0,0]) cylinder(0.605,1.05,0);
    color([0,0,.6]) translate([7.5,47,36.3]) rotate([0,0,0]) cylinder(.1,1.05,1.03);
        color([0,0,.6]) translate([7.5,47,36.9]) rotate([0,0,0]) cylinder(.1,1.03,1.03);
        
            
        
        for (i=[1:5])
        {
        color([0,0,.6]) translate([7.5,47,35.2]) rotate([0,0,72*i]) translate([0.95,0,0.7]) cylinder(1.5,.1,.1);
        }
        /*
         color([0,0,.6]) translate([7.5,47,35.2]) rotate([0,0,72]) translate([0.95,0,0.7]) cylinder(1.5,.1,.1);
        color([0,0,.6]) translate([7.5,47,35.2]) rotate([0,0,144]) translate([0.95,0,0.7]) cylinder(1.5,.1,.1);
        color([0,0,.6]) translate([7.5,47,35.2]) rotate([0,0,216]) translate([.95,0,0.7]) cylinder(1.5,.1,.1);
        color([0,0,.6]) translate([7.5,47,35.2]) rotate([0,0,288]) translate([.95,0,0.7]) cylinder(1.5,.1,.1);
        */
        color([0,0,.6]) translate([7.5,47,35.2]) rotate([0,0,35]) translate([.34,-.25,0.7]) cube([.5,.1,1.5]);
        color([0,0,.6]) translate([7.5,47,35.2]) rotate([0,0,35]) translate([.34,.2,0.7]) cube([.5,.1,1.5]);
        color([0,0,.6]) translate([7.5,47,35.2]) rotate([0,0,-35]) translate([.34,-.3,0.7]) cube([.5,.1,1.5]);
        color([0,0,.6]) translate([7.5,47,35.2]) rotate([0,0,-35]) translate([.34,.15,0.7]) cube([.5,.1,1.5]);
        color([0,0,.6]) translate([7.5,47,35.2]) rotate([0,0,-110]) translate([.34,-.25,0.7]) cube([.5,.1,1.5]);
        color([0,0,.6]) translate([7.5,47,35.2]) rotate([0,0,-110]) translate([.34,.2,0.7]) cube([.5,.1,1.5]);
        color([0,0,.6]) translate([7.5,47,35.2]) rotate([0,0,-180]) translate([.34,-.3,0.7]) cube([.5,.1,1.5]);
        color([0,0,.6]) translate([7.5,47,35.2]) rotate([0,0,-180]) translate([.34,.2,0.7]) cube([.5,.1,1.5]);
        color([0,0,.6]) translate([7.5,47,35.2]) rotate([0,0,-250]) translate([.34,-.3,0.7]) cube([.5,.1,1.5]);
        color([0,0,.6]) translate([7.5,47,35.2]) rotate([0,0,-250]) translate([.34,.2,0.7]) cube([.5,.1,1.5]);
    }
    color([0,0,.6]) translate([14.5,38.5,0]) rotate([0,0,0]) cube([2,2,32.5]);
    color([0,0,.6]) translate([-1.5,38.5,0]) rotate([0,0,0]) cube([2,2,32.5]);
    color([0,0,.6]) translate([-1.5,54.5,0]) rotate([0,0,0]) cube([2,2,32.5]);
    color([0,0,.6]) translate([14.5,54.5,0]) rotate([0,0,0]) cube([2,2,32.5]);
    color([0,0,.6]) translate([-2,38,0]) rotate([0,0,0]) cube([19,19,1.5]);
    tardissign();
    rotate([0,0,-90]) translate([-55,-40,0]) tardissign();//frount
    rotate([0,0,-270]) translate([40,-55,0]) tardissign();
    rotate([0,0,180]) translate([-15,-95,0]) tardissign();
    translate([0,-1,0]) tardisfacefrount();
    translate([0,15,0]) tardisface();
    rotate([0,0,-90]) translate([-55,-25,0]) tardisface();
    rotate([0,0,-270]) translate([40,-40,0]) tardisface();
}
}
module syntax-error openscad
1个回答
0
投票

您收到的错误可能取决于 openSCAD 版本。

在 Debian 上,使用版本 2021.01 我只收到警告,因为代码片段中不存在模块,但模型可以使用给定的代码正确呈现。

渲染模型的图像

© www.soinside.com 2019 - 2024. All rights reserved.