Close



Results 1 to 10 of 72

Threaded View

  1. #10
    Staff Engineer old man emu's Avatar
    Join Date
    Oct 2013
    Location
    Narellan, New South Wales, Australia
    Posts
    912

    Gleanings from this thread.

    In an attempt to consolidate the important things that have been said, I went through this thread and pulled out the tid-bits of information that advanced the topic. I've indicated who made the post, and the post number.

    I don't expect any replies to this current post. It is meant to be a hold-all so we can move on.

    Roxy Post # 4
    The Polyhedron is difficult to use. The points used to construct it have to be carefully ordered.

    Roxy Post # 6
    the round brackets on Difference() and Union() are just to denote that you are performing a 'function'. But that deviates from their usage in C where you are passing in parameters within the ().
    The square brackets are more consistent. If you see square brackets [], the contents is going to be used as a vector (or a point).

    Roxy Post # 8
    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);

    You can put a # in front of any line of code in OpenScad to see what it is producing.


    Old Man Emu Post # 10
    PUNCTUATION SYMBOL FUNCTION
    //
    /* and */


    // is used to insert Coder’s comments into the coding. Anything written on the same line is invisible to the program. If the comment goes into two or more lines, each line must begin with // to continue hiding its content. If the comment goes on for more than three lines, mark the first comment line with /* and end the comment with */


    { and } Braces hold things in a group. They must be used in pairs with each opening brace { matched with a closing brace }

    ( and ) Parentheses are used to hold the parameters of an object or operator. The parameter could be the radius of a circle or sphere, or it could be the co-ordinates of a point in space. When used with Boolean operations, the parentheses are left empty.

    [ and ] Square Brackets are used to hold the parameters that describe width and height of squares and also the depth of cubes. When used with Transformations, they hold the x,y and z coordinates associated with the particular operator (Translate, Scale, Mirror etc.) within parentheses.

    ; Semi-colons are the symbol that says “Do it!” A semi-colon is placed at the end of the coding that defines the object to be created. If the semi-colon is omitted, nothing is created. The automatic debugging facility in OpenScad will place a marker in the code to indicate where the bug is hiding.


    curious aardvark Post # 12
    1) use diameter NOT radius. ie: cylinder(d=10,h=5);
    2) the hull command.
    This is a brilliant command and answers a lot of questions. Like: how do i make a wedge ? Can i make non equalatrial triangles. And 'how on earth do I make an irregular shape without having to try and understand the polygon command' ?

    curious aardvark Post # 17
    Don't forget that openscad is text based - so you can use normal text tools. I used copy and paste in the above script. But say you haven't made fins a module (which i didn't), but want to change all three at once. Click edit and select Find and Replace. Then put -5 in the find box and -7 in the replace box. Hit all and f5. And the angle of all three fins changes.
    Admittedly this only works if you haven't used a -5 anywhere else.

    Old Man Emu Post #22
    Transformations have to be coded before the object the operate upon.

    Roxy Post #34
    A sphere and cylinder are always generated at (0,0). So when you translate them... what ever amount you translated them... Is where the center's are.
    In OpenScad you should have a 'Top Level' geometry. That is what that first singleduploblock(); is. It references other stuff, but it is at the top level.singleduploblock() does not have any parameters, and certainly does not need its name passed in as a parameter.

    curious aardvark Post #38
    But the really weird thing is that you used a cube command with no square brackets. And it worked. cube (32,32,20);

    Roxy Post # 39
    I suggest you put the [32,32,20] inside of brackets. If for no other reason than everybody else does and expects to see that.

    Roxy Post # 49
    What's a facet command? Searching the OpenScad manual doesn't find any reference to that. Update: I figured out what you meant. I suspect you are talking about the $fn parameter

    Roxy Post # 62 in http://3dprintboard.com/showthread.php?8855-Need-some-geometry-help
    the pow() function takes two parameters. The first number is the base and the second parameter is the exponent. pow(x,y) will raise x^y. Using a pow(3,4) would be equivalent to saying 3*3*3*3. You are raising 3 to the 4th power.


    Old Man Emu
    Last edited by old man emu; 12-09-2014 at 01:19 AM.

Posting Permissions

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