You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: distributors.scad
+23-11Lines changed: 23 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -814,7 +814,7 @@ function grid_copies(spacing, n, size, stagger=false, inside=undef, nonzero, p=_
814
814
// n = Optional number of evenly distributed copies, rotated around the axis.
815
815
// sa = Starting angle, in degrees. For use with `n`. Angle is in degrees counter-clockwise. Default: 0
816
816
// delta = [X,Y,Z] amount to move away from cp before rotating. Makes rings of copies. Default: `[0,0,0]`
817
-
// subrot = If false, don't sub-rotate children as they are copied around the ring. Only makes sense when used with `delta`. Default: `true`
817
+
// subrot = If false, don't sub-rotate children as they are copied around the ring. Instead maintain their native orientation. The false setting is only allowed when `delta` is given. Default: `true`
818
818
// p = Either a point, pointlist, VNF or Bezier patch to be translated when used as a function.
819
819
//
820
820
// Side Effects:
@@ -852,26 +852,23 @@ function grid_copies(spacing, n, size, stagger=false, inside=undef, nonzero, p=_
function rot_copies(rots=[], v, cp=[0,0,0], n, sa=0, offset=0, delta=[0,0,0], subrot=true, p=_NO_ARG) =
884
+
assert(subrot || norm(delta)>0, "subrot can only be false if delta is not zero")
887
885
let(
888
886
sang = sa + offset,
889
887
angs =!is_undef(n)?
@@ -897,7 +895,7 @@ function rot_copies(rots=[], v, cp=[0,0,0], n, sa=0, offset=0, delta=[0,0,0], su
897
895
translate(cp) *
898
896
rot(a=ang, v=v) *
899
897
translate(delta) *
900
-
rot(a=(subrot? sang : ang), v=v, reverse=true) *
898
+
rot(a=subrot? 0 : ang, v=v, reverse=true) *
901
899
translate(-cp)
902
900
]
903
901
)
@@ -939,6 +937,7 @@ function rot_copies(rots=[], v, cp=[0,0,0], n, sa=0, offset=0, delta=[0,0,0], su
939
937
// sa = Starting angle, in degrees. For use with `n`. Angle is in degrees counter-clockwise from Y+, when facing the origin from X+. First unrotated copy is placed at that angle.
940
938
// r = If given, makes a ring of child copies around the X axis, at the given radius. Default: 0
941
939
// d = If given, makes a ring of child copies around the X axis, at the given diameter.
940
+
// subrot = If false, don't sub-rotate children as they are copied around the ring. Instead maintain their native orientation. The false setting is only allowed when `d` or `r` is given. Default: `true`
942
941
// subrot = If false, don't sub-rotate children as they are copied around the ring.
943
942
// p = Either a point, pointlist, VNF or Bezier patch to be translated when used as a function.
@@ -1020,7 +1023,7 @@ function xrot_copies(rots=[], cp=[0,0,0], n, sa=0, r, d, subrot=true, p=_NO_ARG)
1020
1023
// sa = Starting angle, in degrees. For use with `n`. Angle is in degrees counter-clockwise from X-, when facing the origin from Y+.
1021
1024
// r = If given, makes a ring of child copies around the Y axis, at the given radius. Default: 0
1022
1025
// d = If given, makes a ring of child copies around the Y axis, at the given diameter.
1023
-
// subrot = If false, don't sub-rotate children as they are copied around the ring.
1026
+
// subrot = If false, don't sub-rotate children as they are copied around the ring. Instead maintain their native orientation. The false setting is only allowed when `d` or `r` is given. Default: `true`
1024
1027
// p = Either a point, pointlist, VNF or Bezier patch to be translated when used as a function.
@@ -1102,7 +1109,7 @@ function yrot_copies(rots=[], cp=[0,0,0], n, sa=0, r, d, subrot=true, p=_NO_ARG)
1102
1109
// sa = Starting angle, in degrees. For use with `n`. Angle is in degrees counter-clockwise from X+, when facing the origin from Z+. Default: 0
1103
1110
// r = If given, makes a ring of child copies around the Z axis, at the given radius. Default: 0
1104
1111
// d = If given, makes a ring of child copies around the Z axis, at the given diameter.
1105
-
// subrot = If false, don't sub-rotate children as they are copied around the ring. Default: true
1112
+
// subrot = If false, don't sub-rotate children as they are copied around the ring. Instead maintain their native orientation. The false setting is only allowed when `d` or `r` is given. Default: `true`
1106
1113
// p = Either a point, pointlist, VNF or Bezier patch to be translated when used as a function.
1107
1114
//
1108
1115
// Side Effects:
@@ -1137,13 +1144,18 @@ function yrot_copies(rots=[], cp=[0,0,0], n, sa=0, r, d, subrot=true, p=_NO_ARG)
0 commit comments