Loading
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

Description

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

Recent Comments

view all
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 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 ?
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.

More from Replacement Parts

view more

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

Instructions

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

<p>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 ?</p>

<p>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.</p><p>for your connector I think this would be simpler:<br>eps=0.1;</p><p>module connector(h,d,w1,w2) {<br> hull(){<br> cylinder(r=d/2,h=eps);<br> translate([0,0,h-eps]) cube([w1,w2,eps],center=true);<br> }<br>}</p><p>module connector_tube(h,d,w1,w2,t) {<br>difference () { <br>connector (h,d,w1,w2);<br> translate([0,0,-eps])<br> connector(h + 2 * eps,d-t,w1-t,w2-t);<br> }<br>};</p><p>connector_tube(30,20,15,20,2);</p>

<p>This new version seems to works much better!<br>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...</p>

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

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

<p>Could you give an example? I don't understand how it works...</p>

misan - in reply to fma

<p>hull(){</p>

<p>cylinder(r=10,h=1);</p>

<p>translate([0,0,30]) cube([20,20,1],center=true);</p>

<p>}</p>

misan - in reply to misan

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

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

<p>Excellent! But I think that 'square_side' should be devided by 2...</p>

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

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

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

Top