mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-22 22:35:18 +02:00
add doc
This commit is contained in:
BIN
docs/images/lib2x-footprints2-1.JPG
Normal file
BIN
docs/images/lib2x-footprints2-1.JPG
Normal file
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
@@ -7,7 +7,7 @@ Drive a turtle with `["forward", length]` or `["turn", angle]`. This function is
|
||||
## Parameters
|
||||
|
||||
- `cmds` : A list of `["forward", length]`s and `["turn", angle]`s.
|
||||
- `start` : Set the start point of the turtle.
|
||||
- `start` : Set the start point of the turtle. Default to `[0, 0]`.
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -50,5 +50,5 @@ Drive a turtle with `["forward", length]` or `["turn", angle]`. This function is
|
||||
|
||||
polyline2d(poly, width = 1);
|
||||
|
||||

|
||||

|
||||
|
||||
|
55
docs/lib2x-footprints3.md
Normal file
55
docs/lib2x-footprints3.md
Normal file
@@ -0,0 +1,55 @@
|
||||
# footprints3
|
||||
|
||||
A 3D verion of [footprint2](https://openhome.cc/eGossip/OpenSCAD/lib2x-footprints2.html).
|
||||
|
||||
**Since:** 2.4
|
||||
|
||||
## Parameters
|
||||
|
||||
- `cmds` : A list of `["forward", length]`s, `["turn", angle]`s, `["roll", angle]`s and `["pitch", angle]`s.
|
||||
- `start` : Set the start point of the turtle. Default to `[0, 0, 0]`.
|
||||
|
||||
## Examples
|
||||
|
||||
use <hull_polyline3d.scad>;
|
||||
use <turtle/footprints3.scad>;
|
||||
|
||||
function xy_arc_cmds(radius, angle, steps) =
|
||||
let(
|
||||
fa = angle / steps,
|
||||
ta = fa / 2,
|
||||
leng = sin(ta) * radius * 2
|
||||
)
|
||||
concat(
|
||||
[["turn", ta]],
|
||||
[
|
||||
for(i = [0:steps - 2])
|
||||
each [["forward", leng], ["turn", fa]]
|
||||
],
|
||||
[["forward", leng], ["turn", ta]]
|
||||
);
|
||||
|
||||
poly = footprints3(
|
||||
concat(
|
||||
[
|
||||
["forward", 10],
|
||||
["turn", 90],
|
||||
["forward", 10]
|
||||
],
|
||||
xy_arc_cmds(5, 180, 12),
|
||||
[
|
||||
["pitch", 90],
|
||||
["forward", 10],
|
||||
["roll", 90]
|
||||
],
|
||||
xy_arc_cmds(5, 180, 12),
|
||||
[
|
||||
["forward", 10]
|
||||
]
|
||||
)
|
||||
);
|
||||
|
||||
hull_polyline3d(poly, thickness = 1);
|
||||
|
||||

|
||||
|
Reference in New Issue
Block a user