1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 14:18:13 +01:00

refactored

This commit is contained in:
Justin Lin 2017-05-12 15:25:13 +08:00
parent 59c0e076fe
commit 1c96182532

View File

@ -13,6 +13,7 @@
include <__private__/__is_vector.scad>;
include <__private__/__frags.scad>;
include <__private__/__nearest_multiple_of_4.scad>;
module rounded_cube(size, corner_r, center = false) {
is_vt = __is_vector(size);
@ -20,10 +21,7 @@ module rounded_cube(size, corner_r, center = false) {
y = is_vt ? size[1] : size;
z = is_vt ? size[2] : size;
frags = __frags(corner_r);
remain = frags % 4;
corner_frags = (remain / 4) > 0.5 ? frags - remain + 4 : frags - remain;
corner_frags = __nearest_multiple_of_4(__frags(corner_r));
edge_d = corner_r * cos(180 / corner_frags);
half_x = x / 2;