Welcome! Log In Create A New Profile

Advanced

How do you round the inside walls of a cube?

Posted by appjaws1 
How do you round the inside walls of a cube?
February 13, 2015 01:00PM
I recently posted about constructing a triangle with rounded sides and ends.

This is my new problem:-

If I cut a cube out of a solid block, How can I make the sides rounded, like the rounded cube or triangle but the roundness in the reverse direction.?

As always, any help gratefully received.


appjaws - Core XYUV Duet Ethernet Duex5
firmware 3.1.1 Web Interface 3.1.1
Ormerod 1-converted to laser engraver, Duet wifi
OpenSCAD version 2020.07
slic3r-1.3.0, Simplify3D 4.1.2, Cura-4.4.1
Re: How do you round the inside walls of a cube?
February 13, 2015 03:34PM
I would subtract cylinders that I placed on all ribs :-)


www.3daybreaker.blogspot.com

Orca V4.4 rebuild to Ramps with Mk8 and E3D, as well as a Rostock Delta Mini and an OLO in backorder :-)
Re: How do you round the inside walls of a cube?
February 13, 2015 11:43PM
You can make a rounded cube by putting a hull around 8 spheres
hull () 
    for (i=[-1, 1], j=[-1, 1], k=[-1, 1])
        translate([i*10, j*10,k*10])
            sphere(r=5):

And then subtract that from your larger object.by

Be careful with your value for $fn - this will be an expensive object to render if you use too high resolution.

Edited 1 time(s). Last edit at 02/13/2015 11:45PM by jbernardis.
Re: How do you round the inside walls of a cube?
February 14, 2015 10:56AM
Thank you very much for your replies.

I didn't explain very well what the requirement was, I hope the pictures will help to explain.

This is an example of the reverse rounded cube that I would subtract from a larger item.


This is the result


So ideally I would like a module that I can pass length, width, height, and radius of edges, that I can use to cut from an object to produce rounded edges to that cut.

The way I constructed this example was to have 2 cylinders and a cube cut out at each face, I'm sure there must be a more elegant way to achieve this.

Again, thanks for any help.


appjaws - Core XYUV Duet Ethernet Duex5
firmware 3.1.1 Web Interface 3.1.1
Ormerod 1-converted to laser engraver, Duet wifi
OpenSCAD version 2020.07
slic3r-1.3.0, Simplify3D 4.1.2, Cura-4.4.1
Re: How do you round the inside walls of a cube?
February 14, 2015 03:23PM
You can use hull() between the two cylinders but you're probably not saving that much code-wise. Here's an example using a canonical cube:


Rounded_aperture(size=50, radius=5);

module Rounded_aperture(size, radius)
{
	ff = 0.05;	// CSG fudge factor

	difference()
	{
		cube(size=size+ff, center=true);

		for (i = [0:3])
			rotate([0, 0, i*90])
				hull()
				{
					translate([size/2, 0, size/2-radius]) rotate([90, 0, 0]) cylinder(h=size+2*ff, r=radius, center=true);
					translate([size/2, 0, radius-size/2]) rotate([90, 0, 0]) cylinder(h=size+2*ff, r=radius, center=true);
				}	
	}
}



Incidentally, if you're planning on printing an object with this kind of edge bevelling then you may want to investigate using extruded teardrops to help support the curves near the bed.
Re: How do you round the inside walls of a cube?
February 15, 2015 07:55AM
Thank you QuackingPlums

I have based my latest attempt on your code and produced a parametrised version to construct a rounded oblong of any size.

module Rounded_aperture(L,W,T,R,ST){
difference(){
translate([0,0,T/2])cube([L+2*R,W+2*R,T+ST],center=true);
for (i = [0:2:3]) rotate([0, 0, i*90]) hull(){
translate([L/2+R, 0, T-R]) rotate([90, 0, 0]) cylinder(h=W+2*R, r=R, center=true);
translate([L/2+R, 0, R]) rotate([90, 0, 0]) cylinder(h=W+2*R, r=R, center=true);
}
for (i = [1:2:3]) rotate([0, 0, i*90]) hull(){
translate([W/2+R, 0, T-R]) rotate([90, 0, 0]) cylinder(h=L+2*R, r=R, center=true);
translate([W/2+R, 0, R]) rotate([90, 0, 0]) cylinder(h=L+2*R, r=R, center=true);
}}}
Rounded_aperture(30,20,6,1.5,0.05);


This is so much more elegant that my other attempt and has a reduced line count

Thank you again for your support.


appjaws - Core XYUV Duet Ethernet Duex5
firmware 3.1.1 Web Interface 3.1.1
Ormerod 1-converted to laser engraver, Duet wifi
OpenSCAD version 2020.07
slic3r-1.3.0, Simplify3D 4.1.2, Cura-4.4.1
Re: How do you round the inside walls of a cube?
February 16, 2015 07:59AM
As QuackingPlums has mentioned, you will almost certainly have problems printing anything with a rounded base edge, because unless the radius of the rounding is extremely small the print starts with too large an overhang. Even a small radius rounding tends to cause perimeter curl-up that will ruin the print.

Dave
Re: How do you round the inside walls of a cube?
July 08, 2015 05:27AM
I would recommend reading up on normals and how colliders work, because an underlying understanding of these things will help you in your future endeavors. Another concept is closed meshes. So the cube is a closed mesh. In most cases, when working in games, you want to view closed meshes from the outside, and their normals should point outward (not always the case by the way, as take for instance a sky cube where the walls of the cube surround you and the normals all point inward).

Anyway, for the case of a standard cube, its normals point outward, it is closed, and the surrounding collider is the same way in that it is closed (imagine its normals would point out, if it had them). Normals are mainly used for light calculations, but they provide an understanding of closed space as well. Entities that interact with the collider will only land on the outside of it.

If you want to use the standard cube, consider getting an asset store plugin to invert the cube's normals (I would only do this if you plan to never leave the cube, and you may have to just create your own inverted normal cube in Blender, but if you're doing that, consider just creating a shell instead for the cube walls. A shell is when you give depth to all of the walls such that the inside of the cube is closed space as well as the outside. You could achieve this effect by creating a standard cube, then create a second standard cube but shrink it slightly, then invert its normals.). Then add a box collider to the scene and place it under your feet where the floor is. Add 4 additional colliders for each wall. This should get the effect you want. Good luck!
Re: How do you round the inside walls of a cube?
July 09, 2015 06:28AM
I don't think we can influence the normals in OpenSCAD - as you can see from the colouring, when we subtract one object from another the normals are facing the wrong way. When these faces are directly in contact with the 'outside' of the object there doesn't seem to be a problem but when the cavity is completely enclosed then some slicers don't understand the output and fill it in. I don't know if there is ever an intention to 'fix' this in OpenSCAD.
Sorry, only registered users may post in this forum.

Click here to login