32 lines
778 B
OpenSCAD
32 lines
778 B
OpenSCAD
|
|
include <Round-Anything-master/polyround.scad>
|
||
|
|
|
||
|
|
module rounded_rectangle(width, length, height, radius1, radius2) {
|
||
|
|
polyRoundExtrude([
|
||
|
|
[-width/2, -length/2, 1], // Bottom-left point
|
||
|
|
[-width/2, length/2, 1], // Top-left point
|
||
|
|
[width/2, length/2, 1], // Top-right point
|
||
|
|
[width/2, -length/2, 1] // Bottom-right point
|
||
|
|
], height, radius1, radius2);
|
||
|
|
}
|
||
|
|
|
||
|
|
/*
|
||
|
|
radiiPoints=[
|
||
|
|
[0, 0, 0.5],
|
||
|
|
[0, 5, 0.5],
|
||
|
|
[5, 0, 0.5],
|
||
|
|
[2, 0, 0.5],
|
||
|
|
[2, -3, 1],
|
||
|
|
[4, -3, 0],
|
||
|
|
[4, -5, 0],
|
||
|
|
[-2, -5, 0],
|
||
|
|
[-2, -3, 0],
|
||
|
|
[0, -3, 1]];
|
||
|
|
extrudeWithRadius(3,1,1,50)
|
||
|
|
polygon(polyRound(radiiPoints,30));
|
||
|
|
*/
|
||
|
|
|
||
|
|
// Usage examples
|
||
|
|
rounded_rectangle(10, 10, 4, -2, -2);
|
||
|
|
|
||
|
|
//extrudeWithRadius(5,-2,-2,50)square([5, 2]);
|