Benutzer-Werkzeuge

Webseiten-Werkzeuge


quader_mit_abgerundeten_kanten

Dies ist eine alte Version des Dokuments!


Abgerundeten Kanten

1. Variante

// You could simply do it this way if you have the boxes.scad
// file in your library
//use <boxes.scad>
//roundedBox([20, 30, 25], 5, true); 
 
// Or, you could do it this way if you want to roll your own
 
roundedRect([20, 30, 25], 5, $fn=64);
 
// size - [x,y,z]
// radius - radius of corners
module roundedRect(size, radius)
{
	x = size[0];
	y = size[1];
	z = size[2];
 
	linear_extrude(height=z)
	hull()
	{
		// place 4 circles in the corners, with the given radius
		translate([(-x/2)+(radius/2), (-y/2)+(radius/2), 0])
		circle(r=radius);
 
		translate([(x/2)-(radius/2), (-y/2)+(radius/2), 0])
		circle(r=radius);
 
		translate([(-x/2)+(radius/2), (y/2)-(radius/2), 0])
		circle(r=radius);
 
		translate([(x/2)-(radius/2), (y/2)-(radius/2), 0])
		circle(r=radius);
	}
}

2. Variante

Mit hull

$fn=50;
roundedcube(100,100,100,10);
 
module roundedcube(xdim ,ydim ,zdim,rdim){
hull(){
    translate([rdim,rdim,0])cylinder(h=zdim,r=rdim);
    translate([xdim-rdim,rdim,0])cylinder(h=zdim,r=rdim);
 
    translate([rdim,ydim-rdim,0])cylinder(h=zdim,r=rdim);
    translate([xdim-rdim,ydim-rdim,0])cylinder(h=zdim,r=rdim);
}
}
quader_mit_abgerundeten_kanten.1542549881.txt.gz · Zuletzt geändert: 2023/03/02 21:05 (Externe Bearbeitung)