Repository navigation
🪲 Fix downloading the turtle drawings and make them faster - #6736
Conversation
|
@jpelay the dst download we currently have is not useful for embroidery machines. That is because 10 turtle steps corresponds to 1 mm in the library turtlethread. And most of our turtle drawings are in the order of magnitude of 10 steps. For example creating this boat: results in a embroidery of 1 by 1.4 cm. My suggestion would be to use the scale functionality (https://turtlethread.com/en/api/turtle.html) to scale the steps by 4: |
|
Hello @AnneliesVlaar! Thank you for the suggestion! Can you check now? |
…om/hedyorg/hedy into fix-turtle-download-6548-recording
Fixes the turtle png and dst downloads by storing locally the points the turtle draws and send that information back to the server, in turn the server just needs to process these points and serve the file.
It's a lot faster than what we had because the server doesn't need to run the program again, we dont need to store anything in the server.
Also fixes the embroidery files by making the drawing bigger, and without suffering from the problem of being mirrored.
Fixes #6548
How to test
hedy_drawing.zipdownloads, containinghedy_drawing.dstandhedy_drawing.png.forward 100,turn right,forward 50should look like a Γ, not an L (before this PR drawings came out upside down).ask:distance is ask How far?/forward distance. The file should use the answer you typed.random:angles is 90, 180/turn angles at random/forward 50. The file should match the drawing you got on screen.if, level 12definewith decimals, level 14while.pytest tests/python_html/test_app_routes.py -k MachineAndMicrobitand the Cypress spectests/cypress/e2e/hedy_page/save_turtle_drawing.cy.js.