Results 61 to 69 of 69
Thread: OpenScad Help Centre
12-09-2014, 05:18 AM #61
Umm, yes ?
There is no such thing as 'best practice'. Only what you are happiest using.
If that's all it takes to save your own modules and use them in scripts. Then that's going to be extremely useful.
The only thing I've used like that so far is the write.scad module. I actually made a different one for each font and renamed them for the font names. so i can just use: use <knewave.scad>
To use the knewave font. Makes things a bit easier.
Using a library of your own modules would make for simpler looking scripts, that's for sure.
Also you're rotate extrude module just makes a bog standard straight sided ring. Shouldn't it make a round sided 'donut/torus' ?
Here's some homework for you OME - find a decent module I can make different sized screw threads with. I've so far not managed to find one that actually works.
12-09-2014, 06:22 AM #62
Maybe this one love you long time:
Last edited by old man emu; 12-09-2014 at 06:34 AM.You may go past me,
But you won't outlast me!
12-09-2014, 07:54 AM #63
- Join Date
- Jun 2014
- Burnley, UK
I think that using the "module" function is the only way to make openscad files easy to understand by the people that did not write them.
If you stick all the separate things it does in modules then just call them from the bottom of the file it really is a lot easier to remember what is what.
12-09-2014, 08:02 AM #64
- Join Date
- Jun 2014
- Burnley, UK
If you have some modules that are in another file and you want to call those modules then you can either "include" the file or "use" the file.
"Include" will perform calculations that are within the file whereas "use" will not do any internal calculations, it will just use the functions.
With the toroid file from the other thread I can simply
to make the toroid
12-09-2014, 10:00 AM #65
This is a good example of how to use modules to insulate yourself from a problem. I already had a module that made a ridged_beam() and let me set numbers to build it. But then I defined a module to make a stress_relieved_ridged_beam() that took some input numbers and generated an 'appropriate' beam from them.
And at a higher level, it only takes a few lines of code to make the base() with all these fancy holes. If I need to do further work to reduce stress on the model, I just have to do it in the one routine stress_relieved_ridged_beam() and it will automatically get replicated everywhere that function is used. If the topic is of interest to you, you can zoom in and see the miniature cuts between each big hole to eliminate stress build up on the early layers.
Proper and judicious use of 'module' can help make your code more maintainable and easier to reuse. (Not to mention... Easier for other people to understand!!!!)
12-10-2014, 05:37 AM #66Pay attention!!. This is the OpenScad Help Centre, not the Geometry Help Centre. The code pasted here is just an example copied from the blog page to illustrate the topic "Modules"
And using examples from thje openscad manual is just going to confuse everybody :-)
Not sure who wrote that manual, but I'm leaning towards someone with aspergers.
They defintiely don't share any frame of reference with me :-)
12-10-2014, 06:16 AM #67
I agree that I didn't put the question about the square doughnut very well, but it did generate some lively discussion, have minds whirring over, and introduced us to an expert in the field.
I'm with you in saying that the OpenScad manual is not instructive. It clearly was not written with the intention of enlightening people like you and me who just wanted to use OpenScad to make objects. The manual was obviously written by programmers for programmers and that is why it is full of jargon such as, (You can instantiate the module by passing values (or formulas) for the parameters just like a C function call)
Techopedia explains Instantiate
Instantiation is the creation of an instance of an abstraction, object class (also known as a template) or other computer process whereby objects are used. Each instance created by instantiation is unique depending on the variation of the elements within the object. Until an object becomes instantiated, none of the code within the relevant class declarations is used.
Prior to modern OOP methods, instantiate had a similar meaning in relation to the creation of data within an empty template. For example, the entry of a record into a database was considered to be instantiation.
Remember this. It will be in the End of Year examination of the core topic Obfuscation 101.
The manual presumes too much prior knowledge of programming, which is why I started this thread with a request for a description of the syntax, and then realised that I needed to know the meanings of it symbols and punctuation before I could move on to writing some code. I'm also wondering if OpenScad is an efficient way to end up with an *.stl file that is needed for slicing. I haven't tried converting any code to an stl file.
I find that it is very easy to make typographical errors in writing this code. I had to edit the code in the example I posted in Post #60 because the original author had mixed up the order of parameters here
Last edited by old man emu; 12-10-2014 at 06:29 AM.You may go past me,
But you won't outlast me!
04-16-2015, 08:43 AM #68
OpenScad has been stagnant for a whole year. No bug fixes or improvements. It almost looked like the development effort was dead. Well, it turns out they were very busy!!! There is a new release 2015.03 that adds a lot of important features and simplifies the code to do a number of things. It seems very stable and so far, it appears to be fully backward compatible.
Two of the best things in the new version are the ability to generate text directly to put on your models and the offset() command.
Check it out: http://www.openscad.org/downloads.html
Actually... There is one more thing that is super important. The ability to set and reset a variable within any scope. This dramatically simplifies a number of things.
Last edited by Roxy; 04-16-2015 at 02:28 PM.
08-12-2016, 11:26 AM #69
latest scad release is NOT the latest release.
go here : http://www.openscad.org/downloads.html
on the right click on: Development Snapshots
Takes you down to the part of the page with the ACTUAL latest releases.
Some cool new features that, as far as I can find out - just aren't listed. You have to meander through the manual untill you see: 'new in release 2016.*.*'
How I found out you could do a partial rotate extrude.
Must be some other stuff in there as well. I just haven't gone through the whole manual yet.