How can I make a phase on a cube just on on side

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

How can I make a phase on a cube just on on side

ats3788
Hello
How can I make a phase on a cube just on on side ?
minkowski() is a powerful function but with no control on witch border you
like to have a phase.



--
Sent from: http://forum.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: How can I make a phase on a cube just on on side

shadowwynd
You can't use minkowski()  this way.  By definition, it is impossible to get
an accurate "cube" with only one side rounded.

I normally use hull() to get a rounded "cubish" thing.  See the code and
example below.

----------------------

// Cube with rounded face

dim = [100, 50, 40];

corner_r = 10;
grain = 1;

// Top edges and corners rounded, but spills onto the sides
hull()
{
        // Define lower side of cube
        translate ([0, 0, 0]) cube (grain);
        translate ([dim.x - grain, 0, 0]) cube (grain);
        translate ([dim.x - grain, dim.y-grain, 0]) cube (grain);
        translate ([0, dim.y-grain, 0]) cube (grain);

        // Rounded face
        translate ([0+corner_r, 0+corner_r, dim.z-corner_r]) sphere (r=corner_r);
        translate ([dim.x-corner_r, 0+corner_r, dim.z-corner_r]) sphere
(r=corner_r);
        translate ([dim.x-corner_r, dim.y-corner_r, dim.z-corner_r]) sphere
(r=corner_r);
        translate ([0+corner_r, dim.y-corner_r, dim.z-corner_r]) sphere
(r=corner_r);

}

// Create a rounded cube, but a flat bottom
translate ([-dim.x-10, 0, 0])
{
        hull()
        {
                // Define lower side of cube
                linear_extrude(1)
                {
                       
                        translate ([0+corner_r, 0+corner_r, 0]) circle (r=corner_r);
                        translate ([dim.x-corner_r, 0+corner_r, 0]) circle (r=corner_r);
                        translate ([dim.x-corner_r, dim.y-corner_r, 0]) circle (r=corner_r);
                        translate ([0+corner_r, dim.y-corner_r, 0]) circle (r=corner_r);
                }

                // Rounded top face
                translate ([0+corner_r, 0+corner_r, dim.z-corner_r]) sphere (r=corner_r);
                translate ([dim.x-corner_r, 0+corner_r, dim.z-corner_r]) sphere
(r=corner_r);
                translate ([dim.x-corner_r, dim.y-corner_r, dim.z-corner_r]) sphere
(r=corner_r);
                translate ([0+corner_r, dim.y-corner_r, dim.z-corner_r]) sphere
(r=corner_r);

        }
}

------------------

<http://forum.openscad.org/file/t486/roundedCube.png>



--
Sent from: http://forum.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: How can I make a phase on a cube just on on side

ats3788
Thank you very much
I don't understand in the Moment how that works but I try !!!



--
Sent from: http://forum.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: How can I make a phase on a cube just on on side

shadowwynd
Hull works by wrapping smaller shapes as if with plastic wrap for food.

For a cube, this means putting eight shapes (One for each corner).

> On May 3, 2019, at 8:08 AM, ats3788 <[hidden email]> wrote:
>
> Thank you very much
> I don't understand in the Moment how that works but I try !!!
>
>
>
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> 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: How can I make a phase on a cube just on on side

adrianv
If you're willing to use a library I suggest this solution with the Belfry
OpenSCAD Library available at
https://github.com/revarbat/BOSL which will let you round any edges you want
on a cube.  


include<lib/BOSL/shapes.scad>
include<lib/BOSL/constants.scad>

$fn=36;
cuboid([10,10,10], fillet=2, edges=EDGES_TOP);   // just top edges rounded
right(15)cuboid([10,10,10], fillet=2, edges=EDGES_ALL-EDGES_BOTTOM);   //
all but the bottom
right(30)cuboid([10,10,10], fillet=2, edges=EDGE_RT_FT);   // just one edge

<http://forum.openscad.org/file/t2477/roundedcube.png>




--
Sent from: http://forum.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: How can I make a phase on a cube just on on side

ats3788
Tank you thank you that is awesome !!!!!!



--
Sent from: http://forum.openscad.org/

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