Hey! This thing is still a Work in Progress. Files, instructions, and other stuff might change!

Round to square connector

by kitwallace, published

Round to square connector by kitwallace Feb 14, 2013


Liked By

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

Thing Statistics

2668Views 591Downloads Found in Replacement Parts


This provides a connector between a square-ended tube and a round-ended tube. It is an application of the superellipse http://en.wikipedia.org/wiki/Superellipse. The script makes use of the fact that the superellipse family of curves encompassed both a square and a circle, so smooth morphing between the two can be achieved parametrically. The derivation of the script is discussed in my blog http://kitwallace.posterous.com/piet-hein-and-the-superegg


  • Generation time is long for higher numbers of layers
  • Not yet proved by printing

More from Replacement Parts

view more

All Apps

Upgrade this Thing with Thingiverse Apps


Edit, personalize, or revise this Thing

Customizer is the easiest way to take great 3D printable designs and make them your own. Make your OpenSCAD designs infinitely more valuable by empowering the community to customize them.

App Info Launch App
Customizer Thing App

This is almost exactly what I need (which is actually a rectangle to round tube connector). Thanks. Quick question from a first time user: are the units in mm ?

units are undefined in OpenSCAD and in STL and are determined by the sofware which translates to gcode - however I always think in terms of mm.
for your connector I think this would be simpler:
module connector(h,d,w1,w2) {
translate([0,0,h-eps]) cube([w1,w2,eps],center=true);
module connector_tube(h,d,w1,w2,t) {
difference () {
connector (h,d,w1,w2);
connector(h + 2 * eps,d-t,w1-t,w2-t);

This new version seems to works much better!
Ok, next step: square/rectangle-to-circle/ellipse connector! That would be great if we could choose the exact shape of input and output, but I don't know if the maths can allow that...

Thanks - problem is that the square section becomes a lozenge rather than a rectangle when eccentricity ne 1 - however I could go rectangle -square - ellipse but not sure it will look nice with the additional transition - working on it..

Well, this seemed like a good idea at the time, but thinking about it a bit more, a better way to achieve the same effect would be to use hull() between a square and a circle, both extruded a tad (TAD = 0.01;) Faster and more generic.

Could you give an example? I don't understand how it works...



translate([0,0,30]) cube([20,20,1],center=true);


for a hollow duct, scale the above down a bit (only x and y) and then do the difference and you have a hollow duct. circle to square.

Well maybe this approach has merit after all , now the thickness issue has been improved.

Excellent! But I think that 'square_side' should be devided by 2...

You are so right - actually it was a sin upsidedown which came to the same thing.

The script also says that the round diameter and square side are internal ones, but they are in fact external ones.

Thanks again - I've now redone the approach to thicknessing which I hope is more satisfactory.