Close



Results 1 to 10 of 72

Hybrid View

  1. #1
    Super Moderator Roxy's Avatar
    Join Date
    Apr 2014
    Location
    Lone Star State
    Posts
    2,182
    On difference() and union() and intersection() the ()'s have to be there... But nothing goes inside them.

    The curly braces {} enclose lines of code to form a 'statement' or 'block'. Everything within the first set of curly braces gets operated on by difference(), union() and intersection. Instead of parameters getting passed within the () as in C, the things that are going to get operated on are in specific places with the {}'s. (ie. things get subtracted from the first object specified in the {}'s of a difference() ).

    But in cube(), sphere(), etc... Parameters are passed inside the ()'s. So you can say something like sphere(r=10); Or cube( [3,4,5] ); Or cylinder(r=4, h=20);

    The English text version of that example would read something like:

    First add together (using union()) a sphere of radius 20, and cone moved up somewhat). Add a little sphere to the top of that. And then take a slice out of the resulting object.

    You can put a # in front of any line of code in OpenScad to see what it is producing. The best thing to do would be to put a # on a line and see what it is generating on the redered picture.
    Last edited by Roxy; 11-29-2014 at 04:42 PM.

  2. #2
    Staff Engineer old man emu's Avatar
    Join Date
    Oct 2013
    Location
    Narellan, New South Wales, Australia
    Posts
    912
    What about the semi-colon; ?

    OME

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •