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.

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.

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’.

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

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.

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 polarcoordinates to Cartesian coordinates.

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.

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.

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.

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, developmentsnapshotsare 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.

You must be logged in to post a comment.