mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-02-19 01:59:39 +00:00
Tutorial fixes.
This commit is contained in:
parent
21083277b0
commit
4cb59d988e
3 changed files with 16 additions and 16 deletions
tutorials
|
@ -958,7 +958,7 @@ stellate_cube() show_anchors(50);
|
||||||
```openscad-3D
|
```openscad-3D
|
||||||
$fn=32;
|
$fn=32;
|
||||||
R = difference(circle(10), right(2, circle(9)));
|
R = difference(circle(10), right(2, circle(9)));
|
||||||
linear_sweep(R,height=10,anchor_isect=true)
|
linear_sweep(R,height=10,atype="hull")
|
||||||
attach(RIGHT) anchor_arrow();
|
attach(RIGHT) anchor_arrow();
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -151,7 +151,7 @@ stroke(path, closed=true, endcap2="arrow2");
|
||||||
```
|
```
|
||||||
|
|
||||||
```openscad-2D
|
```openscad-2D
|
||||||
path = oval(d=[50,30]);
|
path = ellipse(d=[50,30]);
|
||||||
stroke(path, closed=true, endcap2="arrow2");
|
stroke(path, closed=true, endcap2="arrow2");
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -164,7 +164,7 @@ circle(d=100);
|
||||||
circle(d=100, $fn=8);
|
circle(d=100, $fn=8);
|
||||||
```
|
```
|
||||||
|
|
||||||
The BOSL2 library also provides an enhanced equivalent of `circle()` called `oval()`.
|
The BOSL2 library also provides an enhanced equivalent of `circle()` called `ellipse()`.
|
||||||
You can use it in the same way you use `circle()`, but it also provides extended
|
You can use it in the same way you use `circle()`, but it also provides extended
|
||||||
functionality. For example, it allows more control over its size and orientation.
|
functionality. For example, it allows more control over its size and orientation.
|
||||||
|
|
||||||
|
@ -172,22 +172,22 @@ Since a circle in OpenSCAD can only be approximated by a regular polygon with
|
||||||
a number of straight sides, this can lead to size and shape inaccuracies.
|
a number of straight sides, this can lead to size and shape inaccuracies.
|
||||||
To counter this, the `realign=` and `circum=` arguments are also provided.
|
To counter this, the `realign=` and `circum=` arguments are also provided.
|
||||||
|
|
||||||
The `realign=` argument, if set `true`, rotates the `oval()` by half the angle
|
The `realign=` argument, if set `true`, rotates the `ellipse()` by half the angle
|
||||||
between the sides:
|
between the sides:
|
||||||
|
|
||||||
```openscad-2D
|
```openscad-2D
|
||||||
oval(d=100, $fn=8, realign=true);
|
ellipse(d=100, $fn=8, realign=true);
|
||||||
```
|
```
|
||||||
|
|
||||||
The `circum=` argument, if true, makes it so that the polygon forming the
|
The `circum=` argument, if true, makes it so that the polygon forming the
|
||||||
`oval()` circumscribes the ideal circle instead of inscribing it.
|
`ellipse()` circumscribes the ideal circle instead of inscribing it.
|
||||||
|
|
||||||
Inscribing the ideal circle:
|
Inscribing the ideal circle:
|
||||||
|
|
||||||
```openscad-2D
|
```openscad-2D
|
||||||
difference() {
|
difference() {
|
||||||
circle(d=100, $fn=360);
|
circle(d=100, $fn=360);
|
||||||
oval(d=100, $fn=8);
|
ellipse(d=100, $fn=8);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -195,39 +195,39 @@ Circumscribing the ideal circle:
|
||||||
|
|
||||||
```openscad-2D
|
```openscad-2D
|
||||||
difference() {
|
difference() {
|
||||||
oval(d=100, $fn=8, circum=true);
|
ellipse(d=100, $fn=8, circum=true);
|
||||||
circle(d=100, $fn=360);
|
circle(d=100, $fn=360);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The `oval()` module, as its name suggests, can be given separate X and Y radii
|
The `ellipse()` module, as its name suggests, can be given separate X and Y radii
|
||||||
or diameters. To do this, just give `r=` or `d=` with a list of two radii or
|
or diameters. To do this, just give `r=` or `d=` with a list of two radii or
|
||||||
diameters:
|
diameters:
|
||||||
|
|
||||||
```openscad-2D
|
```openscad-2D
|
||||||
oval(r=[30,20]);
|
ellipse(r=[30,20]);
|
||||||
```
|
```
|
||||||
|
|
||||||
```openscad-2D
|
```openscad-2D
|
||||||
oval(d=[60,40]);
|
ellipse(d=[60,40]);
|
||||||
```
|
```
|
||||||
|
|
||||||
Another way that `oval()` is enhanced over `circle()`, is that you can anchor,
|
Another way that `ellipse()` is enhanced over `circle()`, is that you can anchor,
|
||||||
spin and attach it.
|
spin and attach it.
|
||||||
|
|
||||||
```openscad-2D
|
```openscad-2D
|
||||||
oval(r=50, anchor=BACK);
|
ellipse(r=50, anchor=BACK);
|
||||||
```
|
```
|
||||||
|
|
||||||
```openscad-2D
|
```openscad-2D
|
||||||
oval(r=50, anchor=FRONT+RIGHT);
|
ellipse(r=50, anchor=FRONT+RIGHT);
|
||||||
```
|
```
|
||||||
|
|
||||||
Using spin on a circle may not make initial sense, until you remember that
|
Using spin on a circle may not make initial sense, until you remember that
|
||||||
anchoring is performed before spin:
|
anchoring is performed before spin:
|
||||||
|
|
||||||
```openscad-2D
|
```openscad-2D
|
||||||
oval(r=50, anchor=FRONT, spin=-30);
|
ellipse(r=50, anchor=FRONT, spin=-30);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -349,7 +349,7 @@ They also have somewhat different attachment behavior:
|
||||||
|
|
||||||
```openscad-2D
|
```openscad-2D
|
||||||
color("green") stroke(circle(d=50), closed=true);
|
color("green") stroke(circle(d=50), closed=true);
|
||||||
oval(d=50,$fn=5)
|
ellipse(d=50,$fn=5)
|
||||||
attach(LEFT) color("blue") anchor_arrow2d();
|
attach(LEFT) color("blue") anchor_arrow2d();
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue