Close



Page 3 of 8 FirstFirst 12345 ... LastLast
Results 21 to 30 of 71
  1. #21
    Senior Engineer
    Join Date
    Jun 2014
    Location
    Burnley, UK
    Posts
    1,662
    OpenSCAD version 2013.05.28 (The latest in the Mint feeds)

    XFCE version 4.10

    Kernel:
    3.11.0-26-generic #45-Ubuntu SMP Tue Jul 15 04:04:15 UTC 2014 i686 i686 i686 GNU/Linux

    Linux Mint: 17.1 Rebecca

  2. #22
    Staff Engineer old man emu's Avatar
    Join Date
    Oct 2013
    Location
    Narellan, New South Wales, Australia
    Posts
    912
    CA,
    What I'm trying to do is illustrate the very basic things that have to be looked for when writing some code. That's why I paid more attention to brackets, braces, semi-colons and such. The cheat sheet is not very good at illustrating how things have to be written. http://www.openscad.org/cheatsheet/index.html

    Take the section presenting Special Variables down on the bottom right. It informs us that the group $f is the number of fragments. The comment in your code,
    $fn=100; //defines the number of facets for round or spherical shapes. 100 gives you the roundest thing. is nearly one hundred per cent but you have to tell people that without the semi-colon ";" it doesn't work. It's those seemingly trivial things that put up barriers for people without a programming background.

    While we are on it, nowhere does the manual tell you that the Transformations have to be coded before the object the operate upon.

    Another barrier I found tonight was with the Transformation color (apart from the misspelling). It is not clear from the cheat sheet that the name of the colour to be used has to be between double quotation marks. And further on the same Transformation, there is nothing to tell you that the opacity of the colour can be modified by adding a decimal number between 0 and 1. See what happens when you run this:

    // THE BASE
    // The base will be drawn with distances measured from the Origin (0,0,0)
    // I do not like the default colour. I am going to change it to blue using
    // color("..") and if the colour is too dark, I'll reduce the opacity by adding a
    // decimal value between 0 and 1. Don't forget the double quotation marks, but no semi-colon. color() needs something to act upon so it is written before the
    // thing it is operating on.

    color("lightblue", 0.4)
    cube([64,64,19]);

    OME
    Last edited by old man emu; 12-01-2014 at 05:30 PM.

  3. #23
    Super Moderator curious aardvark's Avatar
    Join Date
    Jul 2014
    Posts
    8,801
    I did say the manual is useless.

    But what i see is you concentrating on things that are not necessary to know the 'why' of.

    The brackets are always there and always in the same order. That's all you need to know. Trying to get your head around why there are () brackets after things is pointless. Just type the buggers and move on :-)

    Colours ?
    why on earth have you skipped all the useful basics and gone on to colour ?
    That fits into what i like to call the: 'advanced and pointless' category.

    You can't designate colours for a multi colour print (well you sort of can, but not in the way most people would think) They are there purely for cosmetic use. So untill you know what you're doing - ignore them.

    There's no point injecting unnecessary code into a script when you're learning.

    You had already stated that semi-colons come after commands, as well as where brackets are used and why. So I'm not going to repeat it every time I write a script.
    You soon get used to adding the semi-colon.
    I always type the whole command with brackets and semi-colon before adding any numbers.

    I assume people start from the beginning of the thread and work their way down. If they choose not to do that - it's not my fault :-)

    Hmm, pretty sure the diameter command should work in your version of 'scad. mjoilnir.
    Last edited by curious aardvark; 12-01-2014 at 10:53 AM.

  4. #24
    Senior Engineer
    Join Date
    Jun 2014
    Location
    Burnley, UK
    Posts
    1,662
    The colours and transparency are essential when designing things otherwise you can't see what you have.

  5. #25
    Super Moderator curious aardvark's Avatar
    Join Date
    Jul 2014
    Posts
    8,801
    colours are pretty pointless.

    If you are designing a print for dual extrusion. You simply comment out the parts for the second colour when your render the commands for the first.
    And vice versa.
    I guess you could make them different colours - but I don't. I'm not a colour focused person.
    I never know when friends have decorated or bought new stuff. It's not important to me so i don't generally take notice of it.

    Transparency is potentially useful if you're designing mechanisms within a shell. Otherwise - again - just unnecessary window dressing.
    haven't used it yet - or felt any need to.

    When i start doing encapsulated hinges I'll probably play with transparency.
    But for most models - you don't need it.

    I know a lot of cad packages are colour focused. Architecture packages use different colours for different line types and thicknesses.
    I suspect this is one - of many - reasons i don't get on with conventional cad packages :-)
    Last edited by curious aardvark; 12-01-2014 at 11:24 AM.

  6. #26
    Staff Engineer old man emu's Avatar
    Join Date
    Oct 2013
    Location
    Narellan, New South Wales, Australia
    Posts
    912
    CA,
    I agree with you that color("colorname", [<0 n > 1 is as useless as a hip pocket in a singlet except under very rare circumstances. I just quoted it as an example of how the producers of the documentation jumped from Coding 101 to Coding 105, leaving those of us with learning difficulties floundering.

    What people like me need is more attention being paid to those things that programmers take for granted. As I have been working on this thread, and playing with OpenScad, I've picked up these basics, but it's been a couple of months since Roxy suggested that OpenScad was a better program than, say Rhino for the hobbyist. If these very, very basic facts had been presented to me way back then, I'd be creating the Millennium Falcon by now. I'm quickly finding out that OpenScad is easy enough to use. It will be better when I can see how to do in it what I can do in Rhino (which is not much, actually)

    OME

  7. #27
    Super Moderator curious aardvark's Avatar
    Join Date
    Jul 2014
    Posts
    8,801
    a basic millenium flacon is pretty simple. A flattened sphere for the body, cylinder for the front roundy bit, dimple on the top.

    But if you're trying to duplicate what you can do on a package you know well in openscad after a couple weeks - you're just going to get frustrated.

    You need to start with simple things. I find that the more I use openscad the more I learn and the more I can actually make it do.

    But it's not a program where you can just leap in at the deep end.

    Start with differences and unions. Then add variables, loops and modules.

    The best way to learn is to build a simple model - a rocket for example ;-)
    And keep tweaking the script as you learn different functions.

    I reckon I can probably get the rocket script down to about half a dozen lines of code eventually and make it fully parametric.

    And for the record it prints great too - used it to test a cheap roll of white pla.

    But I do think you're trying to get too complicated too quick.

  8. #28
    Super Moderator Roxy's Avatar
    Join Date
    Apr 2014
    Location
    Lone Star State
    Posts
    2,183
    Quote Originally Posted by curious aardvark View Post
    colours are pretty pointless.

    Transparency is potentially useful if you're designing mechanisms within a shell. Otherwise - again - just unnecessary window dressing.
    haven't used it yet - or felt any need to.
    I usually use a difference() to look inside things. I subtract off a huge cube([]) so I can see a cross sectional view of what is being built. I have a couple of examples, like a whistle and a pump jack where unless you can see inside, you won't know that you have things right.

  9. #29
    Staff Engineer old man emu's Avatar
    Join Date
    Oct 2013
    Location
    Narellan, New South Wales, Australia
    Posts
    912
    Quote Originally Posted by curious aardvark View Post
    a basic millenium flacon is pretty simple.
    I'm going to have to be careful how I write. That wasn't meant that I wanted to model an Millennium Falcon. I just used that thing as an image to represent a complicated object.

    Quote Originally Posted by curious aardvark View Post
    You need to start with simple things. I find that the more I use openscad the more I learn and the more I can actually make it do.

    But it's not a program where you can just leap in at the deep end. The best way to learn is to build a simple model And keep tweaking the script as you learn different functions. But I do think you're trying to get too complicated too quick.
    I'm in full agreement with these statements. We let this thread get too complicated, too fast. We need to go back and start at the very beginning.

    Here's my thought:
    Let's each download the OpenScad Cheat Sheet and, starting with Syntax , go through it explaining what each of the underlined words means, and the correct way to write it into some code.
    If an object is needed to illustrate a the way something works, then let's standardize to a cube and/or a sphere whose size/radius is 5. (And allow arguments in favour of diameter instead of radius).

    If you are happy with my explanation of the way I explained the use of brackets and semicolons, then let it be Syntax .1, and move on to var as Syntax .2., and so on.

    OME

  10. #30
    Technologist dacb's Avatar
    Join Date
    Aug 2014
    Location
    Edmonds, WA
    Posts
    139
    Not to hijack, but I just want to put in a quick plug for openjscad instead of openscad. It performs way better (render time), doesn't have the wonky syntax and variable scoping oddities. I have switched over completely.

Page 3 of 8 FirstFirst 12345 ... LastLast

Posting Permissions

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