Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing children to modules that don't accept them doesn't issue warning #596

Closed
kwikius opened this issue Jan 8, 2014 · 4 comments · Fixed by #3759
Closed

Passing children to modules that don't accept them doesn't issue warning #596

kwikius opened this issue Jan 8, 2014 · 4 comments · Fixed by #3759

Comments

@kwikius
Copy link

kwikius commented Jan 8, 2014

module Ring(outerD,innerD,thickness){
 epsilon = 0.1;
    difference(){
        cylinder(h = thickness, d=outerD , $fn= 20)  //;
// NO STATEMENT TERMINATOR ";" in above line      ^^^  BUT DOESNT FAIL COMPILATION
// No warning
// next statement is  ignored...
        translate([0,0,-epsilon]){
          cylinder(h = thickness + 2 \* epsilon, d=innerD, $fn= 20);
       }
   }
}

Ring(100,80,10);

/*
regards Andy

OpenSCAD is great BTW :)
*/

@GilesBathgate
Copy link
Contributor

Some modules take children, some modules don't

consider

translate([10,10,10]) cylinder(h=1, d=2);

then

cylinder(h=1, d=2) translate([10,10,10]);

In your example above its not that the statements following cylinder are ignored, its that you are passing those as children to the cylinder module (which makes no sense)

So it cannot be a syntax "error", but we can issue a warning when you try to give children to built in modules that don't accept children (I think)

@kwikius
Copy link
Author

kwikius commented Jan 8, 2014

Thanks for the reply.. I Changed issue title to reflect your comments

regards
Andy

@GilesBathgate
Copy link
Contributor

I would call it something along the lines of "Passing children to modules that don't accept them doesn't issue warning" it doesn't really have anything to do with the statement terminator, nor the difference module specifically.

@kwikius
Copy link
Author

kwikius commented Jan 8, 2014

Done!

regards
Andy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants