1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-28 08:50:30 +02:00

update doc

This commit is contained in:
Justin Lin
2019-09-29 14:15:44 +08:00
parent c335111b44
commit df52a9e52e

View File

@@ -4,7 +4,7 @@ An implementation of Turtle Graphics with Fluent API. It moves on the xy plane.
## Parameters ## Parameters
- `t` : The data of a turtle. If it's ignored, `t2d` creates a new turtle. - `t` : The data of a turtle. `t2d()` with no arguments will return a turtle with the point `[0, 0]` and the angle `0`.
- `cmd` : It accepts a string or a list of commands. - `cmd` : It accepts a string or a list of commands.
- Given a string: `"turn"`, `"forward"`, `"point"` or `"angle"`. If `"turn"` is provided, the `angle` parameter is required. If `"forward"` is provided, `leng` is required. `"point"` and `"angle"` are used to get respective data from a turtle. - Given a string: `"turn"`, `"forward"`, `"point"` or `"angle"`. If `"turn"` is provided, the `angle` parameter is required. If `"forward"` is provided, `leng` is required. `"point"` and `"angle"` are used to get respective data from a turtle.
- Given a list: `[[cmd1, value], [cmd2, value2], ...]`. For example, `[["forward", 10], ["turn", 120]]` will forward a turtle 10mm and turn it 120 degrees. - Given a list: `[[cmd1, value], [cmd2, value2], ...]`. For example, `[["forward", 10], ["turn", 120]]` will forward a turtle 10mm and turn it 120 degrees.