diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2019-11-03 16:23:43 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2019-11-03 16:23:43 +0000 |
| commit | 157f6c0fdb37e8490c293a44d9ed08cd3dc63291 (patch) | |
| tree | 4cfbb2899e615c90f033a31aa4019513047d805e /examples/place_in_rect.lua | |
| parent | add profiling support (diff) | |
| download | watch-cad-157f6c0fdb37e8490c293a44d9ed08cd3dc63291.tar.gz watch-cad-157f6c0fdb37e8490c293a44d9ed08cd3dc63291.zip | |
update examples, fixes
Diffstat (limited to 'examples/place_in_rect.lua')
| -rw-r--r-- | examples/place_in_rect.lua | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/examples/place_in_rect.lua b/examples/place_in_rect.lua new file mode 100644 index 0000000..3650257 --- /dev/null +++ b/examples/place_in_rect.lua @@ -0,0 +1,17 @@ +-- return function (state) +function place_in_rect(S) + input.selection(S.objs, '^led-') + input.rect(S.dest) + + local start = S.min() + local step = S.dest():size() + step.y = 0 + + for i, obj in ipairs(S.objs()) do + local pos = start + step:scale(i) + draw.cross(pos) + -- op.move(obj, pos) + end +end + +return place_in_rect |
