Skip to content

Commit bf7218d

Browse files
doc tweaks
1 parent 6d46c2c commit bf7218d

1 file changed

Lines changed: 22 additions & 22 deletions

File tree

distributors.scad

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@
2929
// Two workarounds exist, neither of which are needed in newer versions of OpenSCAD. The workarounds solve the problem because
3030
// **modules** execute after their parent, so the `$` variables **are** available in modules. You can put your assignments
3131
// in a `let()` module, or you can wrap your child in a `union()`. Both methods appear below.
32-
// ```
32+
// Figure(2D,NoScales): This example shows how we can use `$idx` to produce **different** geometry at each index.
3333
// xcopies(n=10, spacing=10)
3434
// text(str($idx));
35+
// Continues:
3536
// ```
36-
// Figure(2D): This example shows how we can use `$idx` to produce **different** geometry at each index.
3737
// xcopies(n=10, spacing=10)
3838
// text(str($idx));
39-
// Continues:
40-
// Figure(2D): Here the children are sometimes squares and sometimes circles as determined by the conditional `if` module. This use of `if` is OK because no variables are assigned.
39+
// ```
40+
// Figure(2D,NoScales): Here the children are sometimes squares and sometimes circles as determined by the conditional `if` module. This use of `if` is OK because no variables are assigned.
4141
// xcopies(n=4, spacing=10)
4242
// if($idx%2==0) circle(r=3,$fn=16);
4343
// else rect(6);
@@ -47,7 +47,7 @@
4747
// if($idx%2==0) circle(r=3,$fn=16);
4848
// else rect(6);
4949
// ```
50-
// Figure(2D): Suppose we would like to color odd and even index copies differently. In this example we compute the color for a given child from `$idx` using the ternary operator. The `let()` module is a module that sets variables and makes them available to its children. Note that multiple assignments in `let()` are separated by commas, not semicolons.
50+
// Figure(2D,NoScales): Suppose we would like to color odd and even index copies differently. In this example we compute the color for a given child from `$idx` using the ternary operator. The `let()` module is a module that sets variables and makes them available to its children. Note that multiple assignments in `let()` are separated by commas, not semicolons.
5151
// xcopies(n=6, spacing=10){
5252
// let(c = $idx % 2 == 0 ? "red" : "green")
5353
// color(c) rect(6);
@@ -59,7 +59,7 @@
5959
// color(c) rect(6);
6060
// }
6161
// ```
62-
// Figure(2D): This example shows how you can change the position of children adaptively. If you want to avoid repeating your code for each case, this requires storing a transformation matrix in a variable and then applying it using `multmatrix()`. We wrap our code in `union()` to ensure that it works in OpenSCAD 2021.01.
62+
// Figure(2D,NoScales): This example shows how you can change the position of children adaptively. If you want to avoid repeating your code for each case, this requires storing a transformation matrix in a variable and then applying it using `multmatrix()`. We wrap our code in `union()` to ensure that it works in OpenSCAD 2021.01.
6363
// xcopies(n=5,spacing=10)
6464
// union()
6565
// {
@@ -72,9 +72,9 @@
7272
// xcopies(n=5,spacing=10)
7373
// union()
7474
// {
75-
// shiftback = $idx%2==0 ? back(5) : IDENT;
75+
// shiftback = $idx%2==0 ? back(10) : IDENT;
7676
// spin = zrot(180*$idx/4);
77-
// multmatrix(shiftback*spin) stroke([[-4,0],[4,0]],endcap2="arrow2",width=1/2);
77+
// multmatrix(shiftback*spin) stroke([[-4,0],[4,0]],endcap2="arrow2",width=3/4,color="red");
7878
// }
7979
// ```
8080

@@ -473,31 +473,31 @@ function zcopies(spacing, n, l, sp, p=_NO_ARG) =
473473
// See Also: move_copies(), xcopies(), ycopies(), zcopies(), line_copies(), rot_copies(), xrot_copies(), yrot_copies(), zrot_copies(), arc_copies(), sphere_copies()
474474
//
475475
// Examples:
476-
// line_copies(10) sphere(d=1);
477-
// line_copies(10, n=5) sphere(d=1);
478-
// line_copies([10,5], n=5) sphere(d=1);
479-
// line_copies(spacing=10, n=6) sphere(d=1);
480-
// line_copies(spacing=[10,5], n=6) sphere(d=1);
481-
// line_copies(spacing=10, l=50) sphere(d=1);
482-
// line_copies(spacing=10, l=[50,30]) sphere(d=1);
483-
// line_copies(spacing=[10,5], l=50) sphere(d=1);
484-
// line_copies(l=50, n=4) sphere(d=1);
485-
// line_copies(l=[50,-30], n=4) sphere(d=1);
476+
// line_copies(10) sphere(d=1.5);
477+
// line_copies(10, n=5) sphere(d=3);
478+
// line_copies([10,5], n=5) sphere(d=3);
479+
// line_copies(spacing=10, n=6) sphere(d=3);
480+
// line_copies(spacing=[10,5], n=6) sphere(d=3);
481+
// line_copies(spacing=10, l=50) sphere(d=3);
482+
// line_copies(spacing=10, l=[50,30]) sphere(d=3);
483+
// line_copies(spacing=[10,5], l=50) sphere(d=3);
484+
// line_copies(l=50, n=4) sphere(d=3);
485+
// line_copies(l=[50,-30], n=4) sphere(d=3);
486486
// Example(FlatSpin,VPD=133):
487-
// line_copies(p1=[0,0,0], p2=[5,5,20], n=6) cube(size=[3,2,1],center=true);
487+
// line_copies(p1=[0,0,0], p2=[5,5,20], n=6) cuboid([3,2,1]);
488488
// Example(FlatSpin,VPD=133):
489-
// line_copies(p1=[0,0,0], p2=[5,5,20], spacing=6) cube(size=[3,2,1],center=true);
489+
// line_copies(p1=[0,0,0], p2=[5,5,20], spacing=6) cuboid([3,2,1]);
490490
// Example: All children are copied to each position
491491
// line_copies(l=20, n=3) {
492492
// cube(size=[1,3,1],center=true);
493493
// cube(size=[3,1,1],center=true);
494494
// }
495495
// Example(2D): The functional form of line_copies() returns a list of transform matrices.
496496
// mats = line_copies([10,5],n=5);
497-
// for (m = mats) multmatrix(m) circle(d=2);
497+
// for (m = mats) multmatrix(m) circle(d=3);
498498
// Example(2D): The functional form of line_copies() returns a list of points if given a point.
499499
// pts = line_copies([10,5],n=5,p=[0,0,0]);
500-
// move_copies(pts) circle(d=2);
500+
// move_copies(pts) circle(d=3);
501501

502502
module line_of(spacing, n, l, p1, p2) {
503503
deprecate("line_copies");

0 commit comments

Comments
 (0)