1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-04-21 14:41:51 +02:00

fixed corner precision

This commit is contained in:
Justin Lin 2017-04-22 16:34:57 +08:00
parent 0e7af027aa
commit 0acb408174

View File

@ -16,9 +16,11 @@ module rounded_square(size, corner_r, center = false) {
($fn >= 3 ? $fn : 3) :
max(min(360 / $fa, corner_r * 2 * 3.14159 / $fs), 5);
quarter_frags = 360 / (frags + frags % 4);
step_a = 360 / (frags + frags % 4);
remain = frags % 4;
corner_frags = (remain / 4) > 0.5 ? frags - remain + 4 : frags - remain;
step_a = 360 / corner_frags;
x = len(size) == undef ? size : size[0];
y = len(size) == undef ? size : size[1];