BelfrySCAD / BOSL2

The Belfry OpenScad Library, v2.0. An OpenSCAD library of shapes, masks, and manipulators to make working with OpenSCAD easier. BETA
https://github.com/BelfrySCAD/BOSL2/wiki
BSD 2-Clause "Simplified" License
1.01k stars 115 forks source link

Rounded trapezoid #1422

Closed sonichy closed 7 months ago

sonichy commented 7 months ago

圆角梯形

revarbat commented 7 months ago
include <BOSL2/std.scad>
include <BOSL2/rounding.scad>
path = round_corners(trapezoid(w1=50, w2=70, h=50), r=10, closed=true);
polygon(path);
Screenshot 2024-04-26 at 9 24 54 AM
revarbat commented 7 months ago

Actually, I forgot that trapezoid already has rounding available.

include <BOSL2/std.scad>
trapezoid(w1=50, w2=70, h=50, rounding=10);
revarbat commented 7 months ago

And if you need to specify a different rounding per corner, you can give the rounding= a list of four radii, for quadrants I, II, III, and IV, in order. (X+Y+, X-Y+, X-Y-, X+,Y-, respectively.)

include <BOSL2/std.scad>
trapezoid(w1=50, w2=70, h=50, rounding=[5, 10, 15, 20]);
Screenshot 2024-04-26 at 9 31 31 AM