posts tagged with the keyword ‘openscad’

2017.02.11

When it comes to 3D modeling for the majority of the 3D printing I do, I tend to turn to OpenSCAD. OpenSCAD is known as “The Programmers Solid 3D CAD Modeller”, and it’s free software available for Linux/UNIX, Windows and Mac OS X. Yeah, you create objects by writing code. It’s weird, but so am I.

If you’re one of those cloud-loving weirdos (who also uses Chrome) you can also opt to use OpenSCAD.net, which is a (blah) “browser-based” version of OpenSCAD. Sort of. It definitely has it’s usefulness (Chromebooks!) but anytime I can download and install an open source application, I’ll opt for that route.

Now, once you get used to OpenSCAD (assuming you want to) you can refer to the cheat sheet or read the entire OpenSCAD manual. But suppose you don’t exactly want to write code, or you aren’t good at it yet… Perhaps BlocksCAD can help.

Functions

BlocksCAD puts a “blocks” interface on top of OpenSCAD. You may have seen this block-thing in use with Scratch. It’s a good way to teach kids how programming works. (There’s an Arduino-ish block application call mBlock that works with the Makeblock robots. And yes, there’s lots more scratch blocks stuff out there.)

Blocks

I took a model I made in OpenSCAD last week and recreated it in BlocksCAD. It took quite a bit longer (probably because I can write code fairly quickly) but the results were good. The blocks really help show the structure of things. For anyone whose had to remember bracket placement, semicolons (and tabs & indents if you care about readable code) the blocks interface hides all of those things. Again, possibly a good thing for beginner coders.

Code

In BlocksCAD you can toggle between the blocks interface and seeing the code. This is great, as you can see the code that gets created by the blocks. Note that you cannot edit the code in the code view. This is (slightly) annoying, but I can understand why this decision was made.

There are things that BlocksCAD doesn’t support, but the basics are there. (I’d love to see comments added.) The basics are enough to get a beginner (child or adult) started with building blocks into a program that generates a 3D model. Sweet!

Share

You can also easily share the models you create. (Okay, that’s probably the one nice feature about a browser/cloud-based thingy.) You might notice from the image above that the holes are weird looking, as in, not very round. What’s going on?

Rod Holder

Here’s the original model that I created in OpenSCAD running on my computer. Note that the round holes are super-round! I get them round by adding the line:

$fn = 100;

to the top of my code. The $fn thing controls the number of facets used to generate an arc. It’s the difference between a round circle and a low-resolution circle consisting of x number of flat sides. (You can also use the $fn to allow you to quickly render models by setting the number low, and then raising the number before you do your final render.)

Rod Holder

Here’s what I got when I copied the code from the “code view” of BlocksCAD and pasted it into OpenSCAD and rendered it. Blah! Low-resolution holes. If I added my $fn = 100; line it rendered what I really wanted.

STL

Okay, so I also downloaded an STL file from BlocksCAD and it looked like this. Hmmm, much better quality than the low-resolution version I got from the code I copied. So what’s up? Well…

When you render objects in BlocksCAD there’s a “smooth” option with Low, Medium, and High settings. So, if you choose the High setting, you get a much better model. The code view doesn’t show whatever the $fn/facet setting is for the model, but it must be adding it when it does the render. Makes sense.

BlocksCAD has a few quirks, but I think it’s a great concept. While I’d love to see a downloadable version, I hope Einsteins Workshop continues to provide the web-based offering for those who want to use it.

2016.12.30

USB Mount

I designed a small part to hold a panel mount USB cable. I started with the Phoenix Connector Mount I briefly mentioned before, and did some quick modifications to make it work with the USB cable.

USB Mount

I designed this thing in OpenSCAD though I did borrow a few elements from another recent model so that I could use 5/8″ #4 screws. The bottom where the screws go in is set to a height that allows the screws to go in just under 1/4″ which is enough to hold, but not enough to go through the material they’ll be screwed into. This is one of the things I love about making custom mounts and brackets, you can configure them to match the hardware you have available.

USB Mount

With many of the things that need (semi) precise placement of things, it takes two to three revisions to get it right. I actually used the second revision because I was in a hurry, but I’ve modified the file so version 3 will be just right next time. (I had the panel mount screw holes just a little too close together. Things flex enough that it works, but it could be better, and will be… next time.)

USB Mount

The first version actually warped quite a bit in printing. It’s a problem we seem to have occasionally with the old MakerBot. It’s always the front left corner of the print. I find that by shifting the print on the bed to the right just a bit often fixes the problem (at least for small prints.)

USB Mount

You can find this design on YouMagine and Thingiverse.

2015.12.28

Shim

I needed a few shims to make something fit just right and I grabbed a piece of 3mm acrylic that was sitting on my desk, figuring I could easily cut it in the shop, but 3mm was just too thick. I could have tried to sand it down to the proper thickness, but at this point I would have had to cut three shims to the proper size, and get them all down to the correct thickness. (I didn’t want to use wood, as something would be sliding against the shim, and wood wasn’t the best choice.)

OpenSCAD

I took some measurements with digital calipers, launched OpenSCAD, typed in the dimensions, and had a 3D object ready to be 3D printed in just a few minutes. While I did have to wait for the 3D printer to heat up, and print the pieces, I could easily do other work while I was waiting for the prints. I didn’t spend time cutting and sanding things to get them the exact size.

Sometimes 3D printing is the right answer, and sometimes 3D printing doesn’t have to be revolutionary or solve big problems, sometimes it can solve the (little) problem you have, quickly and easily, and that’s enough.

2015.12.11

Because when you’ve got a 3D printer… You might as well print things…

3D Printing

3D Printing

3D Printing

3D Printing

3D Printing

3D Printing

3D Printing

3D Printing

3D Printing

3D Printing

Also… OpenSCAD.

2015.11.15

Sensors

I recently prototyped a device to read cards (physical cards with printing on them) for a project. I used five SparkFun Digital Line Sensor Breakout Boards attached to a 3D printed mount and wired up to an Arduino.

Card and Sensors

The cards have five blocks at the bottom, which are either black or white, representing 1 or 0. Using ones and zeroes allows us to create a binary encoding scheme, so with five positions we use 1, 2, 4, 8, 16 for the values and can represent any number from 1 to 31.

Sensor Mount

I started by grabbing the image of the sensors from the SparkFun product page and dropping them into Inkscape (sized appropriately) so I could design the barcode part of the card, and so I could design the mount for the sensors.

Sensor Mount

Once I had a 2D design in Inkscape I exported it as a DXF file and used the linear_extrude command in OpenSCAD to create a 3mm tall plate, and then added another plate. It wasn’t perfect, but it was fast. I started the 3D printer while I got to work soldering…

Sensors

Sensors

Sensors all soldered up, mounted to the plate with 3mm screws, and wired to an Arduino via a breadboard. All of this is still prototyping stage. It doesn’t look pretty, but it worked and it was enough to test things out and do a demo.

Cards with Barcodes

Here’s an example of some card templates. Can you determine what number is being passed by reading it in binary? Since we’ve got 5 positions we can have 31 different cards… If you needed 63 cards, you would need 6 positions (and one more sensor.) 127 cards? That would be 7 positions and two more sensors. Any more than that and you might consider using the SparkFun Line Follower Array which has 8 sensors on a single board.

Card and Sensors

The total time to create this prototype was just a few hours from starting a design in Inkscape to 3D printing a piece, soldering up and mounting the sensors, and writing the code. (I also wrote a simple Processing application which read the serial output from the Arduino to display the card data on screen.)

« Older Entries |


buy the button:

Buy The Button