Categories
3D modeling 3d printing open source programming

OpenSCAD parametric hook

Writing a script for a simple hook in OpenSCAD is easy but I wanted to do something more and make a parametric hook. With parametric I mean that a user can easily adjust the script by changing some variables to make your own hook.

To make it even easier the script makes use of the Customizer of OpenSCAD. This means that users don’t have to tinker with the code but can adjust the values of the variables with a easy to use panel on the right side of the GUI of OpenSCAD called the Customizer. (If you don’t see the Customizer in OpenSCAD go to the menu bar and click on Windows and then Customizer).

Aside from changing the dimensions I also added the possibility to add a fillet or a chamfer to the hook. And I added the option to change the radius of the hook and the diameter of the screw holes.

If you’re interested here is an explanation of some parts of the code. The fillet of the cube shaped parts of the hook is created with the fillet module. Within this module I simply intersect a cylinder with radius r1 and a cube of the desired length l.

module fillet(l,r1) {
    intersection() {
        cube([l,l,l]);
        cylinder(h=l, r=r1, $fn=50);
    }
}

In the module roundedCube the thus created fillet pieces are positioned in a such a way that the hull command shapes them to the desired filleted cube.

module roundedCube(l,w,h,r1) {
    d = 2 * r1;
    translate([r1,r1,0])
    hull() {
        rotate([0,0,180]) fillet(l,r1);
        translate([0,w-d,0]) rotate([0,0,90]) fillet(l,r1);
        translate([h-d,0,0]) rotate([0,0,270]) fillet(l,r1);
        translate([h-d,w-d,0]) rotate([0,0,0]) fillet(l,r1);
    }
}

I published the OpenSCAD script (.scad) and some example hooks (.stl) on Prusaprinters. You can download it here: https://www.prusaprinters.org/prints/91734-parametric-hook-with-source-file

Categories
3D modeling 3d printing open source

Solvespace: involute gear

We first need to create a involute of a circle in Solvespace to get a better understanding of an involute gear. This video will be followed by another where we create an involute gear and a third where we adjust the gear in Solvespace.

I’ve used version 2.3 in this video but v3.0 should work fine too for this tutorial. This is a series in progress. I will at least make one more video to demonstrate how one gear drives another in Solvespace.

First video tutorial: Involute of a Circle in Solvespace. Before creating an involute gear we first need to understand how to create an involute of a circle.

Involute of a Circle in Solvespace video tutorial

Second video tutorial: To create an involute gear we only need three parameters, the module which determines the length of the teeth, the number of teeth and the pressure angle. With these parameters we can determine the Pitch Circle, Addendum Circle or Top Circle, Dedendum Circle or Root Circle and the Base Circle. With these circles and the pressure angle the shape of the teeth can easily be created in Solvespace.

Create a Involute Gear in Solvespace video tutorial

Third video tutorial: This is the third video in a series about creating an involute gear in Solvespace. If we want to adjust the module, number of teeth or pressure angle of an existing gear in Solvespace we don’t have to start from scratch. We can take an existing gear and change one of the three parameters. This will save us a lot of time. However this change must be done following a procedure that I’ll demonstrate. Other wise Solvespace will give us the error message ‘unsolved constraint’.

Change a Involute Gear in Solvespace video tutorial

Solvespace is an open source, parametric, 3D CAD program that is lightweight and easy to use. It is available for GNU/Linux, OSX and Windows. In Solvespace the user applies geometrical constraints to a sketch and the program’s solver calculates the result (comparable to the FreeCAD part design workbench).

Solvespace is open source (GPLv3 license) and is available for Window, OSX and Linux. Originally developed by Jonathan Westhues and currently maintained by Paul Kahler and others. It can be downloaded here: http://solvespace.com/download.pl

The idea for this video comes from the JustThinkering channel on YT who made a video Involute Gears in Solvespace (https://www.youtube.com/watch?v=i6tDWJsNsok).

Categories
3D modeling open source programming

OpenSCAD: Polygon and polyhedron

OpenSCAD allows the user to create complex shapes with the polygon function for 2D and polyhedron for 3D. Polygon and polyhedron both accept a list of 2D and 3D coordinates (points) respectively as parameters. A functions can generate a list of points eliminating the need to manually created these lists. This property can be used to create shapes that are impossible with the 2D and 3D shapes that are build-in in OpenSCAD. In this blog post I’ll show how to create functions for some simple 2D shapes and explain how to manipulate the functions make more complex shapes with them.

Shapes created with functions and polygon in OpenSCAD

Creating a 2D shape

To create a circle with a radius of 20 in OpenSCAD we just have to type

circle(20);

However OpenSCAD doesn’t allow us to reshape this build-in function to for instance an ellipse. Alternatively we can write a function that generates a list of points needed for a circle and then use polygon with the points as parameter to draw the circle. The function uses the trigonometric formulas, x = r cos φ and y = sin φ, to convert polar coordinates to Cartesian coordinates.

function circle(radius) = [for (phi = [1 : 1 : 360]) [radius * cos(phi), radius * sin(phi)]];
polygon(circle(20));

When F5 is pressed a circle is drawn however the x,y coordinates of this circle are available to us. By adding echo(circle(20)); to our script the list of points is printed in the console. The circle function can easily be altered thus gaining a new shape. An example is shown below.

function circle(radius) = [for (phi = [0 : 1 : 720]) [radius * cos(phi/2), radius * sin(phi)]];
color("red") polygon(circle(20));
Shape create with x = r cos(φ/2) and y = r sin(φ)

Now let’s take a look at the syntax of the function. Every function generates a value and in this case it is a list of points. In OpenSCAD a list of points in a two-dimensional space is represented by [[x1,y1],[x2,y2],[x3,y3],…] where all x’s and y’s are numbers. In this case of the circle function the point are generated in a for loop. The loop begin at 0 and ends at 720 with a step of 1. The radius * cos(phi/2) and radius * sin(phi) calculate each x,y coordinate for every given phi.

The ellipse, a generalization of the circle, can now easily be created by slightly changing our function.

function ellipse(r1, r2) = [for (theta = [0 : 1 : 360]) [r1 * cos(theta), r2 * sin(theta) ]];
color("cyan") polygon(ellipse(120,80));

a second parameter is added. r1 is the radius in the x-direction and r2 is the radius in the y-direction. If r1 is equal to r2 a circle is drawn.

Ellipse created with the code above

Conclusion

OpenSCAD allows the user to create complex 2D shapes using functions that generate lists of points This list is used as the argument in the polygon function of OpenSCAD. Every shape can be generated as long as the mathematical expressions are known and can be translated to OpenSCAD script. This opens up a world of possibilities.  The same is true for 3D shapes but instead of polygon the polyhedron function of OpenSCAD should be used. This however is a topic for a future blog entry.

Caveat: List comprehensions as shown in the functions of this  article are only possible with OpenSCAD v2015.03 and above.

OpenSCAD is open source (GPLv2 license) and is well maintained by Marius Kintel et al. Besides the stable releases for Windows, OSX and Linux, development snapshots are available. I recommend using these development snapshots since they have all the latest features. 

A special thanks to Xavier Faraudo who explained the advantages of functions in OpenSCAD to me.

Click here to watch the video if the video below doesn’t play: https://peertube.linuxrocks.online/w/7NfsT6STabJ341ViP1eoMR

Categories
3D modeling open source social

I’m leaving YouTube

Last May I received a new Terms of Service request from YouTube. In this request I had to grant YouTube the right to monetize my videos. In other words when I agree, YouTube can insert ads in the videos. This is the final straw for me with YouTube and Google.

Click here if the the video doesn’t run in your browser: https://peertube.linuxrocks.online/w/egFYuCEYwTCGNLiA58v7F7

I’ve created this YouTube channel with tutorials about open source 3D CAD programs and never had any intention to monetize the channel. So I definitely don’t want YT to monetize it for me.

My goal has been to inspire people to use open source software instead of proprietary software and judging by the number of views and reactions I’ve been mildly successful with that. I had over 200.000 views with my tutorials and more than 1100 subscribers. Not much for YouTube of course but keep in mind that the channel was about open source 3D CAD. Very much a niche market

I’ve put up with all YouTube’s privacy invading policy and data mining because of the popularity of YouTube. YouTube has a near monopoly when it comes to video sharing and has a huge worldwide audience. So to reach my audience with my video tutorials it made sense to use YouTube.

However where does one draw the line. I’ve created the video tutorials believe it or not with a lot a sweat and blood. And it’s important that I keep sovereignty over these videos. So whether ads will be part of the video is up to me and not YouTube. This leaves me no other alternative than to delete all my videos (except this one).

Luckily I’ve already had found an alternative home for my tutorials. It’s called PeerTube. PeerTube is video sharing software but contrary to YouTube, it is open source. In addition it’s also decentralized and federated.

This means that anyone can create a PeerTube server and host videos. These servers can connect to each other and share the videos between them (federation). As a result there is no single owner of the network. If the server that I joined fails or I don’t like the policy on that server I can either upload my videos to another server or even start my own.

I already have some content on PeerTube and I’ll upload new videos to PeerTube. However it’s unlikely that I’ll upload my older videos to it. I figure that they are less relevant anyway. I’ll put a link in the description to the new home of my videos and I hope to see you there.

I hope to see you on PeerTube and keep using open source software.

Here is a link to the new home of my 3D CAD videos: https://peertube.linuxrocks.online/video-channels/homehack/videos

If your interested in the network protocol behind PeerTube and other decentralized services here is link to a post that I wrote about it: https://homehack.nl/activitypub-the-secret-weapon-of-the-fediverse/

Lastly a link to a post that I wrote about the other problems that I had with YouTube: https://homehack.nl/activitypub-the-secret-weapon-of-the-fediverse/

Categories
3D modeling 3d printing open source

My videos remastered on PeerTube

I wrote earlier about my move from YouTube versus PeerTube. My new videos will appear on both platforms but I’m also remastering my old Solvespace videos. These videos were all 720p which isn’t ideal for a tutorial. Having most of the material of the videos available I’m recreating them in 1080p. When I’m done I’ll only upload these HD videos to PeerTube. The videos take a lot of time to create and I’m currently very busy so the videos appear irregularly but whenever I have time I’ll make them.

The latest video that I remastered is about the Geneva Drive. A wonderful project to design and 3d print. I redid part of the screen recording because either the original was gone or wasn’t good enough. For this video I used the latest version of OpenShot (v2.5.0) but I’m unfortunately still having issues with this video editor. For the next video I’ll return to Shotcut which is currently my favourite free and open source editor. Here is a link to the video if you want to see it on PeerTube.

When I tried to embed a PeerTube video here I found that the WordPress embed block is not suitable for this purpose. Apparently PeerTube is not (yet) whitelisted by WordPress. Also it appears that iframe tags, my other option, are blocked by WordPress because of security reasons. That’s a bummer.

Categories
3D modeling 3d printing

The BQ Hephestos2 (3D printer), nine months later

Introduction

It’s been nine months since I received and assembled my BQ Hephestos 2 printer and I think it’s time to share some of the experiences that I had with it. For those who don’t know the Hephesthos 2 it’s a 3D-printer that is based on the Prusa i3 design with a thick steel frame and almost all metal parts. It’s not cheap but it’s a well designed, high quality 3D-printer with a large printbed. It does have it’s shortcomings but more of that later.

Categories
3D modeling

Switching from FreeCAD to Solvespace?

Introduction

For my current project, a laser engraver, I initially choose FreeCAD as my 3D CAD program. I had some excellent experiences with it so it was the obvious choice for me. However contrary to previous work this project required a lot of CAD assembly. This is where I became frustrated with FreeCAD. Assembly in the current version (0.16) just isn’t well implemented unnecessarily extending my time spent with FreeCAD. The next version of FreeCAD (0.17) will have a separate assembly workbench but I wasn’t willing to wait for it’s final release.

When reading the Hackaday website I came across Solvespace. Given the problem that I have with FreeCAD I was immediately interested. Solvespace is a parametric modeler just like FreeCAD. The interface looks archaic which put me off a little at first but I found it surprisingly easy to work with. The last month I worked intensely with Solvespace v2.1 and I want to share the experience that I had with the program.

The Solvespace GUI looks archaic but is easy to work with.

Working with Solvespace

Solvespace is a lightweight program. It loads fast and runs very smooth on my aging iMac (5 years old). I have encountered an occasional crash with Solvespace however FreeCAD appears to be more prone to crashes on my iMac. I also noticed a small delay in Solvespace while dragging parts around in a complex assembly.

The Solvespace user interface is static throughout the program whether working in a 2D sketch, an extrude or an assembly. The GUI and the keyboard shortcuts don’t change throughout the program. This means for instance that constraints can be applied the same way in 2D and 3D making it easy to work with Solvespace. FreeCAD on the other hand has a dynamic user interface with multiple workbenches each having a different tool bar and functionality. I found that each FreeCAD workbench has it’s own learning curve making it harder to learn than Solvespace. With all these workbenches however FreeCAD offers much more functionality than Solvespace

Solvespace allows the model to be dynamically manipulated as long as it’s not fully constraint, both in 2D and 3D. This can be very helpful while studying a model or looking for its best shape. This is impossible in FreeCAD or OpenSCAD where a model can only be changed by entering other discrete values for the parameters (not to be confused with the animation options in OpenSCAD and FreeCAD).

Assembly in Solvespace is very easy often taking only a few mouse clicks. Two parts must be oriented and constrained to the same direction. A point of each part is selected and the parts are connected at the selected points. That’s it. This method works fast and I haven’t encountered any problem with it. When working in an assembly of multiple files a change made in one of the files propagates to the assembly. This is a very powerful features when working with complex models because it’s creates a consistent environment where it’s sufficient to make a change once instead of keeping track of multiple files. Apparently FreeCAD has a similar feature but getting it to work is far from trivial for me.

The laser engraver that I’m working on. It’s a rather complex project mith multiple parts but assembly is real easy in Solvespace.

Other 3D CAD programs offer functionality like chamfer and fillet. Solvespace doesn’t have this and that’s a shortcoming. Often chamfer and fillet are used for aesthetics and if necessary I can do without that however if you do need them regularly Solvespace isn’t for you. It also impossible to extrude along a path a functionality that is for instance used to create a thread. Creating a true thread is therefore impossible however if it is able to mimic a thread by drawing a sawtooth sketch and revolve it.

I 3d-printed numerous models that I had designed with Solvespace. I exported the models as .stl files and used Cura to create the nessecay G-code before printing them. I encountered no problems with this workflow and all prints came out as expected. I therefore conclude that Solvespace is a good companion for 3d-printers as long as the shortcomings of the program are taken into account.

Support

Community support is very important in open source software.  Whether you’re a beginner, intermediate of experienced user it’s vital to be able to get help. This can be tutorials, forums, irc or mailing list. Solvespace has support although it’s not as abundant as with FreeCAD. This is probably due to the smaller user base of Solvespace. The Solvespace tutorials are good but they are few in number and the documentation is adequate but not as polished as FreeCAD’s.

An active development of the program is also important not only for bug fixing but also with new features in new releases. Solvespace has a small but active developers team which is fine but it also makes the project vulnerable. If the main developer decides to abandon the project the user is left empty handed. FreeCAD appears to be having a much larger group of active developers decreasing the chance that the project will be abandoned.

Solvespace’s forum is a good place to post questions about the program. Replies are quick and to the point.

Conclusion

I really like Solvespace, it’s lightweight, pretty stable and easy to use (especially if the user is familiar with the concept of sketching with geometric constraints). I was able to create my models very quickly. I used the keyboard shortcuts often. They are easy to learn because they are limited in number and are consistent throughout the program. Besides the limitations such as fillet, chamfer and extrude along path, Solvespace lacks a lot of the nice-to-have (or need-to-have for some) features that are available in FreeCAD such as the path-, arch- and drawing workbench. This may not be a problem for many more casual users because Solvespace is focused on geometric constraint solving and assembly.

Solvespace is a good addition to the existing open source 3D CAD programs such as OpenSCAD and FreeCAD. It’s not a FreeCAD replacement because it lacks a lot of the features that come with FreeCAD. However if you want to try a truly free 3D CAD program but are intimidated by FreeCAD because of it’s steep learning curve and OpenSCAD because of programmers-like approach certainly should give Solvespace a try.

I made a series of video tutorials and CAD challenges. You can find them on YouTube with the links below:

Categories
3D modeling 3d printing

Make a Photography Light Box of cheap material (part 1: design and 3d print).

Introduction

My wife has a lot of stuff she wants to sell online and asked me to create a sturdy but cheap Photography Light Box. The dimensions of the different objects vary, so I wanted to be flexible with the dimensions of the light box. We came up with a simple idea to create a three way connector that connects curtain rods. The frame will be covered with white bed sheet cloth kept together with velcro. At the local hardware store I found plastified steel curtain rods. These were the cheapest I could find but are still very strong.

Categories
3D modeling laser cutting woodworking

DIY Lego Cabinet

Introduction

My sons have large Lego minifig collections but most of it is lying in a large box. The older son wanted a cabinet so he could display (part of) his collection better. These cabinets can be pricey so I decided to make one myself. I’ve done some laser cut projects recently, such as the Darth Vader Chest Box and the Valentine’s Heart, so I decided to use the same technique for the cabinet.

Categories
3D modeling 3d printing

Using Filaflex to improve my cooler

Introduction

A week ago I finished my audio cooler. Although I was happy with the result improvements could be made (as is always the case). Most important I didn’t particularly like the console on the side of the coolers lid. This was a 3d printed part of PLA that I glued to cooler with a superglue. This was far from ideal because of the space left between the printed console and the cooler . Another improvement could be made by the way that the speaker was fitted to the lid of the cooler. The speaker was directly attached to cooler with four screws again leaving some space between the two. I already had some FilaFlex filament but hadn’t used it yet. Because of the elastic and flexible properties of Filaflex I figured that I could both fix the issues with the console and the speaker.

Left the cooler with improved speaker and console and right "old cooler" with printed part of PLA filament.
Left the cooler with improved speaker and console and right “old cooler” with printed part of PLA filament.