mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-08-14 01:14:31 +02:00
doc fixes
This commit is contained in:
@@ -572,13 +572,13 @@ case.
|
||||
```openscad-3D
|
||||
include <BOSL2/std.scad>
|
||||
cube(50,center=true)
|
||||
attach(RIGHT)cylinder(d1=30,d2=15,l=25);
|
||||
attach(RIGHT)cylinder(d1=30,d2=15,h=25);
|
||||
```
|
||||
|
||||
```openscad-3D
|
||||
include <BOSL2/std.scad>
|
||||
cube(50,center=true)
|
||||
attach(RIGHT+TOP)cylinder(d1=30,d2=15,l=25);
|
||||
attach(RIGHT+TOP)cylinder(d1=30,d2=15,h=25);
|
||||
```
|
||||
|
||||
In the second example, the child object points diagonally away
|
||||
|
@@ -9,7 +9,7 @@ Firstoff, include the BOSL2 library, then make a starting module that just has a
|
||||
```openscad-3D
|
||||
include <BOSL2/std.scad>
|
||||
module tree(l=1500, sc=0.7)
|
||||
cylinder(l=l, d1=l/5, d2=l/5*sc);
|
||||
cylinder(h=l, d1=l/5, d2=l/5*sc);
|
||||
tree();
|
||||
```
|
||||
|
||||
@@ -20,9 +20,9 @@ You can attach a branch to the top of the trunk by using `attach()` as a child o
|
||||
```openscad-3D
|
||||
include <BOSL2/std.scad>
|
||||
module tree(l=1500, sc=0.7)
|
||||
cylinder(l=l, d1=l/5, d2=l/5*sc)
|
||||
cylinder(h=l, d1=l/5, d2=l/5*sc)
|
||||
attach(TOP)
|
||||
yrot(30) cylinder(l=l*sc, d1=l/5*sc, d2=l/5*sc*sc);
|
||||
yrot(30) cylinder(h=l*sc, d1=l/5*sc, d2=l/5*sc*sc);
|
||||
tree();
|
||||
```
|
||||
|
||||
@@ -33,10 +33,10 @@ Instead of attaching each branch individually, you can make multiple copies of o
|
||||
```openscad-3D
|
||||
include <BOSL2/std.scad>
|
||||
module tree(l=1500, sc=0.7)
|
||||
cylinder(l=l, d1=l/5, d2=l/5*sc)
|
||||
cylinder(h=l, d1=l/5, d2=l/5*sc)
|
||||
attach(TOP)
|
||||
zrot_copies(n=2) // Replicate that branch
|
||||
yrot(30) cylinder(l=l*sc, d1=l/5*sc, d2=l/5*sc*sc);
|
||||
yrot(30) cylinder(h=l*sc, d1=l/5*sc, d2=l/5*sc*sc);
|
||||
tree();
|
||||
```
|
||||
|
||||
@@ -47,7 +47,7 @@ Since branches look much like the main trunk, we can make the tree recursive. Do
|
||||
```openscad-Med
|
||||
include <BOSL2/std.scad>
|
||||
module tree(l=1500, sc=0.7, depth=10)
|
||||
cylinder(l=l, d1=l/5, d2=l/5*sc)
|
||||
cylinder(h=l, d1=l/5, d2=l/5*sc)
|
||||
attach(TOP)
|
||||
if (depth>0) { // Important!
|
||||
zrot_copies(n=2)
|
||||
@@ -63,7 +63,7 @@ A flat planar tree isn't what we want, so lets bush it out a bit by rotating eac
|
||||
```openscad-Med
|
||||
include <BOSL2/std.scad>
|
||||
module tree(l=1500, sc=0.7, depth=10)
|
||||
cylinder(l=l, d1=l/5, d2=l/5*sc)
|
||||
cylinder(h=l, d1=l/5, d2=l/5*sc)
|
||||
attach(TOP)
|
||||
if (depth>0) {
|
||||
zrot(90) // Bush it out
|
||||
@@ -80,7 +80,7 @@ Let's add leaves. They look much like squashed versions of the standard teardrop
|
||||
```openscad-Big
|
||||
include <BOSL2/std.scad>
|
||||
module tree(l=1500, sc=0.7, depth=10)
|
||||
cylinder(l=l, d1=l/5, d2=l/5*sc)
|
||||
cylinder(h=l, d1=l/5, d2=l/5*sc)
|
||||
attach(TOP)
|
||||
if (depth>0) {
|
||||
zrot(90)
|
||||
@@ -104,7 +104,7 @@ nested `recolor()`.
|
||||
include <BOSL2/std.scad>
|
||||
module tree(l=1500, sc=0.7, depth=10)
|
||||
recolor("lightgray")
|
||||
cylinder(l=l, d1=l/5, d2=l/5*sc)
|
||||
cylinder(h=l, d1=l/5, d2=l/5*sc)
|
||||
attach(TOP)
|
||||
if (depth>0) {
|
||||
zrot(90)
|
||||
|
Reference in New Issue
Block a user