discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

simple syntax error

J
jon
Mon, Dec 7, 2020 2:07 PM

I can't see the problem.  I'm trying to use a boolean to control which
pair of STL files I import, but neither the ? nor the if conditionals
are accepted.  What am I missing?  I keep getting this:

Parsing design (AST generation)...

Saved backup file: C:/Users/jon/Documents/OpenSCAD/backups/Hollow Face
Array for CNC 2-backup-PJfjlBZf.scad

ERROR: Parser error: syntax error, in file Hollow Face Array for CNC
2.scad, line 25

Execution aborted

// faces are about 114 x 76 x 13
isOSCAD = true;

module PFaceA()
    translate([11, 90, 0])
        rotate([90, 0, 180])
            import("d:/stl files/Face-Plate-POS-1-decimatedx2.off",
convexity = 1000);

module PFaceO()
    translate([11, 90, 0])
        rotate([90, 0, 180])
            import("d:/stl files/Face-Plate-POS-1.stl", convexity = 1000);

module NFaceA()
    translate([11, 90, 13])
        rotate([90, 0, 180])
            import("d:/stl files/Face-Plate-NEG-1-decimatedx2.off",
convexity = 1000);

module NFaceO()
    translate([11, 90, 13])
        rotate([90, 0, 180])
            import("d:/stl files/Face-Plate-NEG-1.stl", convexity = 1000);

module PFace()
    if (isOSCAD) then PFaceO(); else PFaceA();

module NFace()
    isOSCAD ? NFaceO() : NFaceA();

I can't see the problem.  I'm trying to use a boolean to control which pair of STL files I import, but neither the ? nor the if conditionals are accepted.  What am I missing?  I keep getting this: Parsing design (AST generation)... Saved backup file: C:/Users/jon/Documents/OpenSCAD/backups/Hollow Face Array for CNC 2-backup-PJfjlBZf.scad ERROR: Parser error: syntax error, in file Hollow Face Array for CNC 2.scad, line 25 Execution aborted // faces are about 114 x 76 x 13 isOSCAD = true; module PFaceA()     translate([11, 90, 0])         rotate([90, 0, 180])             import("d:/stl files/Face-Plate-POS-1-decimatedx2.off", convexity = 1000); module PFaceO()     translate([11, 90, 0])         rotate([90, 0, 180])             import("d:/stl files/Face-Plate-POS-1.stl", convexity = 1000); module NFaceA()     translate([11, 90, 13])         rotate([90, 0, 180])             import("d:/stl files/Face-Plate-NEG-1-decimatedx2.off", convexity = 1000); module NFaceO()     translate([11, 90, 13])         rotate([90, 0, 180])             import("d:/stl files/Face-Plate-NEG-1.stl", convexity = 1000); module PFace()     if (isOSCAD) then PFaceO(); else PFaceA(); module NFace()     isOSCAD ? NFaceO() : NFaceA();
NH
nop head
Mon, Dec 7, 2020 2:14 PM

then

On Mon, 7 Dec 2020 at 14:08, jon jon@jonbondy.com wrote:

I can't see the problem.  I'm trying to use a boolean to control which
pair of STL files I import, but neither the ? nor the if conditionals are
accepted.  What am I missing?  I keep getting this:

Parsing design (AST generation)...

Saved backup file: C:/Users/jon/Documents/OpenSCAD/backups/Hollow Face
Array for CNC 2-backup-PJfjlBZf.scad

ERROR: Parser error: syntax error, in file Hollow Face Array for CNC
2.scad, line 25

Execution aborted

// faces are about 114 x 76 x 13
isOSCAD = true;

module PFaceA()
translate([11, 90, 0])
rotate([90, 0, 180])
import("d:/stl files/Face-Plate-POS-1-decimatedx2.off",
convexity = 1000);

module PFaceO()
translate([11, 90, 0])
rotate([90, 0, 180])
import("d:/stl files/Face-Plate-POS-1.stl", convexity = 1000);

module NFaceA()
translate([11, 90, 13])
rotate([90, 0, 180])
import("d:/stl files/Face-Plate-NEG-1-decimatedx2.off",
convexity = 1000);

module NFaceO()
translate([11, 90, 13])
rotate([90, 0, 180])
import("d:/stl files/Face-Plate-NEG-1.stl", convexity = 1000);

module PFace()
if (isOSCAD) then PFaceO(); else PFaceA();

module NFace()
isOSCAD ? NFaceO() : NFaceA();


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

then On Mon, 7 Dec 2020 at 14:08, jon <jon@jonbondy.com> wrote: > I can't see the problem. I'm trying to use a boolean to control which > pair of STL files I import, but neither the ? nor the if conditionals are > accepted. What am I missing? I keep getting this: > > > Parsing design (AST generation)... > > Saved backup file: C:/Users/jon/Documents/OpenSCAD/backups/Hollow Face > Array for CNC 2-backup-PJfjlBZf.scad > > ERROR: Parser error: syntax error, in file Hollow Face Array for CNC > 2.scad, line 25 > > Execution aborted > > > > > // faces are about 114 x 76 x 13 > isOSCAD = true; > > module PFaceA() > translate([11, 90, 0]) > rotate([90, 0, 180]) > import("d:/stl files/Face-Plate-POS-1-decimatedx2.off", > convexity = 1000); > > module PFaceO() > translate([11, 90, 0]) > rotate([90, 0, 180]) > import("d:/stl files/Face-Plate-POS-1.stl", convexity = 1000); > > module NFaceA() > translate([11, 90, 13]) > rotate([90, 0, 180]) > import("d:/stl files/Face-Plate-NEG-1-decimatedx2.off", > convexity = 1000); > > module NFaceO() > translate([11, 90, 13]) > rotate([90, 0, 180]) > import("d:/stl files/Face-Plate-NEG-1.stl", convexity = 1000); > > module PFace() > if (isOSCAD) then PFaceO(); else PFaceA(); > > module NFace() > isOSCAD ? NFaceO() : NFaceA(); > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
J
jon
Mon, Dec 7, 2020 2:16 PM

Thanks.  I know too many frigging languages.  Sigh

On 12/7/2020 9:14 AM, nop head wrote:

then

On Mon, 7 Dec 2020 at 14:08, jon <jon@jonbondy.com
mailto:jon@jonbondy.com> wrote:

 I can't see the problem.  I'm trying to use a boolean to control
 which pair of STL files I import, but neither the ? nor the if
 conditionals are accepted.  What am I missing?  I keep getting this:


 Parsing design (AST generation)...

 Saved backup file: C:/Users/jon/Documents/OpenSCAD/backups/Hollow
 Face Array for CNC 2-backup-PJfjlBZf.scad

 ERROR: Parser error: syntax error, in file Hollow Face Array for
 CNC 2.scad, line 25

 Execution aborted




 // faces are about 114 x 76 x 13
 isOSCAD = true;

 module PFaceA()
     translate([11, 90, 0])
         rotate([90, 0, 180])
             import("d:/stl
 files/Face-Plate-POS-1-decimatedx2.off", convexity = 1000);

 module PFaceO()
     translate([11, 90, 0])
         rotate([90, 0, 180])
             import("d:/stl files/Face-Plate-POS-1.stl", convexity
 = 1000);

 module NFaceA()
     translate([11, 90, 13])
         rotate([90, 0, 180])
             import("d:/stl
 files/Face-Plate-NEG-1-decimatedx2.off", convexity = 1000);

 module NFaceO()
     translate([11, 90, 13])
         rotate([90, 0, 180])
             import("d:/stl files/Face-Plate-NEG-1.stl", convexity
 = 1000);

 module PFace()
     if (isOSCAD) then PFaceO(); else PFaceA();

 module NFace()
     isOSCAD ? NFaceO() : NFaceA();

 _______________________________________________
 OpenSCAD mailing list
 Discuss@lists.openscad.org <mailto:Discuss@lists.openscad.org>
 http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
 <http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org>

OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Thanks.  I know too many frigging languages.  Sigh On 12/7/2020 9:14 AM, nop head wrote: > then > > On Mon, 7 Dec 2020 at 14:08, jon <jon@jonbondy.com > <mailto:jon@jonbondy.com>> wrote: > > I can't see the problem.  I'm trying to use a boolean to control > which pair of STL files I import, but neither the ? nor the if > conditionals are accepted.  What am I missing?  I keep getting this: > > > Parsing design (AST generation)... > > Saved backup file: C:/Users/jon/Documents/OpenSCAD/backups/Hollow > Face Array for CNC 2-backup-PJfjlBZf.scad > > ERROR: Parser error: syntax error, in file Hollow Face Array for > CNC 2.scad, line 25 > > Execution aborted > > > > > // faces are about 114 x 76 x 13 > isOSCAD = true; > > module PFaceA() >     translate([11, 90, 0]) >         rotate([90, 0, 180]) >             import("d:/stl > files/Face-Plate-POS-1-decimatedx2.off", convexity = 1000); > > module PFaceO() >     translate([11, 90, 0]) >         rotate([90, 0, 180]) >             import("d:/stl files/Face-Plate-POS-1.stl", convexity > = 1000); > > module NFaceA() >     translate([11, 90, 13]) >         rotate([90, 0, 180]) >             import("d:/stl > files/Face-Plate-NEG-1-decimatedx2.off", convexity = 1000); > > module NFaceO() >     translate([11, 90, 13]) >         rotate([90, 0, 180]) >             import("d:/stl files/Face-Plate-NEG-1.stl", convexity > = 1000); > > module PFace() >     if (isOSCAD) then PFaceO(); else PFaceA(); > > module NFace() >     isOSCAD ? NFaceO() : NFaceA(); > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org <mailto:Discuss@lists.openscad.org> > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > <http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org> > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
M
MichaelAtOz
Mon, Dec 7, 2020 10:45 PM

Also note the conditional '... ? ... : ...' is part of an expression.
Whereas if/else are statements.


OpenSCAD Admin - email* me if you need anything,  or if I've done something stupid...

  • on the Forum, click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

--
Sent from: http://forum.openscad.org/

Also note the conditional '... ? ... : ...' is part of an expression. Whereas if/else are statements. ----- OpenSCAD Admin - email* me if you need anything, or if I've done something stupid... * on the Forum, click on my MichaelAtOz label, there is a link to email me. Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. -- Sent from: http://forum.openscad.org/