# boat propeller customizable - OpenSCAD nSpline() library with show cases

## by Parkinbot, published Dec 17, 2015

boat propeller customizable - OpenSCAD nSpline() library with show cases Dec 17, 2015
1 Share

View All

## Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag.

Print Thing Tag

# Summary

## nSpline

With this post I'm publishing my splines library. Its core function is nSpline(), which does an interpolation over a n-series of m-dimensional vectors each describing a 2D-shape, and calculates in-between values with arbitrary refinement.

The progamming technique behind it is very general, so you might find it useful for your stuff as well.

For example you feed the function with seven 4D-vectors given as a 7x4 array and ask it to return you a 100x4 array. It will interpolate you each of the 4 dimensions over the series of 100 vectors. But you could also feed it with a 10x8 array and receive a 200x8 array with each (!) of the 8 dimensions interpolated.
The m-dimensional vectors you can interpret along your needs, which means you have to provide a generator function doing that. Usally this function would use some part of such a vector to generate a parametrized 2D-shape and the other part to translate, rotate, scale, or even colorize this 2D-shape along some trajectory in 3D space. Just like a linear_extrude(), but with much more freedom - and at the price of much more self-responsibility.

For doing a sweep() upon any series of 2D shapes it is tremendously important that neither polygon decribing a 2D shape and neither two 2D shapes within the series self-intersect. Two 2D shapes may not even share a common vertex. OpenSCAD will not check the result of a sweep (which finally executes a polyhedron call) and currently even lets you export a non-manifold STL in some cases - so using this very mighty scheme is a bit like tightrope walking.

I have tested it with great success for several projects, mostly in the field of blade design, but not only. I use it mainly for extrusion with my own sweep() function provided in my Naca_Sweep library. You can also use it without any change with the new skin() function currently evaluated as future language feature by the dev team.

``````// usage scheme - n-dimensional natural cubic spline interpolation
A = [[...],[...],[...]]; // define Mxm matrix, M>2, m>1
B = nSplines(A, N);      // get interpolated Nxm matrix
C = gen_dat(B);          // interpret data as sequence of 2D-shapes
// and generate trajectory
sweep(B);                // extrude by knitting polyhedron object``````

As full blown examples to show the power of the approach I've designed

• a customizable boat propeller in boatprop.scad that uses airfoil data and some realistic modelling of twist, camber and pitch. It is composed of 4 well placed slices only, as the slices view shown in the second image reveals - the 4th slice is too small to be visible. This is the primary data fed to nSpline(). The outcome is swept into a full blown propeller blade.
• a horn in horn.scad as part of an instrument. The code uses a Boolean difference operation of an outer and an inner skin object.

For further code examples see the more basic knot() example in the splines.scad file (slow CGAL-rendering(!)) and

Extrusion functions offer you a lot of freedom, but also put responsibility on you

• you must avoid self-intersection of the extruded path. If self-intersection at some point is unavoidable you can try to split the array, sweep all parts separately and use a union().
• if you get assertion failures in CGAL rendering, check your design in Thrown Together view (F12) for wrongly (purple) colored triangles. In some cases you will have to just revert the vertex order of your 2D shapes, in others you might find self-intersections by closely examining the result in F5/F12 mode.

## More from Math

view more
Download All Files (8 mb zip file)

# All Apps

Auto-magically prepare your 3D models for 3D printing. A cloud based 3D models Preparing and Healing solution for 3D Printing, MakePrintable provides features for model repairing, wall thickness...

Kiri:Moto is an integrated cloud-based slicer and tool-path generator for 3D Printing, CAM / CNC and Laser cutting. *** 3D printing mode provides model slicing and GCode output using built-in...

KiriMoto Thing App

With 3D Slash, you can edit 3d models like a stonecutter. A unique interface: as fun as a building game! The perfect tool for non-designers and children to create in 3D.

Quickly Scale, Mirror or Cut your 3D Models

Is it possible to adjust it so that it's diameter is 20mm, shaft diameter 2mm and shaft height 7mm?

Can I do it myself in Blender?

In principle everything is possible. All the code for the design is written in OpenSCAD. Therefore I don't see any convenient way to alter design parameters in Blender.

I'm seriously a novice when it comes to OpenSCAD, but enjoy using it for simple models within my limited range of understanding. I've downloaded this amazing work of art and became immediately lost in the math.

Is there a way to identify the parameters that directly represent the diameter of the overall propeller as well as those that represent the pitch of the prop?

I have a friend who would like me to try to build a custom prop for his model boat and although I don't know the specifications, I expect he will provide a diameter of no more than 75 mm but I'm unsure of the desired pitch.

The code does not specify these items, although I did find the number of blades. That was just an easy and almost obvious guess.

The boat propreller is meant to give some example code for a quite sophisticated programming techique using interpolation. I never took the burden to 'translate' the code into a boat propreller construction set, having a customizable parameterset, including the parameters you ask. This would make the code more complex or give reason to compile another library.

As a OpenSCAD novice it might get bit challenging for you to understand in detail what is happening. As explained in the text, the approach just defines 4 airfoils (as 2D polygons) and puts them in 3D space. The rest is some Mathematical magic (spline interpolation that calculates intermediate airfoils in 3D space).

If you look into the code you'll find all parameters used in the matrix A. They describe the four airfoils (each row is one airfoil) and their placement in 3D space. The columns are commented. In detail they describe : TX, TY, TZ the translation, RX and RZ rotation, and L, X, XX the airfoil in Naca parameters.

The radius of the blade therefore is 660mm*sizing. To find out the pitch is not so easy and needs some more serious calculation for RX and RZ. To adopt the given pitch without this calculation you could try to scale the blade part (= for loop) in X and Z with some factor.

A good way to find out, what is going on in general, is to call boat_prop(1) and to carefully (!) play around with the numbers in A. You may also find it useful to put in more intermediate airfoils.

Hope this helps and you will have fun.

After a bit more digging, I found Prop-calc, an online calculator which provides blade angles based on pitch parameters. http://n-lemma.com/indoorrc/propcalc.htm

I'm hopeful I can make an association with pitch provided by the calculator and inject it into the OpenSCAD code.

It shouldn't be too difficult to give each of the four airfoils the pitch (angle) calculated for is radial position. But be prepared, there are many solutions and also a theoretical pitch is not a 'practical' pitch. Have a look at this. http://www.boats.com/how-to/understanding-propeller-pitch/

I read the first few episodes and videos and found it educational. It's easier when the boat is radio control and the propeller is made on a 3d printer! No need for adjustable pitch props, just make a slew of them with a wide range of pitch settings. I've yet to communicate with the friend, so I don't know how far this will go. It's a great brain exercise at the very least.

Thank you for your kind response. I very much appreciate your explanation, even though most of it escapes the confines of my alleged mind. I'm confident the friend who desires a prop for his model would have some problem with figuring out the development, despite having been a professional magician. "Any sufficiently advanced technology is indistinguishable from magic." (Arthur C. Clarke)

I understand that boat propeller pitch and aircraft propeller pitch are measured in the same manner, although the hydro- and aero-dynamics are different, obviously. I might be able to locate some reference material regarding blade angles at the stations of the blades, perhaps leading to a solution.

I found Matlab has OpenProp, but that's going from complex magic to complex magic tenfold for me.

I have another friend, our makerspace El Presidente who is quite good at OpenSCAD. Perhaps he can work his magic.

thanks again.

fred

Wonderful job. I'm trying to find out how to make the prop left hand.
Any hint?

the easiest way is to use the mirror operator:

...
mirror([0, 0, 1])
boat_prop(4);
...

Really COOL.
But please mind case in scad use < > links, Linux is case sensitive ;)

must be some time involved for these productions !

Top