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

# Round to square connector

## by kitwallace, published Feb 14, 2013

Round to square connector Feb 14, 2013
0 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

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

# Instructions

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

view more

# All Apps

Upgrade this Thing with Thingiverse Apps

Customization

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.

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:
eps=0.1;
module connector(h,d,w1,w2) {
hull(){
cylinder(r=d/2,h=eps);
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);
translate([0,0,-eps])
connector(h + 2 * eps,d-t,w1-t,w2-t);
}
};
connector_tube(30,20,15,20,2);

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

kitwallace - in reply to

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.

fma - in reply to kitwallace

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

misan - in reply to

hull(){

cylinder(r=10,h=1);

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

}

misan - in reply to misan

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

kitwallace - in reply to

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

fma - in reply to kitwallace

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

kitwallace - in reply to

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

Top