1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-07-31 12:00:23 +02:00

refactored

This commit is contained in:
Justin Lin
2017-06-01 09:19:12 +08:00
parent 67b25a0ab0
commit c10443641e

View File

@@ -18,14 +18,19 @@ include <__private__/__half_trapezium.scad>;
module rounded_cylinder(radius, h, round_r, convexity = 2, center = false) {
r_corners = __half_trapezium(radius, h, round_r);
translate(center ? [0, 0, 0] : [0, 0, h/2])
rotate(180)
rotate_extrude(convexity = convexity)
polygon(
concat(
shape_pts = concat(
[[0, -h/2]],
r_corners,
[[0, h/2]]
)
);
center_pt = center ? [0, 0, 0] : [0, 0, h/2];
translate(center ? [0, 0, 0] : [0, 0, h/2])
rotate(180)
rotate_extrude(convexity = convexity)
polygon(shape_pts);
}