Square to round transformation

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Square to round transformation

Sebastian Heyn
Hi guys,

I am new to openscad and 3d printing. My first project will be a fan mount - to mount a 120mm fan on a 110mm outside diameter pipe.

I have the fan mount set up but i wonder how I can design something that will reduce the square 120mm to 110mm round.

Any ideas?
Reply | Threaded
Open this post in threaded view
|

Re: Square to round transformation

nophead

Taking the convex hull of a square and a cylinder will give you the basic shape. Then subtract a smaller version to hollow it out.

On Nov 23, 2015 2:21 PM, "Sebastian Heyn" <[hidden email]> wrote:
Hi guys,

I am new to openscad and 3d printing. My first project will be a fan mount -
to mount a 120mm fan on a 110mm outside diameter pipe.

I have the fan mount set up but i wonder how I can design something that
will reduce the square 120mm to 110mm round.

Any ideas?



--
View this message in context: http://forum.openscad.org/Square-to-round-transformation-tp14712.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Square to round transformation

Hypher
Since getting started can be hard, here's a basic implementation of what it sounds like you want. Note that I didn't use your dimensions; you'll need to do plenty more work to make a usable part, but it should get you started. Good luck with your part.

circleRadius = 50;
circleHeight = 5;
squareSize = [100, 100, 5];
height = 80;
cutout = 0;

wallThickness = 10;
   
difference() {
    // Larger version of the part from which we will cut the hollow section, thus creating the walls
    adapter(
        circleRadius = circleRadius + wallThickness,
        circleHeight = circleHeight,
        squareSize = squareSize + [wallThickness*2, wallThickness*2, 0],
        height = height,
        cutout = 0
    );
   
    // Smaller cutout, to create the walls
    adapter(
        circleRadius = circleRadius,
        circleHeight = circleHeight,
        squareSize = squareSize,
        height = height,
        cutout = 1
    );
}


// A generic version of the part that we can reuse multiple times, both to create walls and if you wanted a different
// sized version in the same SCAD file.
module adapter(
    circleRadius,
    circleHeight,
    squareSize,
    height,
    cutout
) {
    // This creates the primary part -- the hull of a cylinder and a cube
    hull() {
        translate([0,0,squareSize.z/2]) cube(squareSize, center=true);
        translate([0,0,height-circleHeight]) cylinder(r=circleRadius, h=circleHeight, center=true);
    }

    // This extends the cylinder out the top, if that's desired
    translate([0,0,height]) cylinder(r=circleRadius, h=circleHeight+cutout, center=true);

    // This extends the square portion below the part if we are a cutout
    if (cutout > 0) {
        translate([0,0,-cutout]) cube([squareSize.x, squareSize.y, cutout+squareSize.z], center=true);
    }
}

November 23, 2015 at 06:53

Taking the convex hull of a square and a cylinder will give you the basic shape. Then subtract a smaller version to hollow it out.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
November 23, 2015 at 06:20
Hi guys,

I am new to openscad and 3d printing. My first project will be a fan mount -
to mount a 120mm fan on a 110mm outside diameter pipe.

I have the fan mount set up but i wonder how I can design something that
will reduce the square 120mm to 110mm round.

Any ideas?



--
View this message in context: http://forum.openscad.org/Square-to-round-transformation-tp14712.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Square to round transformation

Neon22
In reply to this post by Sebastian Heyn
or work on improving this one
http://www.thingiverse.com/thing:1015874