Bring back a representation of layers#233
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @sophiedeziel and the rest of your teammates on |
|
Visit the preview URL for this PR (updated for commit e4442eb): https://gcode-preview--pr233-10-16-bring-back-a-r-me4yacky.web.app (expires Mon, 18 Nov 2024 01:53:40 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 59bd114ae4847b32c2bba0b68620b9069a3e3531 |
|
How will we handle a gcode file that is incrementally fed to the preview, like when used as a realitime progress of an actual print? |
|
It will handle it pretty well actually! As long as the same job object is used and appended paths on top of, they will be indexed on the right layer. Layers are no longer used in the rendering logic (yet), it's a convenience for lib clients. I have plans for the layer height to be calculated from movement and used for the geometries. To officially support incremental rendering, some logic has to be added to pop back the last path into the current path in case it was not finished. It's reference in the layer is kept. After that, rendering will just work |
d7c8676 to
323befc
Compare
|
I made the changes to make sure progressive rendering works gracefully in all cases |
323befc to
c6e0942
Compare
|
Turns out layers are already useful with their z and height attributes! |
52a3949 to
e4442eb
Compare
* Remove the code enum (#229) * Bring back a representation of layers * No need to expose isPlanar now * Make layers 100% progressive rendering ready * Layer number, height and z * fix the splitting logic

Part of #221
There is value into getting a representation of layers like we had before. I brought back the class. The reason is that its is very well suited to hold some information like layer height.
I exposed the layer count as a getter instead of exposing layers themselves. It is an essential affordance for library clients to implement some sort of slider to inspect the inner layers using single layer mode and/or min/max layers.
I had to slightly change it just to replace GCommands by Paths.