Designing in OpenSCAD for laser cutting

What part of the “this” are you wondering about?

openSCAD is just a script like most “scripting languages”. To make a circle of diameter 10, your script would be:

circle(10);

To make a circle with a circle cut out, you would do:

difference() {
circle(10);
circle(8);
}

That would cut out a circle of diameter 8 from a circle of diameter 10.

To make a bullseye, you could do:

difference() {circle(14); circle(12);}
difference() {circle(10); circle(8);}
difference() {circle(6); circle(4);}
circle(2);

And so on.

You can keep adding things with union(), and removing things with difference().

Once you know that, you can make pretty elaborate things. You can start using loops, conditions and variables to do things.

You can also move things around with translate and rotate.

It’s pretty easy once you get the mindset.

If you’re wondering how we go from python/tcl to openscad, then that’s a different matter. I’m simply generating an openSCAD script using Tcl code, then running that script in openSCAD.

1 Like

Yes, sorry @polarbrainfreeze I should have been more specific and save you all those keystrokes! lol I was talking more about going from python to openSCAD. I figured it was something like @jrlallo mentioned writing to some kind of file that openSCAD could read. I was hoping it would be more inline (not sure if thats even possible). I come from working in Rhino3D and Grasshopper which allows you to do parametric design but its a kind of visual component based programming. Not sure if your familiar but you should check it out. It is very easy to iterate through designs. They also have a python and C++ component that allows you to write pieces to interact with the rest of the script.

In the grasshopper environment you could have a circle component. It is passed 4 values (X,Y,Z and radius). Whats cool is you can pass a list of values. All of a sudden you have 100 circles with locations and radii based data that can come from anywhere. Also writing some python scripts can make it even more dynamic.

And if you’re worried about the price of Rhino. Ive got a solution for you. Grasshopper is a free plugin which creates its own files. You can download the Rhino trial which allows 25 saves but you should never need to use them just save the grasshopper script and there you go! its free!

I installed Rhino3D recently, but then I looked at the price and uninstalled it. :smile:

I’ll definitely reinstall it and try the Grasshopper plugin.

Thanks for the tip.

Yeah thats the only downfall. I used it a lot in school otherwise I don’t think I would have touched it.

I’ve re-installed Rhino and Grasshopper and I like the visual language. Once the Rhino trial is over, can you still export your designs to a PDF or some other format? Or does it disable all saving?

whoa…genius!! That is such an awesome work around.

2 Likes

Rhino has 25 saves. After that you have to buy it. Grasshopper is completely free and just draws to Rhino. So if you do all your work in grasshopper and only save grasshopper files you should never need to save from Rhino. There are also plugins that will export to various files. I don’t know off hand but I’m sure there is a PDF or SVG one. Check Grasshoppers website there are hundreds of plugins.

EDIT: seems like here’s your answers

Thanks for the answer! I’ll check out the link and see if it fits into my workflow.

Ben

1 Like