mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-07-31 12:00:23 +02:00
refactored
This commit is contained in:
@@ -17,15 +17,20 @@ include <__private__/__half_trapezium.scad>;
|
|||||||
|
|
||||||
module rounded_cylinder(radius, h, round_r, convexity = 2, center = false) {
|
module rounded_cylinder(radius, h, round_r, convexity = 2, center = false) {
|
||||||
r_corners = __half_trapezium(radius, h, round_r);
|
r_corners = __half_trapezium(radius, h, round_r);
|
||||||
|
|
||||||
|
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])
|
translate(center ? [0, 0, 0] : [0, 0, h/2])
|
||||||
rotate(180)
|
rotate(180)
|
||||||
rotate_extrude(convexity = convexity)
|
rotate_extrude(convexity = convexity)
|
||||||
polygon(
|
polygon(shape_pts);
|
||||||
concat(
|
|
||||||
[[0, -h/2]],
|
|
||||||
r_corners,
|
}
|
||||||
[[0, h/2]]
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
Reference in New Issue
Block a user