1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 14:18:13 +01:00
dotSCAD/docs/lib3x-footprints3.md

52 lines
1.1 KiB
Markdown
Raw Normal View History

2020-05-25 13:43:44 +08:00
# footprints3
2021-02-24 21:09:54 +08:00
A 3D verion of [footprint2](https://openhome.cc/eGossip/OpenSCAD/lib3x-footprints2.html).
2020-05-25 13:43:44 +08:00
**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
2022-06-06 13:11:46 +08:00
use <polyline_join.scad>
use <turtle/footprints3.scad>
2020-05-25 13:43:44 +08:00
function xy_arc_cmds(radius, angle, steps) =
let(
fa = angle / steps,
ta = fa / 2,
leng = sin(ta) * radius * 2
)
[
["turn", ta],
each [
2020-05-25 13:43:44 +08:00
for(i = [0:steps - 2])
each [["forward", leng], ["turn", fa]]
],
["forward", leng],
["turn", ta]
];
2020-05-25 13:43:44 +08:00
poly = footprints3(
[
["forward", 10],
["turn", 90],
["forward", 10],
each xy_arc_cmds(5, 180, 12),
["pitch", 90],
["forward", 10],
["roll", 90],
each xy_arc_cmds(5, 180, 12),
["forward", 10]
]
2020-05-25 13:43:44 +08:00
);
2021-11-18 08:08:50 +08:00
polyline_join(poly)
sphere(.5);
2020-05-25 13:43:44 +08:00
2021-02-24 21:09:54 +08:00
![footprints3](images/lib3x-footprints3-1.JPG)
2020-05-25 13:43:44 +08:00