Hi all; I thought I'd ask a question on the topic of "How do I think of creating a part with OpenSCAD?"
I've been programming since the 70's, in many languages, and I've used lathes, milling machines, CNC driven sometimes, so I know how to think as if I'm milling something.
Let's say I am making a container that holds 50 of something, in 5 rows of 10; what is "the best" way to look at building this sort of thing?
Is it best to build a procedure that builds the overall container, then another that drills the hole out for the object it's storing, and repeat that somehow to drill the 50 holes out, or ??
"Is it best to build a procedure that builds the overall container, then another that drills the hole out for the object it's storing, and repeat that somehow to drill the 50 holes out, or ??"
> Hi all; I thought I'd ask a question on the topic of "How do I think of creating a part with OpenSCAD?"
> I've been programming since the 70's, in many languages, and I've used lathes, milling machines, CNC driven sometimes, so I know how to think as if I'm milling something.
> Let's say I am making a container that holds 50 of something, in 5 rows of 10; what is "the best" way to look at building this sort of thing?
> Is it best to build a procedure that builds the overall container, then another that drills the hole out for the object it's storing, and repeat that somehow to drill the 50 holes out, or ??
errors... at least for me, anyway.
print the base, then slice off the bottom and print the lid.
TY M. Rule & Ed. I figured asking was a good idea :) Interesting case, Ed!
> print the base, then slice off the bottom and print the lid.
I'd start with the overall shape, just a big cube() or if I want rounded edges I'll play with cylinder(), sphere() and hull().
then cut out the drawers using for() and maybe cylinder($fn=4) or hull() again if you don't want the sides perfectly vertical or might want fillets in the bottom.
If ever you want to join two pieces together, you cannot have any coplanar faces anywhere or you'll end up with a non-manifold mesh. This isn't openscad's fault, this is actually part of the math, like the CSG version of heisenberg uncertainty. The same thing happens with autodesk, blender, etc when doing boolean operations.
SO if you want a single face somewhere, it has to start as a single object that you cut down. If you want tangential attachments, you'd best be using hull() or similar rather than hacking at it yourself.
http://cloud.netfabb.com is pretty good at fixing mildly imperfect STLs, but best be checking the result- if it has to repair large areas they're not going to look how you want them to!
TY Triffid, hmmm, I don't recall hull() or render() - more to look up :) I usually build a "cheat sheet" for languages I'm learning, it helps me finish learning it all, I'll be doing that more (already started a month ago or so) on SCAD.
hull() gives a 3D convex hull of all child objects, think wrapping a sheet around things, so you can position some cylinders and spheres where you want corners, then hull() and you get a rounded cube.
render() passes its sub-tree to CGAL to get a proper mesh instead of a CSG tree, then caches the result. this makes it take (lots) longer the first time, but then is hugely faster every subsequent time unless you change something in the subtree and make it re-render.
This is useful for when you create a sub-assembly that isn't going to change but may be used a lot elsewhere, such as the cut-out for your drawers.
render() sounds good too. Always more to learn :) Thanks!
> What are units.scad and useful sizes.scad used for?
conversions between inches & mm and suchlike. The "useful sizes.scad"
file has similar dimensional odds & ends I've collected along the way.
Mercifully, 1 OpenSCAD unit = 1 mm of plastic.
complete model never gets printed.
> Mercifully, 1 OpenSCAD unit = 1 mm of plastic.
> > Mercifully, 1 OpenSCAD unit = 1 mm of plastic.
1 unit = 1mm/1cm/1inch if I remember the choices.
Actually it's unitless all the way through, it's the user that decides what the units are!
I think the closest we get to proper units is that the dialogs and help text in slic3r and firmware configuration specify millimeters, and G20/G21 select a unit for following gcode.
I'm pretty sure if you went through the entire chain and replaced all the relevant numbers with some other unit (eg inches), things would still print properly and at the right size!