Hey. Recently I was printing some gears. I've found the location of the Z-seam* affecting the smoothness of the gears, which is important to me. So much so that I will manually edit the g-code to move it where I deem necessary, after trying my hardest to let Cura place them in inside corners.
The one thing I've found a bit annoying though is that it is cumbersome to check every layer, using the toolpath animation to check the start/seams. I noticed Slic3r has an option to show these, but I prefer Cura anyway.. So I thought maybe I could develop a plugin that does this, after not finding any option or plugins.. At this point I don't see how I could write a separate plugin for it, but what I found to work is to modify the original SimulationView "plugin". (The code that provides the Layer view in Cura's Preview tab).
Point of this topic:
Find others' thoughts in this feature, ideas / help developing it..
How to use:
In Cura's plugin directory: C:\Program Files\Ultimaker Cura 4.7\plugins on my installation, move the existing SimulationView folder elsewhere as backup, then place mine in there. Find mine at https://github.com/BasF0/Cura/tree/dev/plugins/SimulationView
DevTalk:
Not knowing Cura's code, or having ever written a plugin, or knowing a thing about shaders or glsl this was hard, but a few days in and here we are.
I walk through the LayerData and check where a new skin line occurs. (Confusingly, I've found that not to be "SkinType" but rather "Inset0Type"). The vertex that is the start of such a new line is added to a new LayerData object, created through a LayerDataBuilder. I've found that in this way, the Uranium backend will accept it 🙂 The day of writing this post, I've rewritten the code to do this inside a "Job" and it seems that SimulationView' _onSceneChanged is a good moment to recompute the starts. I have written a new shader that takes in points, and the geometry shader then emits a vertex_strip representing a 3d rectangle for each point. Perhaps a rectangle in the start is not the best shape one can think of, but a simple rectangle does the job for now. The vertex normals are probably wrong, by the way.. The size is also hardcoded in the shader because I was having some issues.
Debugging this was hard. I would simply reboot cura, open an stl, slice it, go to preview tab, to see my results. If I made an error in Python, the entire layer view would usually not load. If I made a syntax error inside the shader, the starts simply wouldn't be drawn, so I would manually have to check my changes. Is there an easier way for that ? I tried seeing if I could unload and reload the SimulationView plugin, but it seems not possible atm.
Bugs, todos and Ideas:
- currently hardcoded square height; should depend on line height I guess
- perhaps a configurable shape/size
- configurable color (or color per extruder, I dont know how cura handles that atm anyway)
- in the menu, the color indicator for the starts option does not display the correct color
- perhaps convert to a separate plugin that can be installed via the marketplace
- a way to separate the current top layer starts from the others.. perhaps simply a different color
- the "show starts" option is still visible when in compatibility mode (when the shader shouldn't be drawn)
- what would be even better is if I could drag the square to change the start! I have an idea how that might work, but am not sure of its implications:
I suppose the square should be draggable in the layer-plane (X, Z I believe?) and could then snap to each line start (visually). To adjust the polygon, we could copy the now skipped lines to the end of the current set of lines making up the skin, converting the 'skipped' lines into travel moves.
Of course, when we have many layers; perhaps some multi-layer start move should then be thought of as well.. anyway
*Not sure I like the name "Z-seam" because it has nothing to do with the Z-axis. Rather, it is the layer its skin/perimeter/wall seam.